]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/controlling-spanner-visibility-after-a-line-break.ly
Imported Upstream version 2.14.2
[lilypond.git] / Documentation / snippets / new / controlling-spanner-visibility-after-a-line-break.ly
1 \version "2.14.0"
2
3 \header {
4   lsrtags = "expressive-marks, tweaks-and-overrides"
5   texidoc = "The visibility of spanners which end on the first note
6 following a line break is controlled by the @code{after-line-breaking}
7 callback @code{ly:spanner::kill-zero-spanned-time}.
8
9 For objects such as glissandos and hairpins, the default behaviour is
10 to hide the spanner after a break; disabling the callback will allow
11 the left-broken span to be shown.
12
13 Conversely, spanners which are usually visible, such as text spans,
14 can be hidden by enabling the callback.
15 "
16
17   doctitle = "Controlling spanner visibility after a line break"
18 }
19
20 \paper { ragged-right = ##t }
21
22 \relative c'' {
23   \override Hairpin #'to-barline = ##f
24   \override Glissando #'breakable = ##t
25   % show hairpin
26   \override Hairpin #'after-line-breaking = ##t
27   % hide text span
28   \override TextSpanner #'after-line-breaking =
29     #ly:spanner::kill-zero-spanned-time
30   e2\<\startTextSpan
31   % show glissando
32   \override Glissando #'after-line-breaking = ##t
33   f2\glissando
34   \break
35   f,1\!\stopTextSpan
36 }
37