Our studio's designer kept running into the same problem: she'd generate a beautiful pixel-art font using an AI image tool, but Godot (and Unity, Phaser, LibGDX) wouldn't accept it.
The reason is a format mismatch that trips up a lot of indie developers.
What game engines actually need
Most game engines use BMFont format for bitmap fonts — a standard originally from AngelCode's Bitmap Font Generator. It consists of two files:
-
font.png— a sprite sheet with all glyphs laid out on a grid -
font.fnt— a descriptor file that tells the engine where each character is on that sheet, plus kerning pairs and spacing info
Without the .fnt file, the engine has no idea where "A" ends and "B" begins on the sheet. A plain PNG is essentially useless for font rendering.
What AI tools give you
AI image generators — Midjourney, Stable Diffusion, DALL-E — output a single image. They don't know anything about glyph boundaries, character encoding, or BMFont descriptors. You get a pretty picture of letters, not a usable font asset.
This gap surprised me when I first encountered it.
How I ended up solving it
I'm a Spine animator, not a developer — but the problem kept coming up. I started with Python scripts to:
- Take a reference image (pixel art, hand-drawn lettering, etc.)
- Use AI to analyze the visual style and generate all ASCII glyphs in that style
- Lay them out in a spritesheet with proper spacing
- Generate the
.fntdescriptor automatically
Over several months those scripts evolved into a web tool called CopyPxl (copypxl.com). The output drops directly into Godot's BitmapFont importer, Unity's TextMesh Pro, and Phaser's bitmap font loader.
The hard part: glyph width detection
The trickiest piece was handling variable-width glyphs in pixel art. When letterforms bleed into adjacent cells, automated width detection breaks down.
Current approach: analyze pixel density per column to find natural glyph boundaries. It works for clean pixel art but struggles with calligraphic or overlapping styles.
If you've dealt with similar problems — tweaking bitmap font metrics, or working with non-Latin glyph sets — I'd be curious what approaches you've used.
CopyPxl is free to try with a Google sign-in (10 credits). Happy to answer questions about the implementation.
Top comments (0)