1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(font): fix get glyph id bug. (#7404)

Co-authored-by: azh <anzhaohui@gurobot.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Allen 2024-12-22 18:20:05 +08:00 committed by GitHub
parent 27ebfc20ad
commit 17b76773a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {