+ /*
+ Zero-width characters are valid Unicode characters,
+ but glyph lookups need to be skipped.
+ */
+ if (!(pg ^ PANGO_GLYPH_EMPTY))
+ continue;
+
+ glyph_name[0] = '\0';
+ if (has_glyph_names)
+ {
+ FT_Error 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);
+ }
+
+ if (glyph_name[0] == '\0' && has_glyph_names)
+ {
+ programming_error (_f ("Glyph has no name, but font supports glyph naming.\n"
+ "Skipping glyph U+%0X, file %s",
+ pg, file_name.c_str ()));
+ continue;
+ }
+
+ if (glyph_name == string (".notdef") && is_ttf)
+ glyph_name[0] = '\0';
+
+ if (glyph_name[0] == '\0' && is_ttf)
+ // Access by glyph index directly.
+ get_glyph_index_name (glyph_name, pg);