font: add user data
This commit is contained in:
@@ -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
|
||||
*=================*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**********************
|
||||
|
||||
Reference in New Issue
Block a user