bmpf2fnt
Convert Stranded II / Blitz3D .bmpf bitmap font files to BMFont .fnt format.
Usage
bmpf2fnt <bmpf> <bmp>... [output]
<bmpf>– the.bmpffont definition file<bmp>...– one or more.bmpfont atlas textures[output]– optional output directory (default: current directory)
Each .bmp produces a corresponding .fnt file with the same base name.
Example
# produces ./font.fnt
# produces output/font1.fnt and output/font2.fnt
Library
The crate also provides a library API:
use ;
let font_data = read?;
let font = parse?;
let img = open?.into_rgba8;
let = img.dimensions;
let atlas = build_font_atlas?;
let fnt = generate_bmfont;
write?;
Modules
| Module | Description |
|---|---|
bmpf |
.bmpf file parsing |
atlas |
Glyph region detection and atlas building |
fnt |
BMFont .fnt text generation |
cli |
Command-line interface |
error |
Error types |
.bmpf file format
[46-byte ASCII header] "Unreal Software Bitmap Font Wizard bmpf File\r\n"
[optional 6-byte meta] only present in full (256-char) fonts:
u16 LE: char_count (256)
u16 LE: font_height (pixels)
u16 LE: unknown
[3-byte records …]
u8: character code
u16 LE: advance width
[terminator] 00 00 00
License
GPL-3.0-or-later. See LICENSE.