font: add user data

This commit is contained in:
Gabor Kiss-Vamosi
2019-06-02 14:18:21 +02:00
parent ff65ecd102
commit 366698bba3
3 changed files with 7 additions and 2 deletions

View File

@@ -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*/ #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 * Text settings
*=================*/ *=================*/

View File

@@ -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 /* 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 * 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*/ * 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_act = (uint8_t *)vdb->buf_act;
uint8_t * buf_ina = (uint8_t *)vdb->buf_act == vdb->buf1 ? vdb->buf2 : vdb->buf1; uint8_t * buf_ina = (uint8_t *)vdb->buf_act == vdb->buf1 ? vdb->buf2 : vdb->buf1;

View File

@@ -66,6 +66,9 @@ typedef struct _lv_font_struct
uint8_t line_height; /*The real line height where any text fits*/ 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*/ uint8_t base_line; /*Base line measured from the top of the line_height*/
void * dsc; /*Store implementation specific data here*/ void * dsc; /*Store implementation specific data here*/
#if LV_USE_USER_DATA
lv_font_user_data_t user_data;
#endif
} lv_font_t; } lv_font_t;
/********************** /**********************