[ft] Don't set *glyph in get_glyph() if glyph not found
This commit is contained in:
parent
ff0f210519
commit
9df099b483
16
src/hb-ft.cc
16
src/hb-ft.cc
|
@ -75,15 +75,19 @@ hb_ft_get_glyph (hb_font_t *font HB_UNUSED,
|
||||||
void *user_data HB_UNUSED)
|
void *user_data HB_UNUSED)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
unsigned int g;
|
||||||
FT_Face ft_face = (FT_Face) font_data;
|
FT_Face ft_face = (FT_Face) font_data;
|
||||||
|
|
||||||
if (unlikely (variation_selector)) {
|
if (likely (!variation_selector))
|
||||||
*glyph = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector);
|
g = FT_Get_Char_Index (ft_face, unicode);
|
||||||
return *glyph != 0;
|
else
|
||||||
}
|
g = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector);
|
||||||
|
|
||||||
*glyph = FT_Get_Char_Index (ft_face, unicode);
|
if (unlikely (!g))
|
||||||
return *glyph != 0;
|
return false;
|
||||||
|
|
||||||
|
*glyph = g;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hb_position_t
|
static hb_position_t
|
||||||
|
|
Loading…
Reference in New Issue