Base class used by all Graphical Fonts.
More...
#include <GrFont.h>
|
| | GrFont (ROM_Image imgLoc, uint16_t lineHeight, uint16_t base) |
| | Constructs a new GrFont object.
|
| |
| void | begin (uint16_t color16Bit) |
| | Initializes the font and sets the font's foreground color.
|
| |
| void | begin (uint8_t red, uint8_t green, uint8_t blue) |
| | Initializes the font and sets the font's foreground color.
|
| |
| virtual bool | charDef (char cc, CharDef_t &results) const =0 |
| | Abstract function. Used by derived classes to define the characteristics of each character.
|
| |
| int8_t | kerning (uint8_t first, uint8_t second) const |
| | Returns the amount of kerning that should be used between two characters.
|
| |
| uint8_t | placeText (Canvas &canvas, char cc, uint16_t x, uint16_t y) const |
| | Places a character onto the canvas.
|
| |
| uint8_t | placeText (Canvas &canvas, const char *const text, uint16_t buffSize, uint16_t x, uint16_t y) const |
| | Places a string onto the canvas.
|
| |
| uint16_t | textWidth (const char cc) const |
| | Determines the width of character, cc, in screen pixels.
|
| |
| uint16_t | textWidth (const char *const text, uint16_t buffSize) const |
| | Determines the width of string in screen pixels.
|
| |
|
| const ROM_Image | imgLoc |
| | Location of the font in Flash ROM.
|
| |
| const uint16_t | LINE_HEIGHT |
| | Recommended vertical spacing between lines of text.
|
| |
| const uint16_t | BASE |
| | Distance between the top of the pixel and its base.
|
| |
|
| virtual int8_t | kerning (uint16_t ID) const =0 |
| | Finds the amount of kerning that should be used between two characters.
|
| |
Base class used by all Graphical Fonts.
◆ GrFont()
| GrFont::GrFont |
( |
ROM_Image | imgLoc, |
|
|
uint16_t | lineHeight, |
|
|
uint16_t | base ) |
|
inline |
Constructs a new GrFont object.
- Parameters
-
| [in] | imgLoc | Location of the font imagery in ROM |
| [in] | lineHeight | Recommended vertical spacing between lines of text |
| [in] | base | Distance between the top of the pixel and its base |
◆ begin() [1/2]
| void GrFont::begin |
( |
uint16_t | color16Bit | ) |
|
Initializes the font and sets the font's foreground color.
- Parameters
-
| [in] | color16Bit | 16-bit color (5:6:5 encoding) |
◆ begin() [2/2]
| void GrFont::begin |
( |
uint8_t | red, |
|
|
uint8_t | green, |
|
|
uint8_t | blue ) |
Initializes the font and sets the font's foreground color.
- Parameters
-
| [in] | red | |
| [in] | green | |
| [in] | blue | |
◆ charDef()
| virtual bool GrFont::charDef |
( |
char | cc, |
|
|
CharDef_t & | results ) const |
|
pure virtual |
◆ kerning() [1/2]
| virtual int8_t GrFont::kerning |
( |
uint16_t | ID | ) |
const |
|
protectedpure virtual |
◆ kerning() [2/2]
| int8_t GrFont::kerning |
( |
uint8_t | first, |
|
|
uint8_t | second ) const |
|
inline |
Returns the amount of kerning that should be used between two characters.
- Parameters
-
| [in] | first | First character |
| [in] | second | Second character |
- Returns
- Amount of kerning in screen pixels
◆ placeText() [1/2]
| uint8_t GrFont::placeText |
( |
Canvas & | canvas, |
|
|
char | cc, |
|
|
uint16_t | x, |
|
|
uint16_t | y ) const |
Places a character onto the canvas.
- Parameters
-
| [in] | canvas | Canvas where the character is placed |
| [in] | cc | The character to be placed |
| [in] | x | x-position within canvas where the character is to be placed |
| [in] | y | y-position within canvas where the character is to be placed |
- Returns
- Returns the width of the character in screen pixels
The base of the characters will be aligned with the vertical position, y.
◆ placeText() [2/2]
| uint8_t GrFont::placeText |
( |
Canvas & | canvas, |
|
|
const char *const | text, |
|
|
uint16_t | buffSize, |
|
|
uint16_t | x, |
|
|
uint16_t | y ) const |
Places a string onto the canvas.
- Parameters
-
| [in] | canvas | Canvas where the character is placed |
| [in] | text | Character buffer containing the null-terminated string to be placed |
| [in] | buffSize | The size of the character buffer, text |
| [in] | x | x-position within canvas where the character is to be placed |
| [in] | y | y-position within canvas where the character is to be placed |
- Returns
- Returns the width of the character in screen pixels
This method applies character kerning to the displayed characters. The base of the characters will be aligned with the vertical position, y.
◆ textWidth() [1/2]
| uint16_t GrFont::textWidth |
( |
const char *const | text, |
|
|
uint16_t | buffSize ) const |
Determines the width of string in screen pixels.
- Parameters
-
| [in] | text | Character buffer containing the null-terminated string to be examined |
| [in] | buffSize | The size of the character buffer, text |
- Returns
- Width of the string in screen pixels
This method applies accounts for character kerning when calculating the total width of the string.
◆ textWidth() [2/2]
| uint16_t GrFont::textWidth |
( |
const char | cc | ) |
const |
Determines the width of character, cc, in screen pixels.
- Parameters
-
- Returns
- Width of the character in screen pixels
◆ BASE
| const uint16_t GrFont::BASE |
Distance between the top of the pixel and its base.
◆ imgLoc
Location of the font in Flash ROM.
◆ LINE_HEIGHT
| const uint16_t GrFont::LINE_HEIGHT |
Recommended vertical spacing between lines of text.
The documentation for this class was generated from the following files:
- C:/Users/david/Documents/PlatformIO/Solo_Controller/Solo_Controller_Repo/src/Display/fonts/GrFont.h
- C:/Users/david/Documents/PlatformIO/Solo_Controller/Solo_Controller_Repo/src/Display/fonts/GrFont.cpp