Skip to content

wrapRuns()

function wrapRuns(
runs,
maxWidth,
font,
measurer,
wordWrap?
): LayoutTextRun[][];

Wraps styled runs into lines that fit maxWidth points, with the same rules as wrapText (explicit breaks, breaks at spaces, long words split by character). Each run is measured with its own bold/italic font.

Parameter Type Default value
runs LayoutTextRun[] undefined
maxWidth number undefined
font FontSpec undefined
measurer TextMeasurer undefined
wordWrap boolean true

LayoutTextRun[][]