Crate bitmap_font
source ·Expand description
This crate provides bitmap fonts for the embedded-graphics
crate. Those don’t only look
better than the built-in fonts by using the good-looking
Tamzen font over a font that renders .
like a +
,
but also allow scaling fonts by pixel-doubling them, giving you two font sizes for the flash
size requirements of the smaller one.
See the tamzen
module for a list of all included fonts.
Usage
use bitmap_font::{tamzen::FONT_8x15, BitmapFont, TextStyle};
use embedded_graphics::{pixelcolor::BinaryColor, prelude::*, text::Text};
// Draw text 'Hello World!' with the top left corner being the origin
let text = Text::new(
"Hello World!",
Point::zero(),
TextStyle::new(&FONT_8x15, BinaryColor::On)
);
text.draw(&mut display)?;
Modules
- Tamzen font-based bitmap fonts. The included glyphs are a subset of ISO 8859-1 plus the unicode powerline symbols. Additional symbols might be added in the future. If you are missing a glyph that is included in the Tamzen font, please open an issue.
Structs
- Stores the font bitmap and some additional info for each font.
- The equivalent of
MonoTextStyle
forBitmapFont
.