diff --git a/src/font/lv_font_fmt_txt.c b/src/font/lv_font_fmt_txt.c index 7d818d7a8..47c7aa43e 100644 --- a/src/font/lv_font_fmt_txt.c +++ b/src/font/lv_font_fmt_txt.c @@ -270,6 +270,10 @@ static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter) } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL) { const uint8_t * gid_ofs_8 = fdsc->cmaps[i].glyph_id_ofs_list; + /* The first character is always valid and should have offset = 0 + * However if a character is missing it also has offset=0. + * So if there is a 0 not on the first position then it's a missing character */ + if(gid_ofs_8[rcp] == 0 && letter != fdsc->cmaps[i].range_start) continue; glyph_id = fdsc->cmaps[i].glyph_id_start + gid_ofs_8[rcp]; } else if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) {