57 bool _isInitialized =
false;
61 void _begin12Bit(uint16_t color12Bit);
65 GrFont(
void) =
delete;
81 void begin(uint16_t color16Bit);
90 void begin(uint8_t red, uint8_t green, uint8_t blue);
108 inline int8_t
kerning(uint8_t first, uint8_t second)
const
110 uint16_t ID = (
static_cast<uint16_t
>(first) << 8) | second;
123 uint8_t
placeText(
Canvas &canvas,
char cc, uint16_t x, uint16_t y)
const;
135 uint8_t
placeText(
Canvas &canvas,
const char *
const text, uint16_t buffSize, uint16_t x, uint16_t y)
const;
152 uint16_t
textWidth(
const char *
const text, uint16_t buffSize)
const;
161 virtual int8_t
kerning(uint16_t ID)
const = 0;
Defines higher level TFT graphics functionality.
uint16_t rgb16to12(uint16_t color16Bit)
Function for converting 16-bit colors into the 12-bit color used by the TFT.
Definition GrFont.cpp:16
ROM_Image base
Definition ROM_Images.h:46
Provides higher level TFT graphic functionality used by the menu system.
Definition Canvas.h:34
uint16_t textWidth(const char cc) const
Determines the width of character, cc, in screen pixels.
Definition GrFont.cpp:143
int8_t kerning(uint8_t first, uint8_t second) const
Returns the amount of kerning that should be used between two characters.
Definition GrFont.h:108
GrFont(ROM_Image imgLoc, uint16_t lineHeight, uint16_t base)
Constructs a new GrFont object.
Definition GrFont.h:73
virtual int8_t kerning(uint16_t ID) const =0
Finds 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.
Definition GrFont.cpp:80
virtual bool charDef(char cc, CharDef_t &results) const =0
Abstract function. Used by derived classes to define the characteristics of each character.
const uint16_t LINE_HEIGHT
Recommended vertical spacing between lines of text.
Definition GrFont.h:50
const ROM_Image imgLoc
Location of the font in Flash ROM.
Definition GrFont.h:48
const uint16_t BASE
Distance between the top of the pixel and its base.
Definition GrFont.h:51
void begin(uint16_t color16Bit)
Initializes the font and sets the font's foreground color.
Definition GrFont.cpp:32
A variation of the Canvas class that can load imagery from Flash ROM.
Definition Canvas.h:405
Data Structure that defines an individual character.
Definition GrFont.h:19
int16_t yoffset
Cursor y-offset that should be used when copying character to the screen.
Definition GrFont.h:25
uint16_t y
UL y-position of the character within the DRAM image.
Definition GrFont.h:21
uint16_t height
Height of the character in the DRAM image.
Definition GrFont.h:23
uint16_t width
Width of the character in the DRAM image.
Definition GrFont.h:22
int16_t xoffset
Cursor x-offset that should be used when copying character to the screen.
Definition GrFont.h:24
uint16_t xadvance
How far to advance the curso x-pos after this character.
Definition GrFont.h:26
uint16_t x
UL x-position of the character within the DRAM image.
Definition GrFont.h:20
Structure to define the size and location of an image in Flash.
Definition ROM_Images.h:14