Initial mdi font support

This commit is contained in:
fvanroie 2021-04-06 03:28:47 +02:00
parent e9b8e0e41d
commit 85a7ef6a00
22 changed files with 41803 additions and 9708 deletions

View File

@ -11,6 +11,8 @@
#include <stdint.h>
#include "lv_symbol_mdi_def.h"
#if defined(ARDUINO_ARCH_ESP8266)
#define LV_HIGH_RESOURCE_MCU 0
#endif
@ -416,17 +418,17 @@ typedef void* lv_font_user_data_t;
#if LV_HIGH_RESOURCE_MCU>0
// #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_16);
#define LV_FONT_CUSTOM_12 LV_FONT_DECLARE(robotocondensed_regular_12_nokern)
#define LV_FONT_CUSTOM_16 LV_FONT_DECLARE(robotocondensed_regular_16_nokern)
#define LV_FONT_CUSTOM_22 LV_FONT_DECLARE(robotocondensed_regular_22_nokern)
#define LV_FONT_CUSTOM_28 LV_FONT_DECLARE(robotocondensed_regular_28_nokern)
#define LV_FONT_CUSTOM_12 LV_FONT_DECLARE(robotocondensed_regular_12)
#define LV_FONT_CUSTOM_16 LV_FONT_DECLARE(robotocondensed_regular_16)
#define LV_FONT_CUSTOM_22 LV_FONT_DECLARE(robotocondensed_regular_22)
#define LV_FONT_CUSTOM_28 LV_FONT_DECLARE(robotocondensed_regular_28)
#define LV_FONT_CUSTOM_DECLARE LV_FONT_CUSTOM_12 \
LV_FONT_CUSTOM_16 \
LV_FONT_CUSTOM_22 \
LV_FONT_CUSTOM_28 \
#define LV_FONT_DEFAULT &robotocondensed_regular_16_nokern //&lv_font_montserrat_16
#define LV_FONT_DEFAULT &robotocondensed_regular_16 //&lv_font_montserrat_16
#else
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
#define LV_FONT_DEFAULT &unscii_8_icon //&lv_font_unscii_8
@ -445,10 +447,10 @@ typedef void* lv_font_user_data_t;
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
#define LV_THEME_DEFAULT_FLAG 0 //LV_THEME_MATERIAL_FLAG_NONE
#if LV_HIGH_RESOURCE_MCU
#define LV_THEME_DEFAULT_FONT_SMALL &robotocondensed_regular_12_nokern //&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &robotocondensed_regular_16_nokern //&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &robotocondensed_regular_22_nokern //&lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE &robotocondensed_regular_28_nokern //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
#define LV_THEME_DEFAULT_FONT_SMALL &robotocondensed_regular_12 //&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &robotocondensed_regular_16 //&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &robotocondensed_regular_22 //&lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE &robotocondensed_regular_28 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
#else
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16

View File

@ -0,0 +1,44 @@
#ifndef LV_SYMBOL_MDI_DEF_H
#define LV_SYMBOL_MDI_DEF_H
/* clang-format off */
#ifdef __cplusplus
extern "C" {
#endif
#include "lv_conf_internal.h"
/*----------------------------------------
* Symbols from Material Design Icons font
*--------------------------------------*/
/* In the font converter use this list as range:
0XF0140, 0XF0141, 0XF0142, 0XF0143, 0XF012C, 0XF0208, 0XF0209, 0XF05A9, 0XF0156, 0XF060C, 0XF030D
*/
#define LV_SYMBOL_DOWN "\xf3\xb0\x85\x80" /*983360, 0XF0140*/
#define LV_SYMBOL_LEFT "\xf3\xb0\x85\x81" /*983361, 0XF0141*/
#define LV_SYMBOL_RIGHT "\xf3\xb0\x85\x82" /*983362, 0XF0142*/
#define LV_SYMBOL_OK "\xf3\xb0\x84\xac" /*984545, 0XF012C*/
#define LV_SYMBOL_EYE_OPEN "\xf3\xb0\x88\x88" /*983560, 0XF0208*/
#define LV_SYMBOL_EYE_CLOSE "\xf3\xb0\x88\x89" /*983561, 0XF0209*/
#define LV_SYMBOL_WIFI "\xf3\xb0\x96\xa9" /*984489, 0XF05A9*/
#define LV_SYMBOL_CLOSE "\xf3\xb0\x85\x96" /*983382, 0XF0156*/
#define LV_SYMBOL_NEW_LINE "\xf3\xb0\x98\x8c" /*984588, 0XF060C*/
#define LV_SYMBOL_BACKSPACE "\xf3\xb0\x8c\x8d" /*983821, 0XF030D*/
/** Invalid symbol at (U+F8FF). If written before a string then `lv_img` will show it as a label*/
#define LV_SYMBOL_DUMMY "\xEF\xA3\xBF"
/*-------------------------------
* Symbols from "normal" font
*-----------------------------*/
#define LV_SYMBOL_BULLET "\xE2\x80\xA2" /*20042, 0x2022*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_SYMBOL_MDI_DEF_H*/

View File

@ -48,6 +48,7 @@ build_flags =
-D LV_CONF_INCLUDE_SIMPLE ; for lvgl
-D LV_LVGL_H_INCLUDE_SIMPLE ; for lv_drivers
-D LV_COMP_CONF_INCLUDE_SIMPLE ; for components
-D LV_SYMBOL_DEF_H ; don't load default symbol defines
; -- ESP build options ------------------------------------
-D SPIFFS_TEMPORAL_FD_CACHE ; speedup opening recent files
; -- ArduinoJson build options ----------------------------

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -327,7 +327,7 @@ void haspSetup(void)
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, nullptr);
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, haspFonts[0]);
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, &robotocondensed_regular_16_nokern);
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, &robotocondensed_regular_16);
#if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0
#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266)
@ -344,7 +344,7 @@ void haspSetup(void)
haspFonts[0] = hasp_font; // save it
}
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_16_nokern);
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_16);
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, *hasp_font);
#endif

View File

@ -454,7 +454,7 @@ static lv_font_t* haspPayloadToFont(const char* payload)
switch(var) {
case 0 ... 7:
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_12_nokern);
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_12);
return hasp_get_font(var);
case 8:
@ -464,25 +464,25 @@ static lv_font_t* haspPayloadToFont(const char* payload)
#ifdef LV_FONT_CUSTOM_12
case 12:
return &robotocondensed_regular_12_nokern;
return &robotocondensed_regular_12;
#endif
#ifdef LV_FONT_CUSTOM_16
case 16:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_16_nokern);
return &robotocondensed_regular_16_nokern;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_16);
return &robotocondensed_regular_16;
#endif
#ifdef LV_FONT_CUSTOM_22
case 22:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_22_nokern);
return &robotocondensed_regular_22_nokern;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_22);
return &robotocondensed_regular_22;
#endif
#ifdef LV_FONT_CUSTOM_28
case 28:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_28_nokern);
return &robotocondensed_regular_28_nokern;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_28);
return &robotocondensed_regular_28;
#endif
#endif