@mocanvas/editor · interface

TLMeasureTextSpanOpts

interface TLMeasureTextSpanOpts extends TLMeasureTextOpts

Options for splitting text into positioned spans.

Unlike TLMeasureTextOpts the box is given, not derived: spans are laid out inside a shape whose size is already decided, and overflow says what happens to text that does not fit.


Properties · 5

height: number

Content height available. Only consulted when overflow is "truncate".

overflow?: "wrap" | "truncate"

What to do with text that overflows height. Defaults to "wrap".

textAlign?: "start" | "middle" | "end"

Horizontal placement of each line inside width.

verticalTextAlign?: "start" | "middle" | "end"

Vertical placement of the block inside height.

width: number

Content width the text wraps inside, in page units.

Mentioned here

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.