[util] Use hb_font_glyph_to_string

This commit is contained in:
Behdad Esfahbod 2023-01-19 11:17:49 -07:00
parent 0c7d386748
commit 06c064a351
1 changed files with 6 additions and 9 deletions

View File

@ -422,9 +422,8 @@ _list_unicodes (hb_font_t *font)
hb_codepoint_t gid = hb_map_get (cmap, u);
char glyphname[64];
if (!hb_font_get_glyph_name (font, gid,
glyphname, sizeof glyphname))
snprintf (glyphname, sizeof glyphname, "gid%u", gid);
hb_font_glyph_to_string (font, gid,
glyphname, sizeof glyphname);
printf ("U+%04X %s\n", u, glyphname);
}
@ -451,9 +450,8 @@ _list_unicodes (hb_font_t *font)
assert (b);
char glyphname[64];
if (!hb_font_get_glyph_name (font, gid,
glyphname, sizeof glyphname))
snprintf (glyphname, sizeof glyphname, "gid%u", gid);
hb_font_glyph_to_string (font, gid,
glyphname, sizeof glyphname);
printf ("U+%04X,U+%04X %s\n", vs, u, glyphname);
}
@ -475,9 +473,8 @@ _list_glyphs (hb_font_t *font)
for (hb_codepoint_t gid = 0; gid < num_glyphs; gid++)
{
char glyphname[64];
if (!hb_font_get_glyph_name (font, gid,
glyphname, sizeof glyphname))
snprintf (glyphname, sizeof glyphname, "gid%u", gid);
hb_font_glyph_to_string (font, gid,
glyphname, sizeof glyphname);
printf ("%u %s\n", gid, glyphname);
}