]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/modified-font-metric.cc
Merge with master
[lilypond.git] / lily / modified-font-metric.cc
index 8e215863a6109a600344a11ae9c181491b2f5a39..9a5488f1ccca0c971cdea50044ba60f39a24d8b6 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 #include <cctype>
 using namespace std;
@@ -13,7 +13,6 @@ using namespace std;
 #include "text-metrics.hh"
 #include "warn.hh"
 #include "stencil.hh"
-#include "lookup.hh"
 #include "main.hh"
 
 Modified_font_metric::Modified_font_metric (Font_metric *fm,
@@ -179,16 +178,19 @@ Modified_font_metric::text_stencil (string text) const
 Box
 Modified_font_metric::text_dimension (string text) const
 {
-  SCM stext = scm_makfrom0str (text.c_str ());
-  Box b = lookup_tex_text_dimension (orig_, stext);
-  if (!b[Y_AXIS].is_empty ())
-    {
-      b.scale (magnification_);
-      return b;
-    }
-
+  SCM stext = ly_string2scm (text);
+  
+  Box b;
   if (output_backend_global == "tex")
     {
+      b = lookup_tex_text_dimension (orig_, stext);
+
+      if (!b[Y_AXIS].is_empty ())
+       {
+         b.scale (magnification_);
+         return b;
+       }
+
       b = tex_kludge (text);
       return b;
     }