mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 05:06:44 +00:00
Add HASP_FONT_5 and HASP_FONT_SIZE_5
This commit is contained in:
parent
baea44089f
commit
c326be6380
@ -119,16 +119,19 @@
|
|||||||
// #define HASP_FONT_2 robotocondensed_regular_22_latin1
|
// #define HASP_FONT_2 robotocondensed_regular_22_latin1
|
||||||
// #define HASP_FONT_3 robotocondensed_regular_40_latin1
|
// #define HASP_FONT_3 robotocondensed_regular_40_latin1
|
||||||
// #define HASP_FONT_4 robotocondensed_regular_48_latin1
|
// #define HASP_FONT_4 robotocondensed_regular_48_latin1
|
||||||
|
// #define HASP_FONT_5 robotocondensed_regular_12_latin1
|
||||||
|
|
||||||
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1 // Enable the selected fonts
|
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1 // Enable the selected fonts
|
||||||
// #define ROBOTOCONDENSED_REGULAR_22_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_22_LATIN1 1
|
||||||
// #define ROBOTOCONDENSED_REGULAR_40_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_40_LATIN1 1
|
||||||
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
||||||
|
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
|
||||||
|
|
||||||
// #define HASP_FONT_SIZE_1 16 // Define used font sizes
|
// #define HASP_FONT_SIZE_1 16 // Define used font sizes
|
||||||
// #define HASP_FONT_SIZE_2 22
|
// #define HASP_FONT_SIZE_2 22
|
||||||
// #define HASP_FONT_SIZE_3 40
|
// #define HASP_FONT_SIZE_3 40
|
||||||
// #define HASP_FONT_SIZE_4 48
|
// #define HASP_FONT_SIZE_4 48
|
||||||
|
// #define HASP_FONT_SIZE_5 12
|
||||||
|
|
||||||
#define LV_FONT_DEFAULT &HASP_FONT_1
|
#define LV_FONT_DEFAULT &HASP_FONT_1
|
||||||
|
|
||||||
|
@ -232,49 +232,40 @@ static lv_font_t* haspPayloadToFont(const char* payload)
|
|||||||
if(Parser::is_only_digits(payload)) {
|
if(Parser::is_only_digits(payload)) {
|
||||||
uint8_t var = atoi(payload);
|
uint8_t var = atoi(payload);
|
||||||
|
|
||||||
switch(var) {
|
if(var >= 0 && var < 8)
|
||||||
case 0 ... 7:
|
|
||||||
return hasp_get_font(var);
|
return hasp_get_font(var);
|
||||||
|
else if(var == 8)
|
||||||
case 8:
|
|
||||||
return &unscii_8_icon;
|
return &unscii_8_icon;
|
||||||
|
|
||||||
#ifndef ARDUINO_ARCH_ESP8266
|
#ifndef ARDUINO_ARCH_ESP8266
|
||||||
|
|
||||||
#ifdef HASP_FONT_1
|
#ifdef HASP_FONT_1
|
||||||
case HASP_FONT_SIZE_1:
|
else if(var == HASP_FONT_SIZE_1)
|
||||||
return &HASP_FONT_1;
|
return &HASP_FONT_1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HASP_FONT_2
|
#ifdef HASP_FONT_2
|
||||||
case HASP_FONT_SIZE_2:
|
else if(var == HASP_FONT_SIZE_2)
|
||||||
LOG_DEBUG(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_2);
|
|
||||||
return &HASP_FONT_2;
|
return &HASP_FONT_2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HASP_FONT_3
|
#ifdef HASP_FONT_3
|
||||||
case HASP_FONT_SIZE_3:
|
else if(var == HASP_FONT_SIZE_3)
|
||||||
LOG_DEBUG(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_3);
|
|
||||||
return &HASP_FONT_3;
|
return &HASP_FONT_3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HASP_FONT_4
|
#ifdef HASP_FONT_4
|
||||||
case HASP_FONT_SIZE_4:
|
else if(var == HASP_FONT_SIZE_4)
|
||||||
LOG_DEBUG(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_4);
|
|
||||||
return &HASP_FONT_4;
|
return &HASP_FONT_4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HASP_FONT_5
|
#ifdef HASP_FONT_5
|
||||||
case HASP_FONT_SIZE_5:
|
else if(var == HASP_FONT_SIZE_5)
|
||||||
LOG_DEBUG(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_5);
|
|
||||||
return &HASP_FONT_5;
|
return &HASP_FONT_5;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif // ARDUINO_ARCH_ESP8266
|
||||||
|
|
||||||
default:
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return get_font(payload);
|
return get_font(payload);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user