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.

Summary

Nested types

public final class VerticalTextLayout.Builder

Builder class for creating instances of VerticalTextLayout.

Public methods

final void
draw(@NonNull Canvas canvas, @Px float x, @Px float y)

Draws this text layout onto the specified Canvas.

final int
final float
final int

The text orientation used for building this vertical layout.

final @NonNull TextPaint

The TextPaint used for building this vertical layout.

final int
final @NonNull CharSequence
final @Px float

The width constraint of the vertical text in pixels.

Public methods

draw

Added in 1.0.0-alpha01
public final void draw(@NonNull Canvas canvas, @Px float x, @Px float y)

Draws this text layout onto the specified Canvas.

Parameters
@NonNull Canvas canvas

The Canvas to draw onto.

@Px float x

The horizontal offset in pixels. The drawing origin is the top-right corner.

@Px float y

The vertical offset in pixels. The drawing origin is the top-right corner.

getEnd

Added in 1.0.0-alpha01
public final int getEnd()

getHeight

Added in 1.0.0-alpha01
public final float getHeight()

getOrientation

Added in 1.0.0-alpha01
public final int getOrientation()

The text orientation used for building this vertical layout.

getPaint

Added in 1.0.0-alpha01
public final @NonNull TextPaint getPaint()

The TextPaint used for building this vertical layout. Do not mutate this paint instance.

getStart

Added in 1.0.0-alpha01
public final int getStart()

getText

Added in 1.0.0-alpha01
public final @NonNull CharSequence getText()

getWidth

Added in 1.0.0-alpha01
public final @Px float getWidth()

The width constraint of the vertical text in pixels.