]> git.donarmstrong.com Git - lilypond.git/commitdiff
(set_text_rods): new function.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Aug 2005 15:54:57 +0000 (15:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 24 Aug 2005 15:54:57 +0000 (15:54 +0000)
ChangeLog
Documentation/topdocs/NEWS.tely
THANKS
input/regression/multi-measure-rest-text.ly
lily/bezier.cc
lily/include/multi-measure-rest.hh
lily/multi-measure-rest.cc
scm/define-grobs.scm
scm/framework-ps.scm

index 35c2291a6ae3770ab94225147869a5a0d83b2716..c848e7a6b0d73ceba3f36d5c3152ef99c65413a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-08-24  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/multi-measure-rest.cc (set_text_rods): new function.
+
+       * lily/vertical-align-engraver.cc (process_music): call
+       Align_interface::set_axis(). This forces #'elements to be ordered,
+       preventing random vertical reordering  of staves.
+
        * scm/define-grob-interfaces.scm (dynamic-line-spanner-interface):
        add avoid-slur property. 
 
index e128204db8bc12359ce15411e138c99ce0d18285..05d533d416b51ce75f9f15d03d4fefe16d0a65d0 100644 (file)
@@ -23,7 +23,7 @@ See user manual, \NAME\
 
 @macro textanchor{NAME}
 @html
-<a name href="\NAME\"></a>
+<a name="\NAME\"></a>
 @end html
 @end macro
 
@@ -42,7 +42,21 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 @end ifhtml
 
 
+
+
 @itemize @bullet
+
+
+@item
+Texts over multi measure rests now stretch corresponding measure.
+
+@lilypond[relative=2,fragment,raggedright]
+c1 R1 R1^"Very long long long text" 
+@end lilypond
+
+This feature was sponsored by Kris Shaffer.
+
+
 @item @textanchor{tie-chords}
 Formatting of ties in chords has been improved. Ties no longer collide
 with note heads and stems. In addition, it is possible to manually
diff --git a/THANKS b/THANKS
index 8aebe3cdbba49ae49af5e4bd7caa1316a5a24ca7..e3f24e87da86a982d15989f321eef054b9404898 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -25,6 +25,7 @@ Jay Hamilton
 Jamie Bullock
 D. Josiah Boothby
 Kieren MacMillan
+Kris Shaffer
 Nancho Alvarez
 Steve Doonan
 Sven Axelsson
index 2aef498b2e999b408886728219edd4695409f14d..768708b9c03111c95affd1d2eaba1f7fa89954a0 100644 (file)
@@ -10,6 +10,7 @@ Texts may be added to the multi-measure rests.
 
 }
 
+\layout { raggedright = ##t }
 {
   \time 3/4
   \set Score.skipBars = ##t
@@ -18,5 +19,6 @@ Texts may be added to the multi-measure rests.
   R2.^"4"
   R2.*3_\markup { \roman "a1b2c3" }
   R2.*10^"inner"^"top"_"inner"_"bot"
+  R2.^"very very very very very very long text"
   c'2.
 }
index 96b37a8705ffe8800c3b5a3168ebbcaa3452915f..d6ecd0b3135ba1fce8766b3d473cb6c16c415ef6 100644 (file)
@@ -12,7 +12,9 @@
 #include "warn.hh"
 #include "libc-extension.hh"
 
-Real binomial_coefficient_3[] = {1, 3, 3, 1};
+Real binomial_coefficient_3[] = {
+  1, 3, 3, 1
+};
 
 Real
 binomial_coefficient (Real over, int under)
index 4492945b06f6158c23fe58ea8e0db851dc1c6d38..901d4cdf9345e2a659f97a59fa48fcd48eb6a4d4 100644 (file)
@@ -20,6 +20,7 @@ public:
   DECLARE_SCHEME_CALLBACK (percent, (SCM));
   static void add_column (Grob *, Item *);
   DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+  DECLARE_SCHEME_CALLBACK (set_text_rods, (SCM));
   DECLARE_SCHEME_CALLBACK (centered_stencil, (SCM));
 
   static Stencil big_rest (Grob *, Real);
index bacb18e3c1c517114833e5471a8d85436bef0d7c..34a302954fc58a9fa93116489c3d8688b00893c0 100644 (file)
@@ -328,7 +328,66 @@ Multi_measure_rest::set_spacing_rods (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
+/*
+  Ugh. Cut & paste.
+ */
+MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_text_rods, 1);
+SCM
+Multi_measure_rest::set_text_rods (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+
+  Spanner *sp = dynamic_cast<Spanner *> (me);
+  if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT)))
+    {
+      programming_error ("Multi_measure_rest::get_rods (): I am not spanned!");
+      return SCM_UNSPECIFIED;
+    }
+
+  Item *li = sp->get_bound (LEFT)->get_column ();
+  Item *ri = sp->get_bound (RIGHT)->get_column ();
+  Item *lb = li->find_prebroken_piece (RIGHT);
+  Item *rb = ri->find_prebroken_piece (LEFT);
+
+  Item *combinations[4][2] = {{li, ri},
+                             {lb, ri},
+                             {li, rb},
+                             {lb, rb}};
+
+  SCM st = me->get_uncached_stencil ();
+  Real len = unsmob_stencil (st)
+    ? unsmob_stencil (st)->extent (X_AXIS).length ()
+    : 0.0;
+  
+
+  for (int i = 0; i < 4; i++)
+    {
+      Item *li = combinations[i][0];
+      Item *ri = combinations[i][1];
+
+      if (!li || !ri)
+       continue;
+
+      Rod rod;
+      rod.item_drul_[LEFT] = li;
+      rod.item_drul_[RIGHT] = ri;
+
+      rod.distance_ = len; 
+
+      Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
+      rod.distance_ = max (rod.distance_, minlen);
+      rod.add_to_cols ();
+    }
+  return SCM_UNSPECIFIED;
+}
+
+
 ADD_INTERFACE (Multi_measure_rest, "multi-measure-rest-interface",
               "A rest that spans a whole number of measures.",
-              "expand-limit measure-count hair-thickness thick-thickness use-breve-rest minimum-length");
+              "expand-limit "
+              "measure-count "
+              "hair-thickness "
+              "thick-thickness "
+              "use-breve-rest "
+              "minimum-length");
 
index b01bb0a91a13c5f21cc930a90d4274e4e2e12d75..47c1714d86080f6c85b3be42f3d810ce02824b6d 100644 (file)
                                self-alignment-interface
                                font-interface
                                text-interface))))))
+    
     (MultiMeasureRestText
      . (
        (print-function . ,Text_interface::print)
+       (spacing-procedure . ,Multi_measure_rest::set_text_rods)
        (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
                               ,Self_alignment_interface::centered_on_other_axis_parent))
        (Y-offset-callbacks . (,Side_position_interface::aligned_side))
index 30cf033e61dc46487d4a4b6d3efe33b64ba21a98..031e51998fc904ab6c04bf4d70d10a1a73451786 100644 (file)
         (scale (ly:output-def-lookup paper 'outputscale))
         (to-dump-systems '()))
 
-    (display systems)
     ;; skip booktitles.
     (if (and
         (not