Crate bitmap_font[−][src]
Expand description
bitmap-font 0.1 works with embedded-graphics 0.6! Version 0.7 includes a lot of changes to
the font/text rendering system, including the introduction of the MonoFont
type that is similar
to the BitmapFont
type from this crate. However, it seems to be impossible to use pixel-double
versions of the fonts included in eg 0.7, so it does not offer all functionality of this crate.
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_5x9_BOLD | Tamzen 5x9 Bold Font. |
FONT_6x12 | Tamzen 6x12 Font. |
FONT_6x12_BOLD | Tamzen 6x12 Bold Font. |
FONT_7x13 | Tamzen 7x13 Font. |
FONT_7x13_BOLD | Tamzen 7x13 Bold Font. |
FONT_7x14 | Tamzen 7x14 Font. |
FONT_7x14_BOLD | Tamzen 7x14 Bold Font. |
FONT_8x15 | Tamzen 8x15 Font. |
FONT_8x15_BOLD | Tamzen 8x15 Bold Font. |
FONT_8x16 | Tamzen 8x16 Font. |
FONT_8x16_BOLD | Tamzen 8x16 Bold Font. |
FONT_10x18 | Pixel-double version of |
FONT_10x18_BOLD | Pixel-double version of |
FONT_10x20 | Tamzen 10x20 Font. |
FONT_10x20_BOLD | Tamzen 10x20 Bold Font. |
FONT_12x24 | Pixel-double version of |
FONT_12x24_BOLD | Pixel-double version of |
FONT_14x26 | Pixel-double version of |
FONT_14x26_BOLD | Pixel-double version of |
FONT_14x28 | Pixel-double version of |
FONT_14x28_BOLD | Pixel-double version of |
FONT_16x30 | Pixel-double version of |
FONT_16x30_BOLD | Pixel-double version of |
FONT_16x32 | Pixel-double version of |
FONT_16x32_BOLD | Pixel-double version of |
FONT_20x40 | Pixel-double version of |
FONT_20x40_BOLD | Pixel-double version of |
Traits
WithFont | Style a Text with a font and color. |