Export Formats: 6 Ways to Export Bitmap Fonts for Game Engines
Learn how to export bitmap fonts in 6 formats: Text, XML, Binary, JSON, C Header, and MSDF Atlas JSON. Compatible with Unity, Unreal, Godot, embedded systems, and MSDF shader pipelines.
Each export produces a texture atlas (.png) and a descriptor file with glyph positions, metrics, and kerning pairs. Six formats are available, covering most game engines, frameworks, and applications.
How to Export Your Font
Section titled “How to Export Your Font”- Open the Export Dialog: Click the Export button in the top menu bar or press
Ctrl+Shift+S(Cmd+Shift+Son macOS). - Set Font Name: Enter a custom name for your font, or keep the default (your main font family name). This value appears in the
info facefield of the BMFont descriptor. - Set File Name: Enter a custom name for the exported
.zipfile, or keep the default (your current project name). - Choose Export Type: Select the best format for your needs from the dropdown menu. The preview shows the output as
{fileName}.{ext} (BMFont TYPE). - Configure Advanced Options: Depending on the selected format, additional options may appear (see Export Dialog Options below).
- Save: Click the Save button to download a
.ziparchive containing the descriptor file and the PNG texture atlas(es).
Supported Export Formats
Section titled “Supported Export Formats”All formats follow the AngelCode BMFont specification. Pick the one that fits your project’s needs for compatibility, performance, and ease of use.
Text Format (.fnt, .txt)
Section titled “Text Format (.fnt, .txt)”The most widely supported format. Human-readable and easy to debug.
- Best for: Maximum compatibility with engines like Unity, Unreal, and Cocos2d-x.
- Features: Plain text, easy to parse, includes comments for readability.
- Specification: For details, see the text format documentation.
XML Format (.xml, .fnt)
Section titled “XML Format (.xml, .fnt)”Structured format for applications with built-in XML support.
- Best for: Web applications or projects using custom tools that can easily process XML.
- Features: Standard XML structure, self-descriptive tags.
Example:
<?xml version="1.0"?><font> <info face="Arial" size="32" ... /> <common lineHeight="38" base="26" scaleW="512" scaleH="512" pages="1" ... /> <pages> <page id="0" file="font_0.png" /> </pages> <chars count="95"> <char id="65" x="10" y="0" width="18" height="20" xoffset="0" yoffset="6" ... /> </chars></font>Binary Format (.fnt)
Section titled “Binary Format (.fnt)”The most compact format. Fast loading, minimal file size.
- Best for: Performance-critical applications, mobile games, or projects with memory constraints.
- Features: Smallest file size, optimized for quick parsing, follows the BMFont v3 specification.
- Specification: For details, see the binary format documentation.
Structure: The binary file consists of typed blocks for info, common data, pages, characters, and kerning pairs. This layout allows fast read times.
JSON Format (.json)
Section titled “JSON Format (.json)”JSON representation of BMFont data.
- Best for: Web applications, custom parsers, and projects that prefer JSON over plain text or XML.
- Features: Standard JSON structure, parseable in any language, includes
distanceFieldmetadata when using SDF rendering modes.
Example:
{ "info": { "face": "Arial", "size": 32, "bold": 0, "italic": 0 }, "distanceField": { "fieldType": "msdf", "distanceRange": 4 }, "common": { "lineHeight": 38, "base": 26, "scaleW": 512, "scaleH": 512, "pages": 1 }, "pages": ["font_0.png"], "chars": [ { "id": 65, "x": 10, "y": 0, "width": 18, "height": 20, "xoffset": 0, "yoffset": 6, "xadvance": 18, "page": 0 } ]}C Header Format (.c)
Section titled “C Header Format (.c)”Texture data embedded as C byte arrays for resource-constrained environments.
- Best for: Embedded systems, microcontrollers (MCU), and bare-metal applications where file system access is limited.
- Features: Supports 8 pixel formats (GRAY8, RGB, RGBA, ARGB, BGR, ABGR, BGRA, RGB565), configurable reconstruction filter, texture data compiled directly into the binary.
- Pixel Formats: Choose the format that matches your display hardware:
GRAY8(1 byte/pixel) — Monochrome displaysRGB(3 bytes/pixel) — Standard color without alphaRGBA/ARGB(4 bytes/pixel) — Color with alpha, different byte ordersBGR(3 bytes/pixel) /ABGR/BGRA(4 bytes/pixel) — Reversed byte order variantsRGB565(2 bytes/pixel) — 16-bit color for memory-constrained displays
MSDF Atlas JSON (.json)
Section titled “MSDF Atlas JSON (.json)”An msdf-atlas-gen compatible JSON format using em-normalized coordinates.
- Best for: MSDF shader pipelines, custom rendering engines with distance field support, and projects using msdf-atlas-gen tooling.
- Features: Em-normalized coordinates (Y-axis up), font metrics from OpenType tables, distanceField metadata with configurable range, underline position/thickness data.
- Note: This format is designed specifically for SDF/MSDF rendering modes. Using it with the Default render mode will produce valid but non-SDF output.
Advanced Features
Section titled “Advanced Features”Multi-Page Export
Section titled “Multi-Page Export”When a character set exceeds a single texture, SnowB BMF splits it automatically:
- Automatic Pagination: Glyphs are split across multiple texture files (e.g.,
font_0.png,font_1.png). - Unified Descriptor: One descriptor file references all texture pages, so your application loads them together.
Metadata
Section titled “Metadata”Exported files include metadata (font name, size, generation date, character set details) for debugging and asset management.
Advanced Export Options
Section titled “Advanced Export Options”Export Dialog Options
Section titled “Export Dialog Options”When you open the export dialog (Ctrl+Shift+S / Cmd+Shift+S), the following options are available:
Font Name
Section titled “Font Name”Customize the font name that appears in the exported BMFont descriptor file.
- Field: Text input
- Default: Your main font family name
- Effect: Sets the
info faceattribute in the BMFont descriptor (e.g.,info face="MyFont")
File Name
Section titled “File Name”Customize the name of the exported .zip archive.
- Field: Text input with
.zipsuffix - Default: Current project name
- Effect: The download file will be named
{fileName}.zip
Export Type
Section titled “Export Type”Select the output format from a dropdown menu.
- Field: Dropdown select
- Preview: Each option shows
{fileName}.{ext} (BMFont TYPE)so you can see the exact output filename and format - Options: All six supported formats — Text (.fnt/.txt), XML (.xml/.fnt), Binary (.fnt), JSON (.json), C Header (.c), MSDF Atlas JSON (.json)
Pixel Format (C Header only)
Section titled “Pixel Format (C Header only)”Choose the pixel encoding format for texture data embedded in the C header file. This option only appears when C Header format is selected.
- Field: Dropdown select
- Default: GRAY8
- Options:
GRAY8(1 byte/pixel) — Monochrome displaysRGB(3 bytes/pixel) — Standard color without alphaRGBA(4 bytes/pixel) — Color with alphaARGB(4 bytes/pixel) — Alpha-first byte orderBGR(3 bytes/pixel) — Reversed byte orderABGR(4 bytes/pixel) — Alpha-first reversed byte orderBGRA(4 bytes/pixel) — Reversed with trailing alphaRGB565(2 bytes/pixel) — 16-bit color for memory-constrained displays
Reconstruction Filter (C Header only)
Section titled “Reconstruction Filter (C Header only)”Apply a blur filter to the texture before encoding. This option only appears when the selected format supports it.
- Field: Off/On toggle switch
- Default: Off
- Effect: When enabled, applies a reconstruction (blur) filter to the texture data. This can improve visual quality on certain display hardware
Include Textures (C Header only)
Section titled “Include Textures (C Header only)”Control whether texture pixel data is embedded in the C header file. This option only appears when the selected format supports it.
- Field: Off/On toggle switch
- Default: Off
- Effect: When enabled, the generated
.cfile includes the full texture pixel data as C byte arrays, ready to compile directly into your firmware
Extended Data Fields (C Header only)
Section titled “Extended Data Fields (C Header only)”Include additional metadata fields in the export. This option only appears when the selected format supports it.
- Field: Off/On toggle switch
- Default: Off
- Effect: When enabled, the exported file includes extra metadata fields beyond the standard BMFont specification
Troubleshooting Common Issues
Section titled “Troubleshooting Common Issues”-
Characters Not Displaying:
- Ensure the
.fntfile and all.pngtexture files are in the correct path for your project. - Verify that the character you are trying to display was included in the font during export.
- Ensure the
-
Blurry or Distorted Text:
- In your game engine, set the texture’s filter mode to Point or Nearest Neighbor to prevent blurring.
- Ensure your game is rendering the font at a 1:1 pixel scale.
-
Export Fails:
- If the export times out or fails, your character set may be too large for a single texture. Try increasing the texture dimensions in the Layout settings or reducing the number of characters.