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 introduced in API 36 (Android 16). On older API levels, it falls back to a no-op.
Summary
Public constructors |
|---|
VerticalTextLayout( |
Public methods |
|
|---|---|
final void |
Draws this text layout onto the specified |
final int |
The number of lines (columns) in this vertical text layout. |
final @Px float |
getWidth()The computed width of the vertical text layout in pixels. |
final boolean |
Capability query to determine whether |
Public constructors
VerticalTextLayout
public VerticalTextLayout(
@NonNull CharSequence text,
int start,
int end,
@NonNull TextPaint paint,
@Px float height,
@NonNull TextOrientation 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.
getLineCount
public final int getLineCount()
The number of lines (columns) in this vertical text layout.
getWidth
public final @Px float getWidth()
The computed width of the vertical text layout in pixels.
isVerticalTextSupported
public final boolean isVerticalTextSupported()
Capability query to determine whether VerticalTextLayout supports vertical text painting. If this returns false, draw will have no effect.