mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(API): keep font struct lv_font_fmt_txt_kern_pair_t public (#6625)
This commit is contained in:
parent
1d14386b99
commit
39345de1cd
@ -108,6 +108,21 @@ typedef struct {
|
||||
lv_font_fmt_txt_cmap_type_t type;
|
||||
} lv_font_fmt_txt_cmap_t;
|
||||
|
||||
/** A simple mapping of kern values from pairs*/
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2. for(i = 0; i < pair_cnt * 2; i += 2)
|
||||
if(glyph_ids[i] == glyph_id_left &&
|
||||
glyph_ids[i+1] == glyph_id_right)
|
||||
return values[i / 2];
|
||||
*/
|
||||
const void * glyph_ids;
|
||||
const int8_t * values;
|
||||
uint32_t pair_cnt : 30;
|
||||
uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/
|
||||
} lv_font_fmt_txt_kern_pair_t;
|
||||
|
||||
/** More complex but more optimal class based kern value storage*/
|
||||
typedef struct {
|
||||
/*To get a kern value of two code points:
|
||||
|
@ -24,21 +24,6 @@ extern "C" {
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/** A simple mapping of kern values from pairs*/
|
||||
struct lv_font_fmt_txt_kern_pair_t {
|
||||
/*To get a kern value of two code points:
|
||||
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
|
||||
2. for(i = 0; i < pair_cnt * 2; i += 2)
|
||||
if(glyph_ids[i] == glyph_id_left &&
|
||||
glyph_ids[i+1] == glyph_id_right)
|
||||
return values[i / 2];
|
||||
*/
|
||||
const void * glyph_ids;
|
||||
const int8_t * values;
|
||||
uint32_t pair_cnt : 30;
|
||||
uint32_t glyph_ids_size : 2; /*0: `glyph_ids` is stored as `uint8_t`; 1: as `uint16_t`*/
|
||||
};
|
||||
|
||||
#if LV_USE_FONT_COMPRESSED
|
||||
typedef enum {
|
||||
RLE_STATE_SINGLE = 0,
|
||||
|
@ -169,8 +169,6 @@ typedef struct lv_cover_check_info_t lv_cover_check_info_t;
|
||||
|
||||
typedef struct lv_obj_spec_attr_t lv_obj_spec_attr_t;
|
||||
|
||||
typedef struct lv_font_fmt_txt_kern_pair_t lv_font_fmt_txt_kern_pair_t;
|
||||
|
||||
typedef struct lv_image_t lv_image_t;
|
||||
|
||||
typedef struct lv_animimg_t lv_animimg_t;
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#if LV_BUILD_TEST
|
||||
#include "../../lvgl.h"
|
||||
#include "../../lvgl_private.h"
|
||||
|
||||
#include "unity/unity.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user