|
TinyGPU
|
Font rendering interface for TinyGPU-compatible framebuffers. More...
#include <IFont.h>

Public Member Functions | |
| 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. | |
Font rendering interface for TinyGPU-compatible framebuffers.
Implementations render text onto an ISurface target using their own glyph storage, layout, and scaling behavior.
|
virtualdefault |
Destroys the font interface.
|
pure virtual |
Draws a text string onto a framebuffer target.
Implemented in BitmapFont< Width, Height, RowT, RGB_T >.
|
pure virtual |
Returns the scaled glyph height in pixels.
Implemented in BitmapFont< Width, Height, RowT, RGB_T >, BitmapFont< 5, 7, uint8_t, RGB565 >, BitmapFont< 12, 12, uint16_t, RGB565 >, BitmapFont< 16, 24, uint16_t, RGB565 >, BitmapFont< 8, 12, uint8_t, RGB565 >, BitmapFont< 8, 8, uint8_t, RGB565 >, and BitmapFont< 5, 7, uint8_t, tinygpu::RGB565 >.
|
inlinevirtual |
Returns whether proportional spacing is enabled.
Reimplemented in BitmapFont< Width, Height, RowT, RGB_T >, BitmapFont< 5, 7, uint8_t, RGB565 >, BitmapFont< 12, 12, uint16_t, RGB565 >, BitmapFont< 16, 24, uint16_t, RGB565 >, BitmapFont< 8, 12, uint8_t, RGB565 >, BitmapFont< 8, 8, uint8_t, RGB565 >, and BitmapFont< 5, 7, uint8_t, tinygpu::RGB565 >.
|
pure virtual |
Returns the total text height in pixels.
Implemented in BitmapFont< Width, Height, RowT, RGB_T >, BitmapFont< 5, 7, uint8_t, RGB565 >, BitmapFont< 12, 12, uint16_t, RGB565 >, BitmapFont< 16, 24, uint16_t, RGB565 >, BitmapFont< 8, 12, uint8_t, RGB565 >, BitmapFont< 8, 8, uint8_t, RGB565 >, and BitmapFont< 5, 7, uint8_t, tinygpu::RGB565 >.
|
pure virtual |
Returns the width of the longest text line in pixels.
Implemented in BitmapFont< Width, Height, RowT, RGB_T >, BitmapFont< 5, 7, uint8_t, RGB565 >, BitmapFont< 12, 12, uint16_t, RGB565 >, BitmapFont< 16, 24, uint16_t, RGB565 >, BitmapFont< 8, 12, uint8_t, RGB565 >, BitmapFont< 8, 8, uint8_t, RGB565 >, and BitmapFont< 5, 7, uint8_t, tinygpu::RGB565 >.
|
inlinevirtual |
Enables/disables proportional spacing based on each glyph's effective (used) width instead of a fixed glyph width. Implementations that only support fixed-width rendering may ignore this.
Reimplemented in BitmapFont< Width, Height, RowT, RGB_T >, BitmapFont< 5, 7, uint8_t, RGB565 >, BitmapFont< 12, 12, uint16_t, RGB565 >, BitmapFont< 16, 24, uint16_t, RGB565 >, BitmapFont< 8, 12, uint8_t, RGB565 >, BitmapFont< 8, 8, uint8_t, RGB565 >, and BitmapFont< 5, 7, uint8_t, tinygpu::RGB565 >.