GitPedia

Fontbm

BMFont compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based).

From vladimirgamalyan·Updated June 22, 2026·View on GitHub·

[BMFont](http://www.angelcode.com/products/bmfont/) compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based render). The project is written primarily in C++, distributed under the MIT License license, first published in 2015. Key topics include: bitmap-font, bitmap-font-generator, bmfont, cpp, font.

Latest release: v0.7.1
April 25, 2026View Changelog →

fontbm

BMFont compatible, cross-platform (Linux/macOS/Windows) command line bitmap font generator (FreeType2 based render).

sample
sample

Status

LinuxmacOSWindows
Actions StatusActions StatusActions Status

Usage

Download compiled version (fontbm.zip for Windows, fontbm for Linux) from Releases. Run:

fontbm --font-file FreeSans.ttf --output myfont

It will produce myfont.fnt (file format) and myfont_0.png (how to render text).

Available options (bold options are required):

optiondefaultcomment
--font-filepath to ttf file, required
--outputoutput files name without extension, required
--font-size32font size (it matches to BMFont size, when "Match char height" option in Font Settings dialog is ticked)
--chars32-126required characters, for example 32-64,92,120-126 (without spaces), default value is 32-126 if 'chars-file' option is not defined
--texture-size32x32,64x32,64x64,128x64, 128x128,256x128,256x256, 512x256,512x512,1024x512, 1024x1024,2048x1024,2048x2048comma separated list of allowed texture sizes (without spaces), the first suitable size will be used
--texture-crop-widthcrop unused parts of output textures (width)
--texture-crop-heightcrop unused parts of output textures (height)
--color255,255,255foreground RGB color, for example: 32,255,255 (without spaces)
--background-colorbackground RGB color, for example: 0,0,128 (without spaces), transparent by default
--chars-fileoptional path to UTF-8 text file with additional required characters (will be combined with 'chars' option), can be set multiple times
--data-formattxtoutput data file format: txt, xml, bin, json
--kerning-pairsdisabledgenerate kerning pairs: disabled, basic, regular (tuned by hinter), extended (bigger output size, but more precise)
--padding-up0padding up
--padding-right0padding right
--padding-down0padding down
--padding-left0padding left
--spacing-vert0spacing vertical
--spacing-horiz0spacing horizontal
--monochromedisable anti-aliasing
--max-texture-countmaximum generated texture count (unlimited if not set)
--texture-name-suffixindex_alignedtexture name suffix: "index_aligned", "index" or "none"

Building Linux

Dependencies:

Build:

cmake .  
make

Building Windows (using vcpkg)

Download and install vcpkg and CMake 3.10.2 (or above). Run:

vcpkg install freetype
cmake -G "Visual Studio 14 2015" -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg dir>/scripts/buildsystems/vcpkg.cmake

Open .sln in Visual Studio 2015 and rebuild all.

Building Windows

Download and install CMake 3.5 (or above) and FreeType. Run:

cmake -G "Visual Studio 14 2015"

Open .sln file in Visual Studio 2015, configure paths to FreeType and rebuild all.

Building macOS

(thanx to andycarle https://github.com/Moddable-OpenSource/moddable/issues/325#issuecomment-769615337)

brew install freetype
brew install cmake
git clone https://github.com/vladimirgamalyan/fontbm.git
cd fontbm
cmake .
make

Using AI agents

Copy skills/fontbm directory to your agent's skill directory. Ask AI something like make bitmap font, 24pt, Arial.

Special thanks

License

MIT License

The project also bundles third party software under its own licenses:

Contributors

Showing top 5 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from vladimirgamalyan/fontbm via the GitHub API.Last fetched: 6/28/2026