]> git.donarmstrong.com Git - lilypond.git/commitdiff
(text_stencil): dump string as (utf-8-string
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 3 Jan 2005 22:30:01 +0000 (22:30 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 3 Jan 2005 22:30:01 +0000 (22:30 +0000)
FONTDESC UTF8) for use in -f gnome, -f svg.

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

index 1a23de0933254051f6594ef19842082f2f15fd8a..046552ddd8815fffaa3fb565c4f77f29d4e8439b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-03  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/pango-font.cc (text_stencil): dump string as (utf-8-string
+       FONTDESC UTF8) for use in -f gnome, -f svg.
+
 2005-01-03  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * configure.in (gui_b): Remove handy developer-only
index 55e566eb65d08049e06ac53d4b047034014cbd45..77139c08b88ba21b04ec2addb09c85e098017c00 100644 (file)
@@ -22,6 +22,7 @@
 class Pango_font : public Font_metric
 {
   PangoContext *context_;
+  PangoFontDescription *description_; 
   PangoAttrList *attribute_list_;
   Real scale_;
   SCM subfonts_;
index 042ac350a6f054efbb93c7da2ed1983692c28bcd..fbdf13ba05a1717b10a7798c3de49dd40d7d1c84 100644 (file)
@@ -30,6 +30,8 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap,
     : PANGO_DIRECTION_RTL;
   context_ =
     pango_ft2_get_context (PANGO_RESOLUTION, PANGO_RESOLUTION);
+
+  description_ = pango_font_description_copy (description);
   //  context_ = pango_ft2_font_map_create_context (fontmap);  
   attribute_list_= pango_attr_list_new();
 
@@ -47,6 +49,7 @@ Pango_font::Pango_font (PangoFT2FontMap *fontmap,
 
 Pango_font::~Pango_font ()
 {
+  pango_font_description_free (description_);
   g_object_unref (context_);
   pango_attr_list_unref (attribute_list_);
 }
@@ -130,6 +133,13 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
   return item_stencil;  
 }
 
+Stencil
+Pango_font::direct_pango_text_stencil (String str) const
+{
+
+
+}
+
 Stencil
 Pango_font::text_stencil (String str) const
 {
@@ -154,6 +164,21 @@ Pango_font::text_stencil (String str) const
       ptr = ptr->next;      
     }
 
+  if (output_format_global != "ps")
+    {
+      /*
+       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 (description_)),
+                     scm_makfrom0str (str.to_str0 ()));
+
+
+      return Stencil (dest.extent_box (),
+                     exp);
+    }
+  
   return dest;
 }