Documentation
    Preparing search index...

    Interface BitmapGlyph

    One monospace letterform: its pixels, plus the metrics a layout needs.

    Glyphs are immutable — a font is shared by every atlas built from it, and by every layout that reads one — so nothing here has a setter.

    interface BitmapGlyph {
        advance: number;
        blank: boolean;
        char: string;
        codePoint: number;
        rows: readonly number[];
    }
    Index
    advance: number

    Pen movement after drawing this glyph, in font pixels. Equal to BitmapFont.cellWidth for every glyph of a monospace font; per-glyph here because the field is what a proportional font will vary, and a layout that reads it today needs no change then.

    blank: boolean

    Whether every pixel is clear — true for the space, and for nothing else in the built-in font.

    Layout uses it to advance the pen without emitting a quad: a fully transparent quad costs a draw and contributes nothing, and a string of text is roughly one-fifth spaces.

    char: string

    The character this glyph draws, or "" for BitmapFont.fallback.

    codePoint: number

    The code point this glyph draws, or -1 for BitmapFont.fallback, which stands for every code point the font does not cover rather than one.

    rows: readonly number[]

    Pixel rows, top first, one bitmask each, covering cell rows BitmapFont.glyphTop onwards. Bit glyphWidth - 1 - column is column column, so the most significant of the five bits is the leftmost pixel.

    Read pixels with glyphPixel rather than shifting by hand — it takes cell coordinates, so it also answers correctly for the blank rows this array does not contain.