Penjana Fon Bitmap
Images & MediaTukarkan TTF kepada helaian fon bitmap sedia untuk permainan + BMFont .fnt — sepenuhnya dalam pelayar anda. Tiada apa-apa dimuat naik.
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
- Drop a
.ttfor.otffile onto the drop zone. Its name and size appear above the controls. - 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 (65orU+41), and inclusive ranges (65-90,U+4E00-9FFF— the range end may drop theU+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.
- Set Size (8–96 px, the pixel size baked into the sheet) and Padding (0–8 px of breathing room around each cell).
- Press Generate font. The preview shows the sheet, its dimensions, and the glyph/missing counts.
- Download
sheet.pngandsheet.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 LibGDXBitmapFont. - 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×paddingsquares laid left-to-right, top-to-bottom. - The
.fntis 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 classickerntable 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.