Skip to content
cosmodev ~/tools/bitmap-font-generator

Générateur de polices bitmap

Images & Media

Transformez un TTF en planche de police bitmap prête pour le jeu + BMFont .fnt — entièrement dans votre navigateur. Rien n'est téléversé.

Drop a font, pick a charset, and press Generate — the PNG sheet and BMFont .fnt are built here, in your browser.

(Documentation in English)

What it does

Turns a TrueType or OpenType font (.ttf / .otf) into a game-ready bitmap font: a single PNG sheet with every glyph rasterized into a grid of fixed-size cells, plus a BMFont TEXT-format .fnt descriptor that engines (LibGDX, Phaser, Godot, Defold, custom renderers) read to draw text. Kerning pairs are baked in. Everything runs in your browser — the font is read with the File API and drawn to a local canvas; nothing uploads.

How to use

  1. Drop a .ttf or .otf file onto the drop zone. Its name and size appear above the controls.
  2. Pick a Charset:
    • ASCII — U+0020–U+007E (94 glyphs: letters, digits, punctuation).
    • Latin-1 — ASCII plus U+00A0–U+00FF (accented letters, symbols).
    • Digits — U+0030–U+0039 (0–9), for score/counters-only fonts.
    • Custom — a comma-separated spec: preset names (ascii, latin1, digits), single codepoints (65 or U+41), and inclusive ranges (65-90, U+4E00-9FFF — the range end may drop the U+ prefix). Whitespace is tolerated. The live counter under the control shows how many glyphs the spec parses to (“94 glyphs”); an invalid spec shows the error inline and disables Generate.
  3. Set Size (8–96 px, the pixel size baked into the sheet) and Padding (0–8 px of breathing room around each cell).
  4. Press Generate font. The preview shows the sheet, its dimensions, and the glyph/missing counts.
  5. Download sheet.png and sheet.fnt.

Examples

  • ASCII at 32 px with 1 px padding → a 1024-wide sheet (32 px + 2 px cells, next power of two), lineHeight ≈ 38, ready for a LibGDX BitmapFont.
  • Digits at 96 px for a HUD score → a tiny 256-wide sheet with ten crisp cells.
  • Custom 65-90, 97-122 → uppercase and lowercase letters only, in order.

Good to know

  • The sheet width is always a power of two (GPU-friendly); height is exactly as many rows as the charset needs. Cells are size + 2×padding squares laid left-to-right, top-to-bottom.
  • The .fnt is BMFont TEXT format: common lineHeight = ceil(ascent + descent) in pixels, base = ascent, one page (sheet.png), and kerning pairs for adjacent charset pairs only (that is all a bitmap font can honor). Both the classic kern table and GPOS kerning are read.
  • Missing glyphs are not an error: codepoints the font doesn’t contain still get a cell in the sheet and a line in the .fnt, but they render empty (width/height/advance 0) and are counted in the result label. Trim your charset instead of paying for blanks.
  • Glyphs are rasterized anti-aliased in black on transparent — tint at draw time with the engine’s font color.
  • Everything runs in this tab. Reload the page and the font is gone — nothing is stored.
Code source14 languages

100% client-side · your data never leaves your browser. Found this useful? Share it with a teammate.