API

Type Alias PlacedGlyph

Positioned glyph instance in pixel space, usually produced by layout before being packed into a GlyphRun.

type PlacedGlyph = {
    color?: readonly [number, number, number, number];
    glyphId: number;
    x: number;
    y: number;
}
Index
color?: readonly [number, number, number, number]

Optional per-glyph color as linear RGBA in [0,1]. When present this overrides the run's defaultColor for this glyph. When omitted, the glyph falls back to the run's defaultColor, and if that is also omitted, to opaque white. The rendered alpha is additionally scaled by the whole-block opacity (e.g. TextRenderable.opacity).

glyphId: number
x: number

Pixel position of glyph baseline origin.

y: number