font: use a common list length in the arrays of cmaps
This commit is contained in:
@@ -58,19 +58,25 @@ static uint8_t glyph_id_ofs_list_3 = {32, 45, 66};
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 0x280, .range_length = 124, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
|
||||
.glyph_id_start = 223, .glyph_id_ofs_list = glyph_id_ofs_list_1, .glyph_id_ofs_list = 23,
|
||||
.unicode_list = unicode_list_1, .unicode_list_length = 8,
|
||||
.range_start = 0x280, .range_length = 124, .glyph_id_start = 223,
|
||||
.list_length = 8,
|
||||
.glyph_id_ofs_list = glyph_id_ofs_list_1,
|
||||
.unicode_list = unicode_list_1,
|
||||
.type = LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
|
||||
},
|
||||
{
|
||||
.range_start = 0x20, .range_length = 112, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
.glyph_id_start = 456, .glyph_id_ofs_list = NULL, .glyph_id_ofs_list_length = 0,
|
||||
.unicode_list = NULL, .unicode_list_length = 22,
|
||||
.range_start = 0x20, .range_length = 112, .glyph_id_start = 456,
|
||||
.list_length = 22,
|
||||
.glyph_id_ofs_list = NULL,
|
||||
.unicode_list = NULL,
|
||||
.type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
|
||||
},
|
||||
{
|
||||
.range_start = 0x560, .range_length = 7654, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
|
||||
.glyph_id_start = 756, .glyph_id_ofs_list = glyph_id_ofs_list_3, .glyph_id_ofs_list_length = 23,
|
||||
.unicode_list = NULL, .unicode_list_length = 0,
|
||||
.range_start = 0x560, .range_length = 7654, .glyph_id_start = 756,
|
||||
.list_length = 23,
|
||||
.glyph_id_ofs_list = glyph_id_ofs_list_3,
|
||||
.unicode_list = NULL,
|
||||
.type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -69,8 +69,6 @@ typedef struct {
|
||||
/* First glyph ID (array index of `glyph_dsc`) for this range */
|
||||
uint16_t glyph_id_start;
|
||||
|
||||
lv_font_fmt_txt_cmap_type_t type;
|
||||
|
||||
/*
|
||||
According the specification there are 4 formats:
|
||||
https://github.com/littlevgl/lv_font_conv/blob/master/doc/font_spec.md
|
||||
@@ -99,13 +97,17 @@ typedef struct {
|
||||
*/
|
||||
|
||||
uint16_t * unicode_list;
|
||||
uint32_t unicode_list_length;
|
||||
|
||||
/* if(type == LV_FONT_FMT_TXT_CMAP_FORMAT0_...) it's `uint8_t *`
|
||||
* if(type == LV_FONT_FMT_TXT_CMAP_SPARSE_...) it's `uint16_t *`
|
||||
*/
|
||||
const void * glyph_id_ofs_list;
|
||||
uint32_t glyph_id_ofs_list_length;
|
||||
|
||||
/*Length of `unicode_list` and/or `glyph_id_ofs_list`*/
|
||||
uint16_t list_length;
|
||||
|
||||
/*Type of this character map*/
|
||||
lv_font_fmt_txt_cmap_type_t type :2;
|
||||
}lv_font_fmt_txt_cmap_t;
|
||||
|
||||
/*Describe glyph pairs for kerning*/
|
||||
|
||||
Reference in New Issue
Block a user