gsfnt-0.1.1 is not a library.
gsfnt
CLI tool that packs all images in a directory into a BMFont text .fnt file plus a single merged RGBA PNG atlas. Each glyph’s Unicode code point is taken from the first character of the image filename stem (the part before the extension).
Install
Or build from this repository:
# binary: target/release/gsfnt
Usage
This writes:
font.fnt— AngelCode-style BMFont (text format)font.png— atlas image referenced by the.fnt
If --output already ends with .fnt, that path is used as-is and the PNG is the same path with .png.
Options
| Option | Description |
|---|---|
-i, --input |
Directory containing source images |
-o, --output |
Output prefix (see above) |
--max-width |
Maximum row width for shelf packing (default: 4096) |
Supported image extensions
png, jpg, jpeg, webp, gif, bmp
Filename → glyph
A.png→ glyph forA(U+0041)中.png→ glyph for中emoji_rest.png→ glyph for the first character only (e)
Duplicate code points (two files mapping to the same first character) are rejected with an error listing both paths.
Font metrics (output)
lineHeight/base= maximum image height among all glyphsxoffset= 0yoffset=lineHeight - height(bottom-aligned within the line box)xadvance= glyph width
License
MIT. See LICENSE.