|
| constexpr | Font (char first_char, char last_char, uint8_t width, uint8_t height, const uint8_t *glyphs) |
| | Construct a new Font.
|
| |
| uint8_t | width () const |
| | Width of font glyphs in pixels.
|
| |
| uint8_t | height () const |
| | Height of font glyphs in pixels.
|
| |
| uint8_t | first_char () const |
| | Code of first char supported by this Font.
|
| |
| uint8_t | last_char () const |
| | Code of last char supported by this Font.
|
| |
| uint8_t | glyph_rows () const |
| | Determine the number of rows this font uses for each of its glyphs.
|
| |
| uint8_t | glyph_cols () const |
| | Determine the number of columns this font uses for each of its glyphs.
|
| |
| uint8_t | glyph_size () const |
| | Glyph size in bytes.
|
| |
| uint16_t | get_char_glyph_ref (char value) const |
| | Get a glyph reference for the requested character value.
|
| |
| uint8_t | get_char_glyph_byte (uint16_t glyph_ref, uint8_t index) const |
| | Get one byte of character glyph.
|
| |
template<bool VERTICAL_>
class devices::display::Font< VERTICAL_ >
Generic font support class.
Font glyphs are either stored horizontally (1 byte represents a row) or vertically (1 byte represents a columns). Direction selection is based on display devices internal raster organisation and is thus used for optimization purposes.
- Template Parameters
-
| VERTICAL_ | true if font is vertical, false if horizontal |
Definition at line 38 of file font.h.
Determine the number of rows this font uses for each of its glyphs.
Result depends on:
- vertical or horizontal font
- font height
For a vertical font, one row is already composed of 8 pixels, hence the result will be 1 for fonts which height is 8 or less. For a horizontal font, the result will be exactly the font height.
- Returns
- uint8_t the number of rows used by glyph of this Font
Definition at line 99 of file font.h.
Determine the number of columns this font uses for each of its glyphs.
Result depends on:
- vertical or horizontal font
- font width
For a vertical font, one column is one pixel, hence the result will be exactly the font width. For a horizontal font, one column is 8 pixels (one byte), hence the result will be 1 for fonts which width is 8 or less.
- Returns
- uint8_t the number of columns used by glyph of this Font
Definition at line 117 of file font.h.