Crate bitmap_font[−][src]
This crate provides bitmap fonts for the embedded-graphics
crate without requiring generics. All
fonts provided are concrete, constant instances of BitmapFont
. This means you can use these
bitmap fonts without any generics, unlike those fonts shipped with embedded-graphics
where each
font is implemented via its own struct. Also, this allows pixel-double fonts to share their bitmap
data with the non-doubled font, reducing the flash size required.
Usage Example
use bitmap_font::{BitmapFont, WithFont, FONT_7x13}; use embedded_graphics::{fonts::Text, prelude::*}; let font: BitmapFont = FONT_7x13; let text = Text::new("Hello World!", Point::zero()); text.with_font(font, BinaryColor::On).draw(&mut display)?;
Structs
BitmapFont | Stores the font bitmap and some additional info for each font. |
Constants
FONT_5x9 | Tamzen 5x9 Font. |
FONT_6x12 | Tamzen 6x12 Font. |
FONT_7x13 | Tamzen 7x13 Font. |
FONT_7x14 | Tamzen 7x14 Font. |
FONT_8x15 | Tamzen 8x15 Font. |
FONT_8x16 | Tamzen 8x16 Font. |
FONT_10x18 | Pixel-double version of FONT_5x9. |
FONT_10x20 | Tamzen 10x20 Font. |
FONT_12x24 | Pixel-double version of FONT_6x12. |
FONT_14x26 | Pixel-double version of FONT_7x13. |
FONT_14x28 | Pixel-double version of FONT_7x14. |
FONT_16x30 | Pixel-double version of FONT_8x15. |
FONT_16x32 | Pixel-double version of FONT_8x16. |
FONT_20x40 | Pixel-double version of FONT_10x20. |
Traits
WithFont | Style a Text with a font and color. |