Table of Contents

CLI Tool

kernsmith is a cross-platform command-line tool for generating BMFont-compatible bitmap fonts from TTF, OTF, and WOFF files. It produces .fnt + .png pairs ready for use in game engines and rendering frameworks.

Installation

The CLI is located in tools/KernSmith.Cli/ and can be run with:

dotnet run --project tools/KernSmith.Cli -- <command> [options]

Quick Examples

# Basic generation with ASCII charset
kernsmith generate -f MyFont.ttf -s 32

# Bold italic at 48px, XML output
kernsmith generate -f MyFont.ttf -s 48 -b -i --format xml

# Extended Latin with 2px outline
kernsmith generate -f MyFont.ttf -s 24 -c latin --outline 2

# System font
kernsmith generate --system-font "Arial" -s 32

Commands

Command Description
generate Generate BMFont files from a font (main command)
init Scaffold a .bmfc or .hiero config file without rendering
batch Process multiple .bmfc / .hiero files in one invocation
benchmark Benchmark generation performance
inspect Inspect an existing .fnt file
convert Convert between .fnt formats (text, XML, binary)
list-fonts List system-installed fonts
list-rasterizers List available rasterizer backends
info Show metadata from a font file

See the Command Reference for full details on every command and flag.

Configuration Files

Settings can be stored in BMFont .bmfc files or Hiero .hiero (libGDX) files and loaded with --config. When loading, the format is auto-detected by inspecting the file content (the extension is used only as a fallback when the content is inconclusive). Use the init command or --save-config to scaffold a config, then edit by hand.

# Scaffold a .bmfc config
kernsmith init --system-font "Arial" -s 32 -o my-font.bmfc

# Or scaffold a .hiero (libGDX) config
kernsmith init --system-font "Arial" -s 32 -o my-font.hiero

# Generate from it (.bmfc or .hiero)
kernsmith generate --config my-font.hiero

# Override individual settings
kernsmith generate --config my-font.bmfc -s 48 --format xml

Global Options

Flag Description
--help, -h Show help
--version Show version
--no-color Disable colored output
-v, --verbose Show detailed progress
-q, --quiet Suppress all output except errors