|
| | BitmapFont (const Glyph *table, size_t glyphCount, char firstChar=' ') |
| | Creates a fixed bitmap font over a contiguous glyph table.
|
| |
| void | setProportional (bool proportional) override |
| |
| bool | isProportional () const override |
| | Returns whether proportional spacing is enabled.
|
| |
| uint8_t | glyphLeftOffset (CodePoint codePoint) const |
| |
| uint8_t | glyphEffectiveWidth (CodePoint codePoint) const |
| |
| uint8_t | glyphAdvanceWidth (CodePoint codePoint) const |
| |
| const Glyph & | glyph (char character) const |
| | Returns the glyph for an 8-bit character.
|
| |
| virtual const Glyph & | glyph (CodePoint codePoint) const |
| |
| bool | pixel (CodePoint codePoint, uint8_t x, uint8_t y) const |
| | Returns whether a pixel is set in a code point glyph.
|
| |
| void | drawCodePoint (ISurface< RGB_T > &target, int16_t x, int16_t y, CodePoint codePoint, RGB_T foreground, RGB_T background=RGB_T(0), bool opaque=false, uint8_t scale=1) const |
| |
| void | drawChar (ISurface< RGB_T > &target, int16_t x, int16_t y, char character, RGB_T foreground, RGB_T background=RGB_T(0), bool opaque=false, uint8_t scale=1) const |
| | Draws a single character.
|
| |
| void | drawText (ISurface< RGB_T > &target, int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background=RGB_T(0), bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1) const override |
| | Draws a UTF-8 text string.
|
| |
| size_t | measureTextWidth (const char *text, uint8_t scale=1, uint8_t spacing=1) const override |
| | Returns the width of the longest text line in pixels.
|
| |
| size_t | measureTextHeight (const char *text, uint8_t scale=1, uint8_t lineSpacing=1) const override |
| | Returns the total text height in pixels.
|
| |
| size_t | getHeight (uint8_t scale) const override |
| | Returns the scaled glyph height in pixels.
|
| |
| virtual | ~IFont ()=default |
| | Destroys the font interface.
|
| |
| virtual void | drawText (ISurface< RGB_T > &target, int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background, bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1) const =0 |
| | Draws a text string onto a framebuffer target.
|
| |
| virtual size_t | measureTextWidth (const char *text, uint8_t scale=1, uint8_t spacing=1) const =0 |
| | Returns the width of the longest text line in pixels.
|
| |
| virtual size_t | measureTextHeight (const char *text, uint8_t scale=1, uint8_t lineSpacing=1) const =0 |
| | Returns the total text height in pixels.
|
| |
| virtual size_t | getHeight (uint8_t scale) const =0 |
| | Returns the scaled glyph height in pixels.
|
| |
| virtual void | setProportional (bool proportional) |
| |
| virtual bool | isProportional () const |
| | Returns whether proportional spacing is enabled.
|
| |
template<uint8_t Width, uint8_t Height, typename RowT, typename RGB_T = RGB565>
class tinygpu::BitmapFont< Width, Height, RowT, RGB_T >
Fixed-size bitmap font backed by a caller-supplied glyph table.
- Template Parameters
-
| Width | Glyph width in pixels. |
| Height | Glyph height in pixels. |
| RowT | Unsigned integer type used to store one glyph row. Only the Width most significant bits of each row are used (bit Width-1 is the left-most pixel), mirroring the bit order used by Font5x7. |
| RGB_T | The pixel color type. Can be RGB565, RGB666, RGB888, etc. |
Concrete fonts (e.g. converted from vendor font tables) subclass this and pass their own glyph table to the constructor. Only a contiguous ASCII range starting at firstChar is supported; any code point outside that range falls back to the glyph for '?'.