Fix the problem that nk_font_bake_pack uses ttc font offset incorrectly (#456)
This commit is contained in:
parent
776893ef7b
commit
1dad328fe9
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue