VerticalTextLayout
public final class VerticalTextLayout
Represents the result of laying out text vertically.
This class encapsulates the result of a vertical text layout process. It stores the layout's properties and provides methods to draw the layout on a Canvas.
NOTE: Currently, this API leverages a platform feature added in API 36 (Android 16). For older API levels, it provides a graceful fallback. We will provide a backport to API 31 in the future.
Summary
Public constructors |
|---|
VerticalTextLayout( |
Public methods |
|
|---|---|
final void |
Draws this text layout onto the specified |
final @Px float |
getWidth()The width constraint of the vertical text in pixels. |
final boolean |
Capability query to determine whether or not |
Public constructors
VerticalTextLayout
public VerticalTextLayout(
@NonNull CharSequence text,
int start,
int end,
@NonNull TextPaint paint,
@Px float height,
int orientation
)
Public methods
draw
public final void draw(@NonNull Canvas canvas, @Px float x, @Px float y)
Draws this text layout onto the specified Canvas.
getWidth
public final @Px float getWidth()
The width constraint of the vertical text in pixels.
isVerticalTextSupported
public final boolean isVerticalTextSupported()
Capability query to determine whether or not VerticalTextLayout supports vertical text painting. If it is false, calling methods will have no effect.