Skip to content

@bloopjs/toodle


@bloopjs/toodle / text/shaping / measureText

Function: measureText() ​

measureText(font, text, wordWrap?): MsdfTextMeasurements

Defined in: text/shaping.ts:122

Measure the text and return measurements for block + each glyph.

Parameters ​

font ​

MsdfFont

The font to use.

text ​

string

The text to measure

wordWrap? ​

WordWrapOptions

Maximum word length before word wrapping

Returns ​

MsdfTextMeasurements

The measurements of the text in em units.