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.
@macro textanchor{NAME}
@html
-<a name href="\NAME\"></a>
+<a name="\NAME\"></a>
@end html
@end macro
@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
Jamie Bullock
D. Josiah Boothby
Kieren MacMillan
+Kris Shaffer
Nancho Alvarez
Steve Doonan
Sven Axelsson
}
+\layout { raggedright = ##t }
{
\time 3/4
\set Score.skipBars = ##t
R2.^"4"
R2.*3_\markup { \roman "a1b2c3" }
R2.*10^"inner"^"top"_"inner"_"bot"
+ R2.^"very very very very very very long text"
c'2.
}
#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)
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);
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");
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))
(scale (ly:output-def-lookup paper 'outputscale))
(to-dump-systems '()))
- (display systems)
;; skip booktitles.
(if (and
(not