TextRuler

Low level interface for measuring text.

Constructors

this
this(Typeface typeface, float lineWidth)
Undocumented in source.

Members

Functions

addWord
Vector2 addWord(String word)

Add the given word to the text. The text must be a single line.

caret
Rectangle caret(Vector2 penPosition)

Get the caret as a 0 width rectangle for the given pen position.

caret
Rectangle caret()

Get the caret as a 0 width rectangle.

startLine
void startLine()

Begin a new line.

Variables

lineWidth
float lineWidth;

Maximum width for a single line. If NaN, no word breaking is performed.

penPosition
Vector2 penPosition;

Current pen position.

textSize
Vector2 textSize;

Total size of the text.

typeface
Typeface typeface;

Typeface to use for the text.

wordLineIndex
size_t wordLineIndex;

Index of the word within the line.

Meta