2006-03-30 Han-Wen Nienhuys <hanwen@lilypond.org>
+ * lily/pango-font.cc (pango_item_string_stencil): more robustness.
+
+ * VERSION (PATCH_LEVEL): bump version number.
+
+ * flower/include/guile-compatibility.hh (scm_from_uint32): add
+ scm_from_uint32 ()
+
* lily/pango-font.cc (pango_item_string_stencil): use
scm_from_uint32 ()
#define scm_from_int(x) SCM_MAKINUM (x)
#define scm_from_unsigned_integer(x) scm_uint2num (x)
#define scm_from_unsigned(x) scm_uint2num (x)
+#define scm_from_uint32(x) scm_uint2num (x)
#define scm_is_integer(x) SCM_INUMP (x)
#define scm_is_string(x) SCM_STRINGP (x)
#define scm_hash_table_p scm_vector_p
SCM *tail = &glyph_exprs;
Index_to_charcode_map const *cmap = 0;
- if (! (ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES))
+ bool has_glyph_names = ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES;
+ if (! has_glyph_names)
cmap = ((Pango_font*)this)->get_index_to_charcode_map (file_name, ftface);
bool cid_keyed = false;
PangoGlyph pg = pgi->glyph;
PangoGlyphGeometry ggeo = pgi->geometry;
- 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 ("FT_Get_Glyph_Name returns error");
+ }
+
SCM char_id = SCM_EOL;
if (glyph_name[0] == '\0'
&& cmap
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 ("Glyph has no name, but font supports glyph naming");
+ continue;
+ }
+
if (glyph_name[0] == '\0')
{
/*