Documentation
    Preparing search index...

    Function createBitmapFont

    • Assembles a BitmapFont from an encoded table (§56 MVP tier).

      BUILTIN_FONT is built with it, and so is any other face that reaches the engine as pixels — a converted BMFont, a subset shipped with an application, a second built-in weight. Keeping one constructor means one place validates the metrics, and buildGlyphAtlas never meets a font whose glyphs overflow its cell.

      const tiny = createBitmapFont({
      name: "tiny-3x5",
      cellWidth: 4, cellHeight: 5, glyphWidth: 3,
      glyphTop: 0, ascent: 5, firstCodePoint: 0x41,
      glyphs: ["57575", "77577"], // A, B — three bits per row
      fallback: "77777",
      });

      Every glyph is monospaced at cellWidth: BitmapGlyph.advance exists so a proportional face can vary it later, but nothing here reads a per-glyph width, and a proportional font arrives with the kerning table §56 also defers.

      Throws RangeError on any malformed metric or row string (§85). Validation is at construction because a font is built once and read millions of times.

      Parameters

      Returns BitmapFont