From 06c064a351bca485cc7d1245b57835b413459e32 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Jan 2023 11:17:49 -0700 Subject: [PATCH] [util] Use hb_font_glyph_to_string --- util/font-options.hh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/util/font-options.hh b/util/font-options.hh index d2b981708..a44d21cc4 100644 --- a/util/font-options.hh +++ b/util/font-options.hh @@ -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); }