diff --git a/src/hasp/hasp_font.cpp b/src/hasp/hasp_font.cpp index 16c333f7..88d37f30 100644 --- a/src/hasp/hasp_font.cpp +++ b/src/hasp/hasp_font.cpp @@ -1,7 +1,9 @@ #include #include "hasplib.h" +#if HASP_USE_FREETYPE > 0 #include "lv_freetype.h" +#endif #include "hasp_mem.h" #include "font/hasp_font_loader.h" @@ -51,28 +53,28 @@ static lv_font_t* font_add_to_list(const char* payload) lv_font_t* font = hasp_font_load(filename); char* name_p = NULL; -#if defined(ARDUINO_ARCH_ESP32) - if(!font) { - // Try .ttf file +#if defined(ARDUINO_ARCH_ESP32) && (HASP_USE_FREETYPE > 0) + // if(!font) { + // // Try .ttf file - size_t pos = font_split_payload(payload); - if(pos > 0 && pos < 56) { - uint16_t size = atoi(payload + pos); + // size_t pos = font_split_payload(payload); + // if(pos > 0 && pos < 56) { + // uint16_t size = atoi(payload + pos); - char fontname[64]; - memset(fontname, 0, sizeof(fontname)); - strncpy(fontname, payload, pos); - snprintf_P(filename, sizeof(filename), PSTR("L:\\%s.ttf"), fontname); + // char fontname[64]; + // memset(fontname, 0, sizeof(fontname)); + // strncpy(fontname, payload, pos); + // snprintf_P(filename, sizeof(filename), PSTR("L:\\%s.ttf"), fontname); - lv_ft_info_t info; - info.name = filename; - info.weight = size; - info.style = FT_FONT_STYLE_NORMAL; - if(lv_ft_font_init(&info)) { - font = info.font; - } - } - } + // lv_ft_info_t info; + // info.name = filename; + // info.weight = size; + // info.style = FT_FONT_STYLE_NORMAL; + // if(lv_ft_font_init(&info)) { + // font = info.font; + // } + // } + // } if(!font) { // Try .otf file