Add ascii, latin1, latin2 fonts with mdi icons

This commit is contained in:
fvanroie 2021-04-10 23:50:53 +02:00
parent 85a7ef6a00
commit e4cd1411d0
48 changed files with 114349 additions and 8274 deletions

View File

@ -9,6 +9,32 @@
#define LV_CONF_H
/* clang-format off */
#ifndef HASP_FONT_1
#define HASP_FONT_1 robotocondensed_regular_12_latin1
#endif
#ifndef HASP_FONT_2
#define HASP_FONT_2 robotocondensed_regular_16_latin1
#endif
#ifndef HASP_FONT_3
#define HASP_FONT_3 robotocondensed_regular_22_latin1
#endif
#ifndef HASP_FONT_4
#define HASP_FONT_4 robotocondensed_regular_28_latin1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_22_LATIN1
#define ROBOTOCONDENSED_REGULAR_22_LATIN1 1
#endif
#ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
#define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
#endif
#include <stdint.h>
#include "lv_symbol_mdi_def.h"
@ -413,22 +439,47 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/
typedef void* lv_font_user_data_t;
// #define FONT_CONCAT2(a, b) a ## b
// #define FONT_CONCAT(a, b) FONT_CONCAT2(a, b)
// #define HASP_FONTNAME robotocondensed_regular_
// #define HASP_FONTNAME_BASE FONT_CONCAT(HASP_FONTNAME, _)
// #define HASP_CHARACTER_SET latin1
// /* Concatenate the fontname macros */
// #define HASP_FONT_1_size FONT_CONCAT(HASP_FONTNAME, 12)
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
// #define HASP_FONT_1 FONT_CONCAT(HASP_FONT_1_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_2_size FONT_CONCAT(HASP_FONTNAME, 16)
// #define HASP_FONT_2_base FONT_CONCAT(HASP_FONT_2_size, _)
// #define HASP_FONT_2 FONT_CONCAT(HASP_FONT_2_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_3_size FONT_CONCAT(HASP_FONTNAME, 22)
// #define HASP_FONT_3_base FONT_CONCAT(HASP_FONT_3_size, _)
// #define HASP_FONT_3 FONT_CONCAT(HASP_FONT_3_base, HASP_CHARACTER_SET)
// /* Concatenate the fontname macros */
// #define HASP_FONT_4_size FONT_CONCAT(HASP_FONTNAME, 28)
// #define HASP_FONT_4_base FONT_CONCAT(HASP_FONT_4_size, _)
// #define HASP_FONT_4 FONT_CONCAT(HASP_FONT_4_base, HASP_CHARACTER_SET)
/*Always set a default font from the built-in fonts*/
#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)
#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_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_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
LV_FONT_DECLARE(HASP_FONT_2) \
LV_FONT_DECLARE(HASP_FONT_3) \
LV_FONT_DECLARE(HASP_FONT_4) \
#define LV_FONT_DEFAULT &robotocondensed_regular_16 //&lv_font_montserrat_16
#define LV_FONT_DEFAULT &HASP_FONT_1 //&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,12 +496,12 @@ typedef void* lv_font_user_data_t;
#define LV_THEME_DEFAULT_INIT lv_theme_material_init // lv_theme_hasp_init // We init the theme ourselves
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
#define LV_THEME_DEFAULT_FLAG 0 //LV_THEME_MATERIAL_FLAG_NONE
#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 //&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
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
#define LV_THEME_DEFAULT_FONT_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_3 //&lv_font_montserrat_22
#define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_4 //&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

@ -6,7 +6,6 @@
extern "C" {
#endif
#include "lv_conf_internal.h"
/*----------------------------------------
* Symbols from Material Design Icons font

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

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

@ -462,27 +462,27 @@ static lv_font_t* haspPayloadToFont(const char* payload)
#ifndef ARDUINO_ARCH_ESP8266
#ifdef LV_FONT_CUSTOM_12
#ifdef HASP_FONT_1
case 12:
return &robotocondensed_regular_12;
return &HASP_FONT_1;
#endif
#ifdef LV_FONT_CUSTOM_16
case 16:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_16);
return &robotocondensed_regular_16;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_2);
return &HASP_FONT_2;
#endif
#ifdef LV_FONT_CUSTOM_22
case 22:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_22);
return &robotocondensed_regular_22;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_3);
return &HASP_FONT_3;
#endif
#ifdef LV_FONT_CUSTOM_28
case 28:
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, robotocondensed_regular_28);
return &robotocondensed_regular_28;
LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, HASP_FONT_4);
return &HASP_FONT_4;
#endif
#endif