]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/pango-font.cc
* scm/output-ps.scm (utf8-string): add utf8-string for completeness.
[lilypond.git] / lily / pango-font.cc
index d53c6fb913e8be5580fb17fe1612fe00380ab573..87e22e1b367ce3e77e6c7c6975a82b8908bfa04d 100644 (file)
@@ -91,10 +91,10 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
                                                   PangoFcFont);
       
   FT_Face ftface = pango_fc_font_lock_face (fcfont);
-  Box b (Interval (PANGO_LBEARING(logical_rect),
-                  PANGO_RBEARING(logical_rect)),
-        Interval (-PANGO_DESCENT(logical_rect),
-                  PANGO_ASCENT(logical_rect)));
+  Box b (Interval (PANGO_LBEARING(ink_rect),
+                  PANGO_RBEARING(ink_rect)),
+        Interval (-PANGO_DESCENT(ink_rect),
+                  PANGO_ASCENT(ink_rect)));
             
   b.scale (scale_);
 
@@ -162,22 +162,29 @@ Pango_font::text_stencil (String str) const
       ptr = ptr->next;      
     }
 
-  if (output_backend_global != "ps")
+  /*
+    UGH. Should have flags per output format signifying supported
+    options.
+   */
+  if (output_backend_global != "ps"
+      && output_backend_global != "eps")
     {
       /*
        For Pango based backends, we take a shortcut.
        */
       SCM exp
-       = scm_list_3 (ly_symbol2scm ("utf-8-string"),
-                     scm_makfrom0str (pango_font_description_to_filename (pango_description_)),
+       = scm_list_3 (ly_symbol2scm ("utf8-string"),
+                     scm_makfrom0str (pango_font_description_to_string (pango_description_)),
                      scm_makfrom0str (str.to_str0 ()));
 
 
-      return Stencil (dest.extent_box (),
-                     exp);
+      Box b (Interval (0, 0), Interval (0, 0));
+      b.unite (dest.extent_box ());
+      return Stencil (b, exp);
     }
   
 #if 0
+  // check extents.
   if (!dest.extent_box ()[X_AXIS].is_empty ())
     {
       Stencil frame = Lookup::frame (dest.extent_box(), 0.1, 0.1);