From d94075ac925634c47f3dd48f702804b23dd85261 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 28 May 2019 12:10:50 +0200 Subject: [PATCH] font: add unicode_list_length and glyph_id_ofs_list_length --- src/lv_fonts/lv_font_template.c | 15 +++++++++------ src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lv_fonts/lv_font_template.c b/src/lv_fonts/lv_font_template.c index 3b2f057a1..6f8ac35ac 100644 --- a/src/lv_fonts/lv_font_template.c +++ b/src/lv_fonts/lv_font_template.c @@ -58,16 +58,19 @@ 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, .unicode_list = unicode_list_1, .glyph_id_ofs_list = glyph_id_ofs_list_1 + .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 = 0x20, .range_length = 112, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY, - .glyph_id_start = 456, .unicode_list = NULL, .glyph_id_ofs_list = NULL + .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 = 0x560, .range_length = 7654, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL, - .glyph_id_start = 756, .unicode_list = NULL, .glyph_id_ofs_list = glyph_id_ofs_list_3 + .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, }, }; diff --git a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h b/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h index 7474c5241..d80b4a5a1 100644 --- a/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h +++ b/src/lv_misc/lv_font_fmt/lv_font_fmt_txt.h @@ -99,11 +99,13 @@ 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; }lv_font_fmt_txt_cmap_t; /*Describe glyph pairs for kerning*/