lv_conf.h: add LV_FONT_CUSTOM_DECLARE to enable global defination of custom fonts

This commit is contained in:
Gabor Kiss-Vamosi
2018-07-07 11:26:24 +02:00
parent 94702f63ff
commit dd9324ac05
2 changed files with 16 additions and 5 deletions
+10 -2
View File
@@ -104,8 +104,6 @@
/* More info about fonts: https://littlevgl.com/basics#fonts
* To enable a built-in font use 1,2,4 or 8 values
* which will determine the bit-per-pixel */
#define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
#define USE_LV_FONT_DEJAVU_10 0
#define USE_LV_FONT_DEJAVU_10_LATIN_SUP 0
#define USE_LV_FONT_DEJAVU_10_CYRILLIC 0
@@ -126,6 +124,16 @@
#define USE_LV_FONT_DEJAVU_40_CYRILLIC 0
#define USE_LV_FONT_SYMBOL_40 0
/* Optionally declare your custom fonts here.
* You can use these fonts as defult font too
* and they will be avialale globally. E.g.
* #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) \
* LV_FONT_DECLARE(my_font_2) \
*/
#define LV_FONT_CUSTOM_DECLARE
#define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/
/*===================
* LV_OBJ SETTINGS
*==================*/
+6 -3
View File
@@ -141,9 +141,9 @@ int16_t lv_font_get_width_sparse(const lv_font_t * font, uint32_t unicode_letter
**********************/
#define LV_FONT_DECLARE(font_name) extern lv_font_t font_name;
/******************************
* FONT DECLARATION INCLUDES
*****************************/
/**********************
* FONT DECLARATION
**********************/
/*10 px */
#if USE_LV_FONT_DEJAVU_10
@@ -213,6 +213,9 @@ LV_FONT_DECLARE(lv_font_dejavu_40_cyrillic);
LV_FONT_DECLARE(lv_font_symbol_40);
#endif
/*Declare the custom (user defined) fonts*/
LV_FONT_CUSTOM_DECLARE
#ifdef __cplusplus
} /* extern "C" */
#endif