Documentation
    Preparing search index...

    Interface BitmapFont

    A monospace bitmap font: glyph pixels plus vertical metrics.

    The interface, not the built-in table, is the contract — a loaded BMFont, a generated SDF atlas, or a second built-in face all satisfy it, and buildGlyphAtlas and layoutText accept any of them.

    interface BitmapFont {
        ascent: number;
        cellHeight: number;
        cellWidth: number;
        descent: number;
        fallback: BitmapGlyph;
        glyphs: ReadonlyMap<string, BitmapGlyph>;
        glyphTop: number;
        glyphWidth: number;
        lineHeight: number;
        name: string;
    }
    Index
    ascent: number

    Pixels from the cell's top edge down to the baseline.

    cellHeight: number

    Height of one cell in pixels. Equals ascent + descent exactly.

    cellWidth: number

    Width of one cell in pixels, letterform plus inter-glyph gap. The atlas cell and the laid-out quad are both this wide.

    descent: number

    Pixels from the baseline down to the cell's bottom edge.

    fallback: BitmapGlyph

    Drawn for any character absent from BitmapFont.glyphs.

    glyphs: ReadonlyMap<string, BitmapGlyph>

    Every covered character, keyed by the single-character string, in ascending code-point order (§33: insertion order is the only iteration order).

    glyphTop: number

    Cell row holding BitmapGlyph.rows[0]; rows above it are blank.

    glyphWidth: number

    Width of a letterform in pixels; cellWidth - glyphWidth is the gap.

    lineHeight: number

    Baseline-to-baseline distance in pixels for single-spaced lines. Equal to BitmapFont.cellHeight: consecutive lines' cells stack edge to edge, which is what makes size in layoutText mean "world units per line".

    name: string

    Identifying name, for diagnostics and for keying atlas caches.