SlugTextDrawer

class SlugTextDrawer(boundaryDrawer: BoundaryDrawer? = null) : TextDrawer(source)

Draws text with a BoundaryDrawer, which draws glyphs from their outlines: by default that of the program, a Windfoil drawer, a org.openrndr.draw.slug.SlugDrawer when one is given.

Parameters

boundaryDrawer

the boundary drawer that draws the text, for example a org.openrndr.draw.slug.SlugDrawer, or null for the boundary drawer of the drawer of the active program. The boundary drawer is used from the first time glyphs are added on.

Constructors

Link copied to clipboard
constructor(boundaryDrawer: BoundaryDrawer? = null)

Properties

Link copied to clipboard
val boundaryDrawer: BoundaryDrawer

the boundary drawer that draws the text

Link copied to clipboard
val commands: MutableList<BoundaryCommand>

the commands of the glyphs, in the order they were added; those of transient glyphs index the transient map

Link copied to clipboard
val shaper: TextShapingDriver
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.

Adds the glyphs of text that is placed on a contour by layoutTextOnContour

fun addGlyphs(glyphs: List<TypesetGlyph>, transform: (TypesetGlyph) -> Matrix44)

Adds glyphs that are placed by transform instead of by their positions, for example along a path.

Link copied to clipboard
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.

open fun addText(text: String, boxes: List<Rectangle>, style: TextStyle = TextStyle())
open fun addText(text: String, box: Rectangle, style: TextStyle = TextStyle())
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 the glyphs: those of the shared map, then those of the transient map, which are drawn over them since every map is drawn on its own