TextWriter

class TextWriter(val drawerRef: Drawer?)(source)

Constructors

Link copied to clipboard
constructor(drawerRef: Drawer?)

Properties

Link copied to clipboard
var box: Rectangle
Link copied to clipboard
Link copied to clipboard
val drawerRef: Drawer?
Link copied to clipboard
var drawStyle: DrawStyle

Represents the drawing style for rendering text elements.

Link copied to clipboard
Link copied to clipboard

Represents the horizontal alignment of text within the text box managed by the TextWriter.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Represents the vertical alignment of text within a bounding box.

Functions

Link copied to clipboard

Draw pre-set text tokens.

Link copied to clipboard

Moves the cursor to the beginning of the next line without considering additional line spacing or style-specific adjustments like leading. The cursor's x-coordinate is reset to the left edge of the defined text box, while its y-coordinate is incremented by the height of the current font, if available, or remains unchanged if no font is set.

Link copied to clipboard
fun move(x: Double, y: Double)

Moves the cursor by the specified horizontal and vertical offsets.

Link copied to clipboard
fun newLine()

Moves the cursor position to the start of the next line within the defined text box. The horizontal position of the cursor is reset to align with the left edge of the text box, while the vertical position is incremented by the sum of the font's leading value (if available) and the additional line spacing defined in the style settings.

Link copied to clipboard
fun text(text: String, visible: Boolean = true): List<TextToken>

Draw text

fun text(text: List<String>, visible: Boolean = true): List<TextToken>

Processes a list of text strings to generate text tokens and optionally renders them.

Link copied to clipboard
fun textWidth(text: String): Double

Calculates the total width of a text string based on the glyph metrics and style settings.