From: Han-Wen Nienhuys Date: Wed, 24 Aug 2005 15:54:57 +0000 (+0000) Subject: (set_text_rods): new function. X-Git-Tag: release/2.7.8~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2c1fe45dad10846e728cb135cb75206d74b7f7c3;p=lilypond.git (set_text_rods): new function. --- diff --git a/ChangeLog b/ChangeLog index 35c2291a6a..c848e7a6b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-08-24 Han-Wen Nienhuys + * 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. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index e128204db8..05d533d416 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -23,7 +23,7 @@ See user manual, \NAME\ @macro textanchor{NAME} @html - + @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 8aebe3cdbb..e3f24e87da 100644 --- 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 diff --git a/input/regression/multi-measure-rest-text.ly b/input/regression/multi-measure-rest-text.ly index 2aef498b2e..768708b9c0 100644 --- a/input/regression/multi-measure-rest-text.ly +++ b/input/regression/multi-measure-rest-text.ly @@ -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. } diff --git a/lily/bezier.cc b/lily/bezier.cc index 96b37a8705..d6ecd0b313 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -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) diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index 4492945b06..901d4cdf93 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -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); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index bacb18e3c1..34a302954f 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -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 (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"); diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index b01bb0a91a..47c1714d86 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -833,9 +833,11 @@ 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)) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 30cf033e61..031e51998f 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -493,7 +493,6 @@ (scale (ly:output-def-lookup paper 'outputscale)) (to-dump-systems '())) - (display systems) ;; skip booktitles. (if (and (not