| Crates.io | mplusfonts |
| lib.rs | mplusfonts |
| version | 0.2.3 |
| created_at | 2025-03-20 07:47:52.34062+00 |
| updated_at | 2025-09-08 06:42:41.909814+00 |
| description | Parametrized bitmap font family for embedded-graphics |
| homepage | https://crates.io/crates/mplusfonts |
| repository | https://github.com/immersum/mplusfonts |
| max_upload_size | |
| id | 1598968 |
| size | 189,590 |
Parametrized bitmap fonts for embedded-graphics, with font rasterization powered by swash.
Adds an optimal subset of M+ FONTS to your next embedded Rust project.1

mplusfonts allows you to choose between
three typefaces, with font properties that you will want to specify. Using this crate, you can
have font anti-aliasing and font-based kerning on embedded devices, in a no_std environment.mplus! macro generates Rust code for your
bitmap font. After expanding the macro and compiling your code, the TrueType fonts that come with
this crate are no longer used.strings attribute helps you find and add
characters and character clusters to your bitmap font. You can also specify ranges of characters
to include as parameters for the mplus! macro.mplusfonts as a dependency.#[strings] can find its helper attributes.#[strings::emit] to the bitmap font definition.#[strings::skip].[dependencies]
mplusfonts = "0.2"
#[mplusfonts::strings]
pub fn main() -> Result<(), Infallible> {
let text = format!("{} KB_OK", 16 * 40);
let mut display: SimulatorDisplay<Rgb565> = SimulatorDisplay::new(Size::new(320, 240));
#[strings::emit]
let bitmap_font = mplus!(code(115), BOLD, code_line_height(24), true, 1, 4, '0'..='9');
let character_style = BitmapFontStyle::new(&bitmap_font, Rgb565::GREEN);
Text::new(&text, Point::new(20, 20), character_style).draw(&mut display)?;
let output_settings = OutputSettingsBuilder::new().scale(3).build();
#[strings::skip]
Window::new("Simulator", &output_settings).show_static(&display);
Ok(())
}
For more examples, see the examples folder.
alloc feature.The minimum supported Rust version for mplusfonts is 1.85.
The source code of mplusfonts is dual-licensed under:
at your option.
Rust 2024 is required to build this crate ↩