]> git.donarmstrong.com Git - lilypond.git/commitdiff
(pango_item_string_stencil): update from 2.9.x release/2.8.1
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 30 Mar 2006 22:55:36 +0000 (22:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 30 Mar 2006 22:55:36 +0000 (22:55 +0000)
ChangeLog
lily/chord-tremolo-engraver.cc
lily/pango-font.cc

index 8749767bb3cc10547b286acfaf27df64342576ca..744e4f67571a760ecad87f33595ad64fe5fc6a4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-31  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/pango-font.cc (pango_item_string_stencil): update from 2.9.x
+
 2006-03-30  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
        * lily/ttf.cc (print_trailer): only print existing glyphs. 
index 9c6cd1069f9b475363579816f45bf7f0f4f9e1b1..29fe53cbc5ca8be18b669a9287bdc4db0d3e4d3a 100644 (file)
@@ -176,6 +176,7 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info)
       stem_tremolo_->set_object ("stem",
                                 info.grob ()->self_scm ());
       stem_tremolo_->set_parent (info.grob (), X_AXIS);
+      info.grob ()->set_object ("tremolo-flag", stem_tremolo_->self_scm ());
     }
 }
 
index 0dd963386040866fe62a92ddfce594c3ecc75fb8..56ce0371371cef9d4b574bc189ea6650454e7fbd 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,23 +152,39 @@ 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
 
-      SCM char_id;
-      if (glyph_name[0] == '\0' && cmap)
+         /* Ugh should ask FreeType about font type. */
+         && (file_name.find (".ttf") != NPOS
+             || file_name.find (".TTF") != NPOS))
        {
          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. Skipping glyph.");
+         continue;
+       }
+         
       if (glyph_name[0] == '\0')
        {
          /*
            CID entry
          */
          cid_keyed = true;
-         char_id = scm_from_int (pg);
+         char_id = scm_from_unsigned_integer (pg);
        }
       else
        char_id = scm_makfrom0str (glyph_name);