Documentation
    Preparing search index...

    Interface TextLayout

    What layoutText produces.

    interface TextLayout {
        height: number;
        lineCount: number;
        quads: readonly TextQuad[];
        width: number;
    }
    Index
    height: number

    Total height in world units — lineCount · size, measuring from the first line's cell top to the last line's cell bottom (the two are the same because a cell is exactly one lineHeight tall).

    lineCount: number

    Number of lines: one more than the \n count, or 0 for the empty string.

    Zero rather than one for "" so that an empty label has zero height and occupies no space in a layout — a caller that reserves a line for empty text wants Math.max(1, lineCount), which is explicit at the point that wants it (decision, WP-3a.4).

    quads: readonly TextQuad[]

    One quad per drawn glyph, in reading order, line by line.

    Blank glyphs — the space, and anything else a font marks BitmapGlyph.blank — advance the pen but emit no quad: a fully transparent rectangle costs a draw call and a blend and contributes nothing. So quads.length is not the string's length, and a caller mapping quads back to characters must track that itself.

    width: number

    Width of the widest line in world units; 0 for text with no glyphs.