]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/pango-font.cc (pango_item_string_stencil): more robustness.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 30 Mar 2006 17:53:48 +0000 (17:53 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 30 Mar 2006 17:53:48 +0000 (17:53 +0000)
* 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 ()

* lily/pango-font.cc (pango_item_string_stencil): only use uXXX
glyphnames if we have a ttf font.

ChangeLog
VERSION
flower/include/guile-compatibility.hh
lily/pango-font.cc

index b35223412d827080ae28749dcecef674f536057a..694195e31e91b014ba6ce5730430815f980adf5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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 ()
 
diff --git a/VERSION b/VERSION
index ac0e56c186c1ad2f99e0883c5babaf06cc641f11..5ab0ec392e355b82f99ff0628a0b1d1e6885bdc3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=9
-PATCH_LEVEL=0
+PATCH_LEVEL=1
 MY_PATCH_LEVEL=
 
index 022771812aab083ac819f1f038702fd5685af279..0ccbe57196e578200427761417dc22998311829c 100644 (file)
@@ -42,6 +42,7 @@ inline SCM scm_cadar (SCM x) { return SCM_CADAR (x); }
 #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
index 2ea4852ed3b751c401419d2893f414540926d709..f38c5ff7b5ec96631b3a51b6e1b513af155461d8 100644 (file)
@@ -140,7 +140,8 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const
   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;
@@ -151,8 +152,14 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const
       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
@@ -164,8 +171,13 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const
          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')
        {
          /*