This repository was archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
changeLabelFont()
Mammad900 edited this page Nov 4, 2020
·
1 revision
Changes the font (style) of a label
- page (
int) : The number of the page which contains the label - index (
int) : Index of the label relative to it's containing page. - value (
const GFXfont*) : A pointer to an Adafruit GFX font object. Will replace the old font.
Nothing
void attention(int Page, int index){
changeLabelFont(Page,index,&FreeSansBold9pt7b);
delay(1000);
changeLabelFont(Page,index,&FreeSans9pt7b);
}When attention is called, the specified label becomes bold for 1 second.
void changeLabelFont(int page, int i, const GFXfont *val) {
if (label_font[page][i] != val) {
HCT
if (CurrentPage == page) {
undrawlabel(page, i);
label_font[page][i] = (GFXfont *)val;
drawlabel(page, i);
}
}
else
label_font[page][i] = (GFXfont *)val;
}Note: HCT is a macro for making the rest of the library aware that something has changed.