- FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
+ glyph_name[0] = '\0';
+ if (has_glyph_names)
+ {
+ int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
+ if (errorcode)
+ programming_error (_f ("FT_Get_Glyph_Name () error: %s",
+ freetype_error_string (errorcode).c_str ()
+ ));
+ }
+
+ SCM char_id = SCM_EOL;
+ if (glyph_name[0] == '\0'
+ && cmap
+ && is_ttf
+ && cmap->find (pg) != cmap->end ())
+ {
+ FT_ULong char_code = cmap->find (pg)->second;
+ get_unicode_name (glyph_name, char_code);
+ }