embedded-bitmap-fonts
A comprehensive collection of bitmap fonts for no_std environments, designed for use with the embedded-graphics crate.
Features
- 27 font families with 134 font variants
- Pixel-doubling support - Scale fonts 2x, 3x, or more with zero additional flash cost
- No-std compatible - Works on embedded systems without an allocator
- Feature flags - Include only the fonts you need to minimize binary size
Usage
Add to your Cargo.toml:
[]
= { = "0.1", = ["terminus"] }
Draw text:
use ;
use ;
let style = new;
new.draw?;
Pixel Doubling
Scale fonts without additional memory cost:
use FONT_8x16;
// Original 8x16 font
let small = &FONT_8x16;
// Pixel-doubled 16x32 font (same bitmap data!)
let large = FONT_8x16.pixel_double;
// Triple size 24x48
let huge = FONT_8x16.pixel_triple;
// Custom multiplier
let custom = FONT_8x16.pixel_multiply;
Available Fonts
Enable fonts using feature flags:
# Single font
= { = "0.1", = ["terminus"] }
# Multiple fonts
= { = "0.1", = ["terminus", "tamzen", "cherry"] }
# All fonts (not recommended for embedded - large binary size)
= { = "0.1", = ["all-fonts"] }
| Feature | Variants | Available Fonts |
|---|---|---|
artwiz |
12 | FONT_5x10, FONT_6x10, FONT_6x11, FONT_6x13, FONT_7x14, FONT_8x8, FONT_8x10, FONT_8x16, FONT_9x9, FONT_9x10, FONT_10x10_BOLD, FONT_11x12 |
bitocra |
7 | FONT_4x4, FONT_4x5, FONT_4x7, FONT_6x10, FONT_6x11, FONT_7x11, FONT_7x13 |
cherry |
6 | FONT_6x10, FONT_6x10_BOLD, FONT_6x11, FONT_6x11_BOLD, FONT_7x13, FONT_7x13_BOLD |
creep |
1 | FONT_7x12 |
ctrld |
6 | FONT_6x10, FONT_6x10_BOLD, FONT_7x13, FONT_7x13_BOLD, FONT_8x16, FONT_8x16_BOLD |
dina |
4 | FONT_6x10, FONT_7x13, FONT_7x15, FONT_8x16 |
dylex |
9 | FONT_6x10, FONT_6x10_BOLD, FONT_7x13, FONT_7x13_BOLD, FONT_10x20, FONT_10x20_BOLD, FONT_14x14, FONT_14x14_BOLD, FONT_14x20 |
envypn |
2 | FONT_7x13, FONT_7x15 |
gohufont |
4 | FONT_6x11, FONT_6x11_BOLD, FONT_8x14, FONT_8x14_BOLD |
gomme |
1 | FONT_10x20 |
haxor |
6 | FONT_6x11, FONT_7x13, FONT_8x14, FONT_8x17, FONT_9x15, FONT_9x21 |
jmk |
13 | FONT_5x10, FONT_5x11, FONT_5x11_BOLD, FONT_6x11, FONT_6x11_BOLD, FONT_6x13, FONT_6x13_BOLD, FONT_8x15, FONT_8x15_BOLD, FONT_10x20, FONT_10x20_BOLD, FONT_12x24, FONT_12x24_BOLD |
kakwa |
2 | FONT_6x12, FONT_6x12_BOLD |
knxt |
1 | FONT_9x20 |
lokaltog |
3 | FONT_6x10, FONT_6x12, FONT_11x11 |
mplus |
10 | FONT_6x13, FONT_6x13_BOLD, FONT_7x10, FONT_7x11, FONT_8x11_BOLD, FONT_9x11, FONT_9x11_BOLD, FONT_10x14, FONT_11x14_BOLD, FONT_27x29 |
orp |
2 | FONT_6x12, FONT_6x12_BOLD |
peep |
3 | FONT_7x14, FONT_8x16, FONT_10x20 |
phallus |
2 | FONT_10x12, FONT_10x15 |
progsole |
1 | FONT_6x9 |
scientifica |
2 | FONT_5x12, FONT_5x12_BOLD |
spleen |
6 | FONT_5x8, FONT_6x12, FONT_8x16, FONT_12x24, FONT_16x32, FONT_32x64 |
tamzen |
14 | FONT_5x9, FONT_5x9_BOLD, FONT_6x12, FONT_6x12_BOLD, FONT_7x13, FONT_7x13_BOLD, FONT_7x14, FONT_7x14_BOLD, FONT_8x15, FONT_8x15_BOLD, FONT_8x16, FONT_8x16_BOLD, FONT_10x20, FONT_10x20_BOLD |
terminus |
18 | FONT_6x12, FONT_6x12_BOLD, FONT_8x14, FONT_8x14_BOLD, FONT_8x16, FONT_8x16_BOLD, FONT_10x18, FONT_10x18_BOLD, FONT_10x20, FONT_10x20_BOLD, FONT_11x22, FONT_11x22_BOLD, FONT_12x24, FONT_12x24_BOLD, FONT_14x28, FONT_14x28_BOLD, FONT_16x32, FONT_16x32_BOLD |
tewi |
4 | FONT_5x5, FONT_5x5_BOLD, FONT_7x13_BOLD, FONT_13x12 |
trisk |
2 | FONT_8x13, FONT_8x14_BOLD |
xbmicons |
1 | FONT_9x12 |
Total: 134 fonts across 27 families
Contributing
Fonts are generated from BDF (Bitmap Distribution Format) files using a custom codegen tool.
Prerequisites
Regenerate All Fonts
Generate a Single Font
Codegen Options
-i, --input <PATH> Input directory containing BDF files
-o, --output <PATH> Output directory for generated Rust files
-f, --family <NAME> Font family name (used for module name)
-P, --pattern <PAT> Include only files matching pattern
-X, --exclude <PAT> Exclude files matching pattern
Adding New Fonts
- Add BDF files to
fonts/bitmap/<family_name>/ - Add entry to
generate_all.sh - Add feature flag to
Cargo.toml - Add module to
src/lib.rs - Run
./generate_all.sh
Font Sources
Fonts are sourced from the Tecate/bitmap-fonts collection.
License
This crate is licensed under Apache-2.0. Individual fonts may have their own licenses - check the original font sources for details.