]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-item.cc
* lily/parser.yy (command_element): move clef stuff into Scheme.
[lilypond.git] / lily / text-item.cc
index 2ee9cd14c03f6d655b274b7dd330b6c30638c378..389129867042648d28140ea7b982a2b07831a9a2 100644 (file)
@@ -8,7 +8,7 @@
  */
 #include <math.h>
 
-#include "debug.hh"
+#include "warn.hh"
 #include "text-item.hh"
 #include "paper-def.hh"
 #include "font-interface.hh"
@@ -89,7 +89,7 @@ Text_item::lookup_character (Grob *, Font_metric*fm, SCM char_name)
 
 
 Molecule
-Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text)
+Text_item::lookup_text (Grob *, Font_metric*fm, SCM text)
 {
   SCM list = scm_list_n (ly_symbol2scm ("text"), text, SCM_UNDEFINED);
   list = fontify_atom (fm, list);
@@ -111,7 +111,7 @@ Molecule
 Text_item::markup_text2molecule (Grob *me, SCM markup_text,
                                 SCM alist_chain)
 {
-  SCM sheet = me->paper_l ()->style_sheet_;
+  SCM sheet = me->get_paper ()->style_sheet_;
   SCM f = ly_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet));
   
   SCM markup = ly_car (markup_text);
@@ -145,6 +145,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
   SCM r = ly_assoc_chain (ly_symbol2scm ("raise"), p);
   if (gh_pair_p (r) && gh_number_p (ly_cdr (r)))
     raise = gh_scm2double (ly_cdr (r)) * staff_space;
+  
 
   Interval extent;
   bool extent_b = false;
@@ -157,13 +158,19 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
     }
 
   Offset o (kern[X_AXIS], raise - kern[Y_AXIS]);
-
   
   Molecule mol = Lookup::filledbox (Box (Interval (0,0), Interval (0,0)));
+
+  SCM cp = ly_deep_copy (p);
+  if (raise)
+    {
+      SCM cr = ly_assoc_chain (ly_symbol2scm ("raise"), cp);
+      scm_set_cdr_x (cr, gh_int2scm (0));
+    }
   
   while (gh_pair_p (text))
     {
-      Molecule m = text2molecule (me, ly_car (text), p);
+      Molecule m = text2molecule (me, ly_car (text), cp);
 
       if (!m.empty_b ())
        {
@@ -175,6 +182,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
       text = ly_cdr (text);
     }
   
+  
   /* Set extend to markup requested value. */
   if (extent_b)
     {