mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-23 11:16:45 +00:00
Embed default TTF in ESP32S3 binaries only
This commit is contained in:
parent
2870c09207
commit
5b8a761d35
@ -23,7 +23,7 @@ typedef struct
|
|||||||
#include "hasp_mem.h"
|
#include "hasp_mem.h"
|
||||||
#include "font/hasp_font_loader.h"
|
#include "font/hasp_font_loader.h"
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && (HASP_USE_FREETYPE > 0)
|
#if defined(ARDUINO_ARCH_ESP32) && (HASP_USE_FREETYPE > 0) && defined(ESP32S3)
|
||||||
extern const uint8_t OPENHASP_TTF_START[] asm("_binary_data_openhasp_ttf_start");
|
extern const uint8_t OPENHASP_TTF_START[] asm("_binary_data_openhasp_ttf_start");
|
||||||
extern const uint8_t OPENHASP_TTF_END[] asm("_binary_data_openhasp_ttf_end");
|
extern const uint8_t OPENHASP_TTF_END[] asm("_binary_data_openhasp_ttf_end");
|
||||||
// extern const uint8_t OPENHASPLITE_TTF_START[] asm("_binary_data_openhasplite_ttf_start");
|
// extern const uint8_t OPENHASPLITE_TTF_START[] asm("_binary_data_openhasplite_ttf_start");
|
||||||
@ -203,8 +203,9 @@ static lv_font_t* font_add_to_list(const char* payload)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ESP32S3)
|
||||||
if(!font) {
|
if(!font) {
|
||||||
strcpy(filename, "openhasp");
|
strcpy(filename, "default");
|
||||||
uint16_t size = atoi(payload);
|
uint16_t size = atoi(payload);
|
||||||
if(size > 8) {
|
if(size > 8) {
|
||||||
lv_ft_info_t info;
|
lv_ft_info_t info;
|
||||||
@ -216,11 +217,13 @@ static lv_font_t* font_add_to_list(const char* payload)
|
|||||||
LOG_VERBOSE(TAG_FONT, F("Loading font %s size %d"), filename, size);
|
LOG_VERBOSE(TAG_FONT, F("Loading font %s size %d"), filename, size);
|
||||||
if(lv_ft_font_init(&info)) {
|
if(lv_ft_font_init(&info)) {
|
||||||
font = info.font;
|
font = info.font;
|
||||||
font_type = 1;
|
font_type = 2; // Flash embedded TTF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // ESP32S3
|
||||||
|
|
||||||
|
#endif // ESP32 && HASP_USE_FREETYPE
|
||||||
|
|
||||||
if(!font) return NULL;
|
if(!font) return NULL;
|
||||||
LOG_VERBOSE(TAG_FONT, F("Loaded font %s line_height %d"), filename, font->line_height);
|
LOG_VERBOSE(TAG_FONT, F("Loaded font %s line_height %d"), filename, font->line_height);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user