|
TinyGPU
|
Helper for printing wrapped lines of text onto a TinyGPU target. More...
#include <LinePrinter.h>
Public Member Functions | |
| LinePrinter ()=default | |
| LinePrinter (IFont< RGB_T > &font, ISurface< RGB_T > &target) | |
| Creates a line printer for the given font and target. | |
| void | setColor (RGB_T color) |
| void | setBackgroundColor (RGB_T color) |
| void | setFont (IFont< RGB_T > &font) |
| Sets the Font implementation. | |
| void | setTarget (ISurface< RGB_T > &target) |
| Sets the TinyGPU target. | |
| void | setTopBorder (size_t border) |
| Sets the top border in pixels. | |
| void | setLeftBorder (size_t border) |
| Sets the left border in pixels. | |
| void | setRightBorder (size_t border) |
| Sets the right border in pixels. | |
| void | setButtomBorder (size_t border) |
| Sets the bottom border in pixels. | |
| void | setBorders (size_t border) |
| Sets all borders to the same value. | |
| void | setActualLine (size_t line) |
| Sets the current line index. | |
| size_t | cursorX () const |
| size_t | cursorY () const |
| Y pixel coordinate the next character would be printed at. | |
| void | setScale (uint8_t scale) |
| Sets the text scale factor. | |
| void | setSpacing (uint8_t spacing) |
| Sets the spacing between glyphs. | |
| void | setProportional (bool proportional) |
| bool | isProportional () const |
| Returns whether proportional spacing is enabled on the current font. | |
| size_t | print (const char *text) |
| Prints text with word wrapping. | |
| size_t | println (const char *text) |
| Prints text and advances to the next line. | |
| size_t | println () |
| Advances to the next line. | |
Helper for printing wrapped lines of text onto a TinyGPU target.
The printer tracks a cursor position, applies configurable borders, and wraps words to the next line when text would exceed the drawable width.
|
default |
|
inline |
Creates a line printer for the given font and target.
|
inline |
X pixel coordinate the next character would be printed at - i.e. right after wherever the last print()/println() call left off. Lets a caller (e.g. a text-editor-style widget) draw a cursor at the end of the printed text without this class needing to know anything about cursors.
|
inline |
Y pixel coordinate the next character would be printed at.
|
inline |
Returns whether proportional spacing is enabled on the current font.
|
inline |
Prints text with word wrapping.
|
inline |
Advances to the next line.
|
inline |
Prints text and advances to the next line.
|
inline |
Sets the current line index.
|
inline |
|
inline |
Sets all borders to the same value.
|
inline |
Sets the bottom border in pixels.
|
inline |
|
inline |
Sets the Font implementation.
|
inline |
Sets the left border in pixels.
|
inline |
Enables/disables proportional (effective-width) glyph spacing on the current font. Word-wrapping and cursor advance automatically account for the narrower spacing since they're driven by the font's own measureTextWidth()/drawText().
|
inline |
Sets the right border in pixels.
|
inline |
Sets the text scale factor.
|
inline |
Sets the spacing between glyphs.
|
inline |
Sets the TinyGPU target.
|
inline |
Sets the top border in pixels.