layoutText
import { layoutText } from 'pixi-silk/text';
function layoutText(
text: string,
options: LayoutOptions,
measure: TextMeasurer
): TextLayout;
Lays out a block of text. Lines break at \n and, with wordWrap, at spaces. Each character gets
its advance, kerning and letter spacing, then the lines are aligned. Widths come from measure,
so the same layout works for any renderer.
Parameters#
| Parameter | Type |
|---|---|
text | string |
options | LayoutOptions |
measure | TextMeasurer |