+2005-08-18 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * scm/define-grob-properties.scm (avoid-slur): New property.
+
+ * lily/phrasing-slur-engraver.cc (acknowledge_extra_object):
+ * lily/slur-engraver.cc (acknowledge_extra_object): Invoke
+ outside_slur_callback if avoid-slur != #'inside.
+
+ * scm/define-grobs.scm (Fingering, Textscript): No
+ inside-slur/outside-slur preference.
+ (DynamicLineSpanner): Always outside slur.
+
+ * input/regression/slur-script.ly: More tests.
+
2005-08-17 Graham Percival <gpermus@gmail.com>
* Documentation/user/lilypond-book: fix notime entry.
* lily/rest-collision.cc (do_shift): spello.
- * input/proportional.ly: use #'used property. Set break-overshoot property.
+ * input/proportional.ly: use #'used property. Set break-overshoot
+ property.
* mf/feta-arrow.mf: center on arrow tip center, iso. tip edge.
@item
Text scripts such as fingering instructions and dynamics avoid
-collisions with Slurs
+collisions with slurs
@lilypond[fragment,relative=1]
{
- b_1( b <b d f>_1_3_5)
+ b_1( f'_1_2_3 c_3_4_5 a)
+ b( f'\p b,)
c-2_\markup { \italic {"cresc."}}( f c)
- c-3( c\f c)
}
@end lilypond
\header {
- texidoc = "A slur avoids collisions with scripts. Only articulations
- go inside the slur, dynamic markings, fingerings texts etc. go outside
- of slur.
+ texidoc = "A slur avoids collisions with scripts. Articulations
+ go inside the slur, dynamic markings go outside the slur.
+ Fingerings and texts are placed either inside or outside.
- For different configurations, the scripts can be moved manually."
- }
+ For different configurations, the defaults can be changed, and
+ scripts can be moved manually."
+ }
\version "2.6.0"
\layout {
b4-.( b-. b-.)
b(-. d-.)
- b_1( b b_1_2_3)
- %% Allow Fingering to go inside slur.
- \override Fingering #'inside-slur = ##t
- b( d_1 b)
- c_\markup { \italic {"cresc."}}( f c)
- c( c\f c)
+ b_1( f'_1_2_3 c_3_4_5 a)
+ b( f'\p b,)
+
+ %% Do not force dynamics outside slur, only avoid collisions.
+ \override DynamicLineSpanner #'avoid-slur = #'()
+ \override DynamicLineSpanner #'padding = #0.3
+ b( e\p e\f b)
+
+ c_\markup { \italic {"cresc."}}( c c)
\once \override Script #'padding = #1.2
b-.( b-.
\once \override Script #'padding = #1.2
Phrasing_slur_engraver::acknowledge_extra_object (Grob_info info)
{
Grob *e = info.grob ();
- SCM inside = e->get_property ("inside-slur");
+ SCM avoid = e->get_property ("avoid-slur");
if (Tie::has_interface (e)
- || to_boolean (inside))
+ || avoid == ly_symbol2scm ("inside"))
{
for (int i = slurs_.size (); i--;)
Slur::add_extra_encompass (slurs_[i], e);
for (int i = end_slurs_.size (); i--;)
Slur::add_extra_encompass (end_slurs_[i], e);
}
- else if (inside == SCM_BOOL_F
+ else if (avoid != ly_symbol2scm ("inside")
&& e->name () != "DynamicText")
{
Grob *slur = slurs_.size () ? slurs_[0] : 0;
"side-relative-direction "
"side-support-elements "
"slur-padding "
- "staff-padding ");
+ "staff-padding "
+ );
Slur_engraver::acknowledge_extra_object (Grob_info info)
{
Grob *e = info.grob ();
- SCM inside = e->get_property ("inside-slur");
+ SCM avoid = e->get_property ("avoid-slur");
if (Tie::has_interface (e)
- || to_boolean (inside))
+ || avoid == ly_symbol2scm ("inside"))
{
for (int i = slurs_.size (); i--;)
Slur::add_extra_encompass (slurs_[i], e);
for (int i = end_slurs_.size (); i--;)
Slur::add_extra_encompass (end_slurs_[i], e);
}
- else if (inside == SCM_BOOL_F
+ else if (avoid != ly_symbol2scm ("inside")
&& e->name () != "DynamicText")
{
Grob *slur = slurs_.size () ? slurs_[0] : 0;
bool consider[] = { false, false, false };
Real ys[] = {0, 0, 0};
bool do_shift = false;
+ SCM avoid = script->get_property ("avoid-slur");
for (int d = LEFT, k = 0; d <= RIGHT; d++, k++)
{
consider[k] = true;
/* Request shift if slur is contained script's Y, or if
- script is fully inside slur. */
- if (yext.contains (ys[k]) || dir * ys[k] > dir * yext[-dir])
+ script is inside slur and avoid == outside. */
+ if (yext.contains (ys[k])
+ || (avoid == ly_symbol2scm ("outside")
+ && dir * ys[k] > dir * yext[-dir]))
do_shift = true;
}
}
(horizontal-shift ,integer? "An integer that identifies ranking
of note-column for horizontal shifting. This is used by
@internalsref{note-collision-interface}.")
- (inside-slur ,boolean? "If set, this script should be inside the
-slur. If set to false, the script places itself around the slur. If
-unset, script and slur ignore each other ")
+ (avoid-slur ,symbol? "Method of handling slur collisions.
+Choices are @{around}, @{ignore}, @{inside}, @{outside}. If
+unset, script and slur ignore eachother.")
(inspect-quants ,number-pair? "If debugging is set,
set beam quant to this position, and print the respective scores.")
(Accidental
. (
(print-function . ,Accidental_interface::print)
- (inside-slur . #t)
+ (avoid-slur . inside)
(cautionary-style . parentheses)
(after-line-breaking-callback . ,Accidental_interface::after_line_breaking)
(meta . ((class . Item)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(staff-padding . 0.1)
(padding . 0.6)
- (inside-slur . #f)
+ (avoid-slur . outside)
(slur-padding . 0.3)
(minimum-space . 1.2)
(direction . -1)
;; sync with TextScript (?)
(padding . 0.5)
- (inside-slur . #f)
(slur-padding . 0.2)
(staff-padding . 0.5)
(self-alignment-X . 0)
(padding . 0.5)
(staff-padding . 0.5)
(before-line-breaking-callback . ,Script_interface::before_line_breaking)
- (inside-slur . #f)
(slur-padding . 0.5)
(script-priority . 200)
;; todo: add X self alignment?