https://github.com/tsoding/domsson-fontgen
A simple tool that compresses bitmap fonts created by @domsson with a simple custom compression algorithm.
https://github.com/tsoding/domsson-fontgen
Last synced: 4 months ago
JSON representation
A simple tool that compresses bitmap fonts created by @domsson with a simple custom compression algorithm.
- Host: GitHub
- URL: https://github.com/tsoding/domsson-fontgen
- Owner: tsoding
- License: mit
- Created: 2021-05-07T09:58:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T09:19:35.000Z (over 4 years ago)
- Last Synced: 2025-04-29T12:24:58.528Z (8 months ago)
- Language: C
- Size: 79.1 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fontgen
A simple tool that compresses bitmap fonts created by
[domsson](https://opengameart.org/users/domsson) with a simple custom
compression algorithm. Compresses those specific fonts better than PNG.
Originally created for my experimental [rust-browser-game](https://github.com/tsoding/rust-browser-game).
## Expected parameters of the font
- A png image file 128x64 pixels
- Monochrome image with black for the background and white for the foreground
## Compression comparison with PNG
| File Name | Original PNG size (bytes) | Size of `./fontgen -f bin` output (bytes) |
| --- | --- | --- |
| [charmap-cellphone_white_0.png](./charmap-cellphone_white_0.png) | 1103 | 623 |
| [charmap-futuristic_black_0.png](./charmap-futuristic_black_0.png) | 1070 | 621 |
| [charmap-oldschool_white.png](./charmap-oldschool_white.png) | 1026 | 622 |
## Compression/Decompression Algorithms
TBD
## Quick Start
```console
$ make
$ ./fontgen ./charmap-oldschool_white.png
```