]> git.donarmstrong.com Git - lilypond.git/commitdiff
Pango: API change to fix fetaText rendering.
authorPatrick McCarty <pnorcks@gmail.com>
Mon, 22 Mar 2010 21:36:08 +0000 (14:36 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Mon, 22 Mar 2010 21:47:54 +0000 (14:47 -0700)
The changes to the Font_metric API rendered obsolete the "tight-bbox"
filtering in Pango_font.

This commit modifies the API appropriately to fix the rendering of text
with the fetaText encoding.

lily/include/pango-font.hh
lily/pango-font.cc

index 31ce425485a81c70ade4ad9534bf70a249c6afbb..8f6e5496f4d70481f68485c72dbb2cec483cb4fe 100644 (file)
@@ -49,9 +49,8 @@ public:
   string description_string () const; 
   SCM font_file_name () const;
   void register_font_file (string, string, int);
-  Stencil text_stencil (string, bool, bool) const;
 
-  Stencil pango_item_string_stencil (PangoGlyphItem const *, bool) const;
+  Stencil pango_item_string_stencil (PangoGlyphItem const *) const;
 
   virtual Stencil text_stencil (Output_def* output_state,
                                 string text, bool music) const;
index 6d18820b97e66eb83461a68ea1002e296623d15a..0587badadb45b3c594e20a715d2d8b25dcf9f210 100644 (file)
@@ -111,8 +111,7 @@ get_unicode_name (char *s,
 }
 
 Stencil
-Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item,
-                                      bool tight_bbox) const
+Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const
 {
   const int GLYPH_NAME_LEN = 256;
   char glyph_name[GLYPH_NAME_LEN];
@@ -128,13 +127,11 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item,
 
   FT_Face ftface = pango_fc_font_lock_face (fcfont);
 
-  PangoRectangle const *which_rect = tight_bbox ? &ink_rect
-                                               : &logical_rect;
-
   Box b (Interval (PANGO_LBEARING (logical_rect),
                   PANGO_RBEARING (logical_rect)),
-        Interval (-PANGO_DESCENT (*which_rect),
-                  PANGO_ASCENT (*which_rect)));
+        Interval (-PANGO_DESCENT (ink_rect),
+                  PANGO_ASCENT (ink_rect)));
+
   b.scale (scale_);
 
   char const *ps_name_str0 = FT_Get_Postscript_Name (ftface);
@@ -300,19 +297,11 @@ Pango_font::physical_font_tab () const
   return physical_font_tab_;
 }
 
-Stencil
-Pango_font::text_stencil (Output_def* state,
-                          string str, bool music_string) const
-{
-  return text_stencil (str, music_string, false);
-}
-
 extern bool music_strings_to_paths;
 
 Stencil
-Pango_font::text_stencil (string str,
-                         bool music_string,
-                         bool tight) const
+Pango_font::text_stencil (Output_def* state,
+                         string str, bool music_string) const
 {
   /*
     The text assigned to a PangoLayout is automatically divided
@@ -334,7 +323,7 @@ Pango_font::text_stencil (string str,
       for (GSList *p = layout_runs; p; p = p->next)
        {
          PangoGlyphItem *item = (PangoGlyphItem *) p->data;
-         Stencil item_stencil = pango_item_string_stencil (item, tight);
+         Stencil item_stencil = pango_item_string_stencil (item);
 
          item_stencil.translate_axis (last_x, X_AXIS);
          last_x = item_stencil.extent (X_AXIS)[RIGHT];