Fix the problem that nk_font_bake_pack uses ttc font offset incorrectly (#456)

This commit is contained in:
Jai 2022-12-16 12:20:03 +08:00
parent 776893ef7b
commit 1dad328fe9
2 changed files with 2 additions and 2 deletions

View File

@ -16619,7 +16619,7 @@ nk_font_bake_pack(struct nk_font_baker *baker,
struct stbtt_fontinfo *font_info = &baker->build[i++].info;
font_info->userdata = alloc;
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, 0))
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0)))
return nk_false;
} while ((it = it->n) != config_iter);
}

View File

@ -194,7 +194,7 @@ nk_font_bake_pack(struct nk_font_baker *baker,
struct stbtt_fontinfo *font_info = &baker->build[i++].info;
font_info->userdata = alloc;
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, 0))
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0)))
return nk_false;
} while ((it = it->n) != config_iter);
}