diff --git a/lv_conf_template.h b/lv_conf_template.h index 6678833d8..96ca4b499 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -259,6 +259,9 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i #define LV_FONT_DEFAULT &lv_font_dejavu_20 /*Always set a default font from the built-in fonts*/ +/*Declare the type of the user data of fonts (can be e.g. `void *`, `int`, `struct`)*/ +typedef void * lv_font_user_data_t; + /*================= * Text settings *=================*/ diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 700e59b2b..9948551ba 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -167,8 +167,7 @@ void lv_disp_refr_task(lv_task_t * task) /* With true double buffering the flushing should be only the address change of the * current frame buffer. Wait until the address change is ready and copy the changed * content to the other frame buffer (new active VDB) to keep the buffers synchronized*/ - while(vdb->flushing) - ; + while(vdb->flushing); uint8_t * buf_act = (uint8_t *)vdb->buf_act; uint8_t * buf_ina = (uint8_t *)vdb->buf_act == vdb->buf1 ? vdb->buf2 : vdb->buf1; diff --git a/src/lv_misc/lv_font.h b/src/lv_misc/lv_font.h index 0996b9112..6787b3e39 100644 --- a/src/lv_misc/lv_font.h +++ b/src/lv_misc/lv_font.h @@ -66,6 +66,9 @@ typedef struct _lv_font_struct uint8_t line_height; /*The real line height where any text fits*/ uint8_t base_line; /*Base line measured from the top of the line_height*/ void * dsc; /*Store implementation specific data here*/ +#if LV_USE_USER_DATA + lv_font_user_data_t user_data; +#endif } lv_font_t; /**********************