TextDrawer

interface TextDrawer(source)

Common interface for drawers that typeset text using typesetText, see SlugTextDrawer and VectorTextDrawer.

Inheritors

Properties

Link copied to clipboard
abstract var style: TextStyle

The style that is cascaded into the style of every span.

Functions

Link copied to clipboard
abstract fun addGlyphs(glyphs: List<TypesetGlyph>)

Adds glyphs that are already typeset, for example by typesetText.

Link copied to clipboard
open fun addText(spans: List<TextSpan>, boxes: List<Rectangle>)

Typesets spans into boxes and adds the result.

open fun addText(text: String, boxes: List<Rectangle>, style: TextStyle = TextStyle())
open fun addText(text: String, box: Rectangle, style: TextStyle = TextStyle())

abstract fun addText(face: Face, text: String, position: Vector2)

Adds a single line of text in face starting at position, without typesetting.

Link copied to clipboard
@JvmName(name = "addTextInShapes")
fun TextDrawer.addText(spans: List<TextSpan>, shapes: List<Shape>)

Typesets spans into shapes and adds the result. Shapes are filled from top to bottom, text flows from one shape to the next, see typesetText for details.

Link copied to clipboard
abstract fun clear()

Removes all added text.

Link copied to clipboard
abstract fun draw(drawer: Drawer)

Draws all added text.