API

Type Alias GlyphRun

Batch of placed glyphs that all use the same curve set and font-unit-to-pixel scale.

type GlyphRun = {
    curveSet: CurveSetId;
    defaultColor?: readonly [number, number, number, number];
    glyphs: readonly PlacedGlyph[];
    pixelsPerFontUnit: number;
}
Index
curveSet: CurveSetId

Which curve set this run's glyph ids index into.

defaultColor?: readonly [number, number, number, number]

Optional default color for every glyph in this run, as linear RGBA in [0,1]. A glyph's own PlacedGlyph.color takes precedence over this. When omitted, glyphs default to opaque white. The rendered alpha is additionally scaled by the whole-block opacity.

glyphs: readonly PlacedGlyph[]
pixelsPerFontUnit: number

Font-units → pixels scale used by the layout.