Skip to content
BMFont compatible, cross-platform command line bitmap font generator
C++ Python CMake C
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
src
tests Fix functional tests expected results Dec 19, 2017
.gitignore
.travis.yml
CMakeLists.txt Change cmake version to 3.0 Dec 27, 2017
LICENSE
README.md Update README Jun 2, 2018
appveyor.yml Fix deploy Dec 24, 2017
fontbm.py
pull_request_template.md

README.md

fontbm

sample sample

Build Status Build status

BMFont compatible, command line bitmap font generator.

Usage

Download compiled version (fontbm.zip for windows, fontbm for linux) from Releases. Run (fontbm.exe for windows, of course):

fontbm --font-file Vera.ttf --output vera

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

Available options (bold options are required):

option default comment
--font-file path to ttf file, required
--output output files name without extension, required
--font-size 32 font size
--color 255,255,255 foreground RGB color, for example: 32,255,255 (without spaces)
--background-color background RGB color, for example: 0,0,128 (without spaces), transparent by default
--chars 32-127 required characters, for example 32-64,92,120-126 (without spaces), default value is 32-127 if 'chars-file' option is not defined
--chars-file optional path to UTF-8 text file with additional required characters (will be combined with 'chars' option).
--data-format txt output data file format: txt, xml, bin, json
--include-kerning-pairs include kerning pairs to output file
--padding-up 0 padding up
--padding-right 0 padding right
--padding-down 0 padding down
--padding-left 0 padding left
--spacing-vert 0 spacing vertical
--spacing-horiz 0 spacing horizontal
--texture-width 256 texture width
--texture-height 256 texture height

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.0 (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.

License

MIT License

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

You can’t perform that action at this time.