]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/chord-name.scm (chord::name->text): Workaround: clean markup
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 26 Jun 2002 14:07:36 +0000 (14:07 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 26 Jun 2002 14:07:36 +0000 (14:07 +0000)
text.

* lily/text-item.cc (markup_text2molecule): Bugfix: raise only once.

ChangeLog
input/test/chord-markup.ly [new file with mode: 0644]
input/test/markup.ly
lily/text-item.cc
scm/chord-name.scm

index d5b41c7afe00e247034b213fdf44368866673f6d..aded4a000caf805a4b6c97844112ecc3078cc36c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2002-06-26  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * scm/chord-name.scm (chord::name->text): Workaround: clean markup
+       text.
+
+       * lily/text-item.cc (markup_text2molecule): Bugfix: raise only once.
+
        * input/test/ambitus.ly:
        * lily/ambitus-engraver.cc:
        * lily/ambitus.cc:
diff --git a/input/test/chord-markup.ly b/input/test/chord-markup.ly
new file mode 100644 (file)
index 0000000..4519d16
--- /dev/null
@@ -0,0 +1,23 @@
+\header{
+    texidoc = "chord/markup test"
+}
+
+\paper{ linewidth = -1.0\mm }
+
+\score{
+    <
+       \context Staff \notes \relative c'' {
+           c^#'(columns "foe" ((raise . 3) "bar"))
+           c
+           c^#'(columns "foe" (super "12") (sub "3 4"))
+           c
+
+           %% broken for now
+           %%  c^#`(columns (lines "" ";" "") (lines "1" (bold "2") "3"))
+           c^#`(columns (lines "" ";" "") (lines "1" (columns (bold "2")) "3"))
+               }
+       \context ChordNames \chords {
+           c:7+.9-^3.5
+       }
+   >
+}
index 01ab852e532e8839cd1e522e433416dad486ee46..00e1a2deaf2b7dbd39a359d11ee9132b5a1dca84 100644 (file)
@@ -23,7 +23,7 @@
     f-#'(finger "3")
     g-#'(music (named "noteheads-2"
     ((kern . -0.1) "flags-stem")
-    (((kern . -0.1) (raise . 3.5)) "flags-u3"))))
+    (((kern . -0.1) (raise . 3.5)) "flags-u3")))
     b-#'(columns "a" (((kern . 3) (raise . 2)) "b") "c")
     c-#'(columns "1" (((raise . -2) (kern . -1)) "2") "3")
                                % }
@@ -50,6 +50,8 @@
     
     c^#'(columns "foe" ((raise . 3) "bar"))
     c^#'(columns "foe" (super "12") (sub "3 4"))
+    %% UGHUGH
+    c^#'(columns "foe" (super ((raise . 1) "12")) (sub ((raise . -1) "3 4")))
     c^#'(columns "foe" (super (overstrike "o") "/") (sub "x"))
     c^#'(columns "foe" (overstrike "o") "/")
     c^#'(columns "foe" ((bold roman overstrike) "o") "/")
index 2ee9cd14c03f6d655b274b7dd330b6c30638c378..19fbf548d2701887a9c01644e76997326a3cc78e 100644 (file)
@@ -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)
     {
index 004aededa266461b6e0171626f8d5b80a3df96a9..c47b803a284e3e3b05636ae5a9e322f41068eb8c 100644 (file)
 (define (chord::text? text)
   (not (or (not text) (empty? text) (unspecified? text))))
 
+;; FIXME: remove need for me, use text-append throughout
 (define (chord::text-cleanup dirty)
   "
    Recursively remove '() #f, and #<unspecified> from markup text tree.
      (list (list '((raise . 1) (font-relative-size . -1))) adds-text subs-text)
      b+i-text)))
 
-(define (chord::name-banter tonic exception-part unmatched-steps
-                           bass-and-inversion steps)
-  (let ((additions (chord::additions unmatched-steps))
-       (subtractions (chord::subtractions unmatched-steps)))
-    (chord::inner-name-banter tonic exception-part additions subtractions
-                             bass-and-inversion steps)))
-
-
 (define (c++-pitch->scm p)
   (if (pitch? p)
       (list (pitch-octave p) (pitch-notename p) (pitch-alteration p))
 
 (define (chord::name-banter tonic exception-part unmatched-steps
                            bass-and-inversion steps)
-  (let ((additions (chord::additions unmatched-steps))
-       (subtractions (chord::subtractions unmatched-steps)))
-    (chord::inner-name-banter tonic exception-part additions subtractions
-                             bass-and-inversion steps)))
+   (let ((additions (chord::additions unmatched-steps))
+        (subtractions (chord::subtractions unmatched-steps)))
+     (chord::inner-name-banter tonic exception-part additions subtractions
+                              bass-and-inversion steps)))
+
 
 (define (chord::restyle name style)
   (primitive-eval (string->symbol
   (let* ((lookup (chord::exceptions-lookup style steps))
         (exception-part (car lookup))
         (unmatched-steps (cadr lookup)))
-    ((chord::restyle 'chord::name- style)
-     tonic exception-part unmatched-steps bass-and-inversion steps)))
+    (chord::text-cleanup
+     ((chord::restyle 'chord::name- style)
+      tonic exception-part unmatched-steps bass-and-inversion steps))))
 
 ;; C++ entry point
 ;;