mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[ft] hb_ft_get_glyph_from_name fails for the name of glyph id 0
Based on patch from Jonathan Kew, as reported on the mailing list.
This commit is contained in:
parent
29b596ac67
commit
e509d35cf1
1 changed files with 9 additions and 0 deletions
|
@ -260,6 +260,15 @@ hb_ft_get_glyph_from_name (hb_font_t *font HB_UNUSED,
|
|||
*glyph = FT_Get_Name_Index (ft_face, buf);
|
||||
}
|
||||
|
||||
if (*glyph == 0)
|
||||
{
|
||||
/* Check whether the given name was actually the name of glyph 0. */
|
||||
char buf[128];
|
||||
if (!FT_Get_Glyph_Name(ft_face, 0, buf, sizeof (buf)) &&
|
||||
len < 0 ? !strcmp (buf, name) : !strncmp (buf, name, len))
|
||||
return true;
|
||||
}
|
||||
|
||||
return *glyph != 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue