Skip to content

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.

  1. Open the Export Dialog: Click the Export button in the top menu bar or press Ctrl+Shift+S (Cmd+Shift+S on macOS).
  2. 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 face field of the BMFont descriptor.
  3. Set File Name: Enter a custom name for the exported .zip file, or keep the default (your current project name).
  4. Choose Export Type: Select the best format for your needs from the dropdown menu. The preview shows the output as {fileName}.{ext} (BMFont TYPE).
  5. Configure Advanced Options: Depending on the selected format, additional options may appear (see Export Dialog Options below).
  6. Save: Click the Save button to download a .zip archive containing the descriptor file and the PNG texture atlas(es).

All formats follow the AngelCode BMFont specification. Pick the one that fits your project’s needs for compatibility, performance, and ease of use.

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.

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>

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 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 distanceField metadata 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 }
]
}

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 displays
    • RGB (3 bytes/pixel) — Standard color without alpha
    • RGBA / ARGB (4 bytes/pixel) — Color with alpha, different byte orders
    • BGR (3 bytes/pixel) / ABGR / BGRA (4 bytes/pixel) — Reversed byte order variants
    • RGB565 (2 bytes/pixel) — 16-bit color for memory-constrained displays

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.

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.

Exported files include metadata (font name, size, generation date, character set details) for debugging and asset management.

When you open the export dialog (Ctrl+Shift+S / Cmd+Shift+S), the following options are available:

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 face attribute in the BMFont descriptor (e.g., info face="MyFont")

Customize the name of the exported .zip archive.

  • Field: Text input with .zip suffix
  • Default: Current project name
  • Effect: The download file will be named {fileName}.zip

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)

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 displays
    • RGB (3 bytes/pixel) — Standard color without alpha
    • RGBA (4 bytes/pixel) — Color with alpha
    • ARGB (4 bytes/pixel) — Alpha-first byte order
    • BGR (3 bytes/pixel) — Reversed byte order
    • ABGR (4 bytes/pixel) — Alpha-first reversed byte order
    • BGRA (4 bytes/pixel) — Reversed with trailing alpha
    • RGB565 (2 bytes/pixel) — 16-bit color for memory-constrained displays

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

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 .c file includes the full texture pixel data as C byte arrays, ready to compile directly into your firmware

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
  • Characters Not Displaying:

    • Ensure the .fnt file and all .png texture 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.
  • 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.