VectorTextDrawer

A TextDrawer that produces glyph outlines as Shapes instead of drawing them as slugs. Use it to export text as vectors, to process the outlines further or to draw text using the regular shape pipeline.

StrokeMode is not supported by draw, strokes are always centered.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The glyphs added so far, in the order they were added.

Link copied to clipboard
val shaper: TextShapingDriver
Link copied to clipboard
val shapes: List<Shape>

The outlines of the glyphs added so far, one shape per glyph.

Link copied to clipboard
open override var style: TextStyle

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

Functions

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

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

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

open override fun addText(spans: List<TextSpan>, boxes: List<Rectangle>)

Typesets spans into boxes and adds the result.

open override 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
open override fun clear()

Removes all added text.

Link copied to clipboard
open override fun draw(drawer: Drawer)

Draws all added text.