mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Include bitmap fonts in 12, 16, 24 & 32pt sizes
This commit is contained in:
parent
e22d1e14a8
commit
445446111b
@ -376,226 +376,265 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
|
|||||||
/*==================
|
/*==================
|
||||||
* FONT USAGE
|
* FONT USAGE
|
||||||
*===================*/
|
*===================*/
|
||||||
#if 1 || HASP_USE_FREETYPE<=0
|
// #if 1 || HASP_USE_FREETYPE<=0
|
||||||
#if TFT_HEIGHT>=480 && TFT_WIDTH>=480
|
// #if TFT_HEIGHT>=480 && TFT_WIDTH>=480
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_64_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_64_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_64_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_64_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_1
|
// #ifndef HASP_FONT_1
|
||||||
#define HASP_FONT_1 robotocondensed_regular_24_latin1 /* 5% Width */
|
// #define HASP_FONT_1 robotocondensed_regular_24_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_2
|
// #ifndef HASP_FONT_2
|
||||||
#define HASP_FONT_2 robotocondensed_regular_32_latin1 /* 5% Width */
|
// #define HASP_FONT_2 robotocondensed_regular_32_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_3
|
// #ifndef HASP_FONT_3
|
||||||
#define HASP_FONT_3 robotocondensed_regular_48_latin1 /* 10% Width */
|
// #define HASP_FONT_3 robotocondensed_regular_48_latin1 /* 10% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_4
|
// #ifndef HASP_FONT_4
|
||||||
#define HASP_FONT_4 robotocondensed_regular_64_latin1 /* 10% Height */
|
// #define HASP_FONT_4 robotocondensed_regular_64_latin1 /* 10% Height */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_5
|
// #ifndef HASP_FONT_5
|
||||||
#define HASP_FONT_5 robotocondensed_regular_16_latin1 /* 5% Width */
|
// #define HASP_FONT_5 robotocondensed_regular_16_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_SIZE_1
|
// #ifndef HASP_FONT_SIZE_1
|
||||||
#define HASP_FONT_SIZE_1 24
|
// #define HASP_FONT_SIZE_1 24
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_2
|
// #ifndef HASP_FONT_SIZE_2
|
||||||
#define HASP_FONT_SIZE_2 32
|
// #define HASP_FONT_SIZE_2 32
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_SIZE_3
|
// #ifndef HASP_FONT_SIZE_3
|
||||||
#define HASP_FONT_SIZE_3 48
|
// #define HASP_FONT_SIZE_3 48
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_4
|
// #ifndef HASP_FONT_SIZE_4
|
||||||
#define HASP_FONT_SIZE_4 64
|
// #define HASP_FONT_SIZE_4 64
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_5
|
// #ifndef HASP_FONT_SIZE_5
|
||||||
#define HASP_FONT_SIZE_5 16
|
// #define HASP_FONT_SIZE_5 16
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#elif TFT_HEIGHT>=320 && TFT_WIDTH>=320
|
// #elif TFT_HEIGHT>=320 && TFT_WIDTH>=320
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_1
|
// #ifndef HASP_FONT_1
|
||||||
#define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
|
// #define HASP_FONT_1 robotocondensed_regular_16_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_2
|
// #ifndef HASP_FONT_2
|
||||||
#define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
|
// #define HASP_FONT_2 robotocondensed_regular_24_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_3
|
// #ifndef HASP_FONT_3
|
||||||
#define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
|
// #define HASP_FONT_3 robotocondensed_regular_32_latin1 /* 10% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_4
|
// #ifndef HASP_FONT_4
|
||||||
#define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
|
// #define HASP_FONT_4 robotocondensed_regular_48_latin1 /* 10% Height */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_5
|
// #ifndef HASP_FONT_5
|
||||||
#define HASP_FONT_5 robotocondensed_regular_12_latin1 /* 5% Width */
|
// #define HASP_FONT_5 robotocondensed_regular_12_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_SIZE_1
|
// #ifndef HASP_FONT_SIZE_1
|
||||||
#define HASP_FONT_SIZE_1 16
|
// #define HASP_FONT_SIZE_1 16
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_2
|
// #ifndef HASP_FONT_SIZE_2
|
||||||
#define HASP_FONT_SIZE_2 24
|
// #define HASP_FONT_SIZE_2 24
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_SIZE_3
|
// #ifndef HASP_FONT_SIZE_3
|
||||||
#define HASP_FONT_SIZE_3 32
|
// #define HASP_FONT_SIZE_3 32
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_4
|
// #ifndef HASP_FONT_SIZE_4
|
||||||
#define HASP_FONT_SIZE_4 48
|
// #define HASP_FONT_SIZE_4 48
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_5
|
// #ifndef HASP_FONT_SIZE_5
|
||||||
#define HASP_FONT_SIZE_5 12
|
// #define HASP_FONT_SIZE_5 12
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#elif TFT_HEIGHT>=272 && TFT_WIDTH>=272
|
// #elif TFT_HEIGHT>=272 && TFT_WIDTH>=272
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_14_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_14_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_14_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_14_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_18_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_18_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_18_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_18_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_28_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_28_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_36_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_36_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_36_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_36_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_1
|
// #ifndef HASP_FONT_1
|
||||||
#define HASP_FONT_1 robotocondensed_regular_14_latin1 /* 5% Width */
|
// #define HASP_FONT_1 robotocondensed_regular_14_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_2
|
// #ifndef HASP_FONT_2
|
||||||
#define HASP_FONT_2 robotocondensed_regular_18_latin1 /* 5% Width */
|
// #define HASP_FONT_2 robotocondensed_regular_18_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_3
|
// #ifndef HASP_FONT_3
|
||||||
#define HASP_FONT_3 robotocondensed_regular_28_latin1 /* 10% Width */
|
// #define HASP_FONT_3 robotocondensed_regular_28_latin1 /* 10% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_4
|
// #ifndef HASP_FONT_4
|
||||||
#define HASP_FONT_4 robotocondensed_regular_36_latin1 /* 10% Height */
|
// #define HASP_FONT_4 robotocondensed_regular_36_latin1 /* 10% Height */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_5
|
// #ifndef HASP_FONT_5
|
||||||
#define HASP_FONT_5 robotocondensed_regular_48_latin1 /* 5% Width */
|
// #define HASP_FONT_5 robotocondensed_regular_48_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_SIZE_1
|
// #ifndef HASP_FONT_SIZE_1
|
||||||
#define HASP_FONT_SIZE_1 14
|
// #define HASP_FONT_SIZE_1 14
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_2
|
// #ifndef HASP_FONT_SIZE_2
|
||||||
#define HASP_FONT_SIZE_2 18
|
// #define HASP_FONT_SIZE_2 18
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_SIZE_3
|
// #ifndef HASP_FONT_SIZE_3
|
||||||
#define HASP_FONT_SIZE_3 28
|
// #define HASP_FONT_SIZE_3 28
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_4
|
// #ifndef HASP_FONT_SIZE_4
|
||||||
#define HASP_FONT_SIZE_4 36
|
// #define HASP_FONT_SIZE_4 36
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_5
|
// #ifndef HASP_FONT_SIZE_5
|
||||||
#define HASP_FONT_SIZE_5 48
|
// #define HASP_FONT_SIZE_5 48
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#else // smaller than 272
|
// #else // smaller than 272
|
||||||
|
|
||||||
#ifndef HASP_FONT_1
|
// #ifndef HASP_FONT_1
|
||||||
#define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
|
// #define HASP_FONT_1 robotocondensed_regular_12_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_2
|
// #ifndef HASP_FONT_2
|
||||||
#define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
|
// #define HASP_FONT_2 robotocondensed_regular_16_latin1 /* 5% Width */
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_3
|
// #ifndef HASP_FONT_3
|
||||||
#define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
|
// #define HASP_FONT_3 robotocondensed_regular_24_latin1 /* 10% Width */
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_4
|
// #ifndef HASP_FONT_4
|
||||||
#define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
|
// #define HASP_FONT_4 robotocondensed_regular_32_latin1 /* 10% Height */
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_12_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_12_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_16_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_16_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_24_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_24_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_32_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_32_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
// #ifndef ROBOTOCONDENSED_REGULAR_48_LATIN1
|
||||||
#define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
// #define ROBOTOCONDENSED_REGULAR_48_LATIN1 1
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#ifndef HASP_FONT_SIZE_1
|
// #ifndef HASP_FONT_SIZE_1
|
||||||
#define HASP_FONT_SIZE_1 12
|
// #define HASP_FONT_SIZE_1 12
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_2
|
// #ifndef HASP_FONT_SIZE_2
|
||||||
#define HASP_FONT_SIZE_2 16
|
// #define HASP_FONT_SIZE_2 16
|
||||||
#endif
|
// #endif
|
||||||
#if HASP_USE_FREETYPE<=0
|
// #if HASP_USE_FREETYPE<=0
|
||||||
#ifndef HASP_FONT_SIZE_3
|
// #ifndef HASP_FONT_SIZE_3
|
||||||
#define HASP_FONT_SIZE_3 24
|
// #define HASP_FONT_SIZE_3 24
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_4
|
// #ifndef HASP_FONT_SIZE_4
|
||||||
#define HASP_FONT_SIZE_4 32
|
// #define HASP_FONT_SIZE_4 32
|
||||||
#endif
|
// #endif
|
||||||
#ifndef HASP_FONT_SIZE_5
|
// #ifndef HASP_FONT_SIZE_5
|
||||||
#define HASP_FONT_SIZE_5 48
|
// #define HASP_FONT_SIZE_5 48
|
||||||
#endif
|
// #endif
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#endif
|
// #endif
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
#ifndef ROBOTOCONDENSED_REGULAR_12_ALL
|
||||||
|
#define ROBOTOCONDENSED_REGULAR_12_ALL 1
|
||||||
|
#endif
|
||||||
|
#ifndef ROBOTOCONDENSED_REGULAR_16_ALL
|
||||||
|
#define ROBOTOCONDENSED_REGULAR_16_ALL 1
|
||||||
|
#endif
|
||||||
|
#ifndef ROBOTOCONDENSED_REGULAR_24_ALL
|
||||||
|
#define ROBOTOCONDENSED_REGULAR_24_ALL 1
|
||||||
|
#endif
|
||||||
|
#ifndef ROBOTOCONDENSED_REGULAR_32_ALL
|
||||||
|
#define ROBOTOCONDENSED_REGULAR_32_ALL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HASP_FONT_1
|
||||||
|
#define HASP_FONT_1 robotocondensed_regular_12_all
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_2
|
||||||
|
#define HASP_FONT_2 robotocondensed_regular_16_all
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_3
|
||||||
|
#define HASP_FONT_3 robotocondensed_regular_24_all
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_4
|
||||||
|
#define HASP_FONT_4 robotocondensed_regular_32_all
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HASP_FONT_SIZE_1
|
||||||
|
#define HASP_FONT_SIZE_1 12
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_SIZE_2
|
||||||
|
#define HASP_FONT_SIZE_2 16
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_SIZE_3
|
||||||
|
#define HASP_FONT_SIZE_3 24
|
||||||
|
#endif
|
||||||
|
#ifndef HASP_FONT_SIZE_4
|
||||||
|
#define HASP_FONT_SIZE_4 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
|
/* The built-in fonts contains the ASCII range and some Symbols with 4 bit-per-pixel.
|
||||||
@ -683,30 +722,11 @@ typedef void* lv_font_user_data_t;
|
|||||||
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
|
// #define HASP_FONT_1_base FONT_CONCAT(HASP_FONT_1_size, _)
|
||||||
// #define HASP_FONT_1 FONT_CONCAT(HASP_FONT_1_base, HASP_CHARACTER_SET)
|
// #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*/
|
/*Always set a default font from the built-in fonts*/
|
||||||
#if HASP_USE_FREETYPE<=0 // LV_HIGH_RESOURCE_MCU>0
|
#if 0 && HASP_USE_FREETYPE<=0 // LV_HIGH_RESOURCE_MCU>0
|
||||||
// #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_16);
|
// #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_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
|
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
|
||||||
LV_FONT_DECLARE(HASP_FONT_2) \
|
LV_FONT_DECLARE(HASP_FONT_2) \
|
||||||
LV_FONT_DECLARE(HASP_FONT_3) \
|
LV_FONT_DECLARE(HASP_FONT_3) \
|
||||||
@ -722,10 +742,25 @@ typedef void* lv_font_user_data_t;
|
|||||||
//#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
|
//#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(unscii_8_icon);
|
||||||
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
|
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(HASP_FONT_1) \
|
||||||
LV_FONT_DECLARE(HASP_FONT_2) \
|
LV_FONT_DECLARE(HASP_FONT_2) \
|
||||||
|
LV_FONT_DECLARE(HASP_FONT_3) \
|
||||||
|
LV_FONT_DECLARE(HASP_FONT_4) \
|
||||||
|
|
||||||
#ifndef LV_FONT_DEFAULT
|
#ifndef LV_FONT_DEFAULT
|
||||||
#define LV_FONT_DEFAULT &HASP_FONT_2 //&lv_font_unscii_8
|
#if TFT_HEIGHT >= 480 && TFT_WIDTH >= 480
|
||||||
|
#define LV_FONT_DEFAULT &HASP_FONT_4
|
||||||
|
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_3
|
||||||
|
#elif TFT_HEIGHT >= 320 && TFT_WIDTH >= 320
|
||||||
|
#define LV_FONT_DEFAULT &HASP_FONT_3
|
||||||
|
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_2
|
||||||
|
#else // smaller than 320
|
||||||
|
#define LV_FONT_DEFAULT &HASP_FONT_2
|
||||||
|
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1
|
||||||
#endif
|
#endif
|
||||||
|
#endif // LV_FONT_DEFAULT
|
||||||
|
|
||||||
|
#define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT
|
||||||
|
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT
|
||||||
|
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT
|
||||||
|
|
||||||
#endif // LV_HIGH_RESOURCE_MCU
|
#endif // LV_HIGH_RESOURCE_MCU
|
||||||
|
|
||||||
@ -740,17 +775,17 @@ typedef void* lv_font_user_data_t;
|
|||||||
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
|
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
|
||||||
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
|
#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 HASP_USE_FREETYPE<=0 //LV_HIGH_RESOURCE_MCU
|
// #if HASP_USE_FREETYPE<=0 //LV_HIGH_RESOURCE_MCU
|
||||||
#define LV_THEME_DEFAULT_FONT_SMALL &HASP_FONT_1 //&lv_font_montserrat_12
|
// #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_NORMAL &HASP_FONT_2 //&lv_font_montserrat_16
|
||||||
#define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_2 //&lv_font_montserrat_22
|
// #define LV_THEME_DEFAULT_FONT_SUBTITLE &HASP_FONT_2 //&lv_font_montserrat_22
|
||||||
#define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_2 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
|
// #define LV_THEME_DEFAULT_FONT_TITLE &HASP_FONT_2 //&lv_font_montserrat_22 //&lv_font_montserrat_28_compressed
|
||||||
#else
|
// #else
|
||||||
#define LV_THEME_DEFAULT_FONT_SMALL LV_FONT_DEFAULT // &lv_font_montserrat_12
|
// #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
|
// #define LV_THEME_DEFAULT_FONT_NORMAL LV_FONT_DEFAULT // &lv_font_montserrat_16
|
||||||
#define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
|
// #define LV_THEME_DEFAULT_FONT_SUBTITLE LV_FONT_DEFAULT // &lv_font_montserrat_22
|
||||||
#define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
|
// #define LV_THEME_DEFAULT_FONT_TITLE LV_FONT_DEFAULT // &lv_font_montserrat_28_compressed
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#define LV_USE_THEME_EMPTY 0
|
#define LV_USE_THEME_EMPTY 0
|
||||||
#define LV_USE_THEME_MONO 1
|
#define LV_USE_THEME_MONO 1
|
||||||
|
@ -561,38 +561,10 @@ void haspSetup(void)
|
|||||||
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, haspFonts[0]);
|
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, haspFonts[0]);
|
||||||
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, &robotocondensed_regular_16);
|
// LOG_WARNING(TAG_ATTR, "%s %d %x", __FILE__, __LINE__, &robotocondensed_regular_16);
|
||||||
|
|
||||||
#if HASP_USE_FREETYPE > 0
|
haspFonts[0] = LV_THEME_DEFAULT_FONT_SMALL;
|
||||||
|
haspFonts[1] = LV_THEME_DEFAULT_FONT_NORMAL;
|
||||||
#if TFT_HEIGHT >= 480 && TFT_WIDTH >= 480
|
haspFonts[2] = LV_THEME_DEFAULT_FONT_SUBTITLE
|
||||||
haspFonts[0] = get_font("24");
|
haspFonts[3] = LV_THEME_DEFAULT_FONT_TITLE
|
||||||
haspFonts[1] = get_font("32");
|
|
||||||
#elif TFT_HEIGHT >= 320 && TFT_WIDTH >= 320
|
|
||||||
haspFonts[0] = get_font("16");
|
|
||||||
haspFonts[1] = get_font("24");
|
|
||||||
#elif TFT_HEIGHT >= 272 && TFT_WIDTH >= 272
|
|
||||||
haspFonts[0] = get_font("14");
|
|
||||||
haspFonts[1] = get_font("18");
|
|
||||||
#else // smaller than 272
|
|
||||||
haspFonts[0] = get_font("12");
|
|
||||||
haspFonts[1] = get_font("16");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check for failed font pointers
|
|
||||||
if(haspFonts[0] == nullptr) haspFonts[0] = LV_FONT_DEFAULT;
|
|
||||||
if(haspFonts[1] == nullptr) haspFonts[1] = LV_FONT_DEFAULT;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
if(haspFonts[0] == nullptr) haspFonts[0] = LV_THEME_DEFAULT_FONT_SMALL;
|
|
||||||
if(haspFonts[1] == nullptr) haspFonts[1] = LV_THEME_DEFAULT_FONT_NORMAL;
|
|
||||||
|
|
||||||
// if(haspFonts[2] == nullptr) haspFonts[2] = LV_THEME_DEFAULT_FONT_SUBTITLE;
|
|
||||||
// if(haspFonts[3] == nullptr) haspFonts[3] = LV_THEME_DEFAULT_FONT_TITLE;
|
|
||||||
|
|
||||||
#endif // HASP_USE_FREETYPE
|
|
||||||
|
|
||||||
haspFonts[2] = haspFonts[1]; // subtitle isn't used in themes, set to normal font
|
|
||||||
haspFonts[3] = haspFonts[1]; // title isn't used in themes, set to normal font
|
|
||||||
|
|
||||||
hasp_set_theme(haspThemeId);
|
hasp_set_theme(haspThemeId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user