- FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
- *tail = scm_cons (scm_list_3 (scm_from_double (ggeo.x_offset * scale_ + dx),
+ 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);
+ }
+
+ 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);
+ }
+
+ if (glyph_name[0] == '\0')
+ {
+ /*
+ CID entry
+ */
+ cid_keyed = true;
+ char_id = scm_from_uint32 (pg);
+ }
+ else
+ char_id = scm_from_locale_string (glyph_name);
+
+ *tail = scm_cons (scm_list_4 (scm_from_double (ggeo.width * scale_),
+ scm_from_double (ggeo.x_offset * scale_),