Creating text spanners: Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 1: | Line 1: | ||
The <code>\startTextSpan</code> and <code>\stopTextSpan</code> commands allow the creation of text spanners as easily as pedal indications or octavations. Override some properties of the <code>TextSpanner</code> object to modify its output. | The <code>\startTextSpan</code> and <code>\stopTextSpan</code> commands allow the creation of text spanners as easily as pedal indications or octavations. Override some properties of the <code>TextSpanner</code> object to modify its output. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
\paper { ragged-right = ##f } | \paper { ragged-right = ##f } | ||
Revision as of 18:53, 16 November 2025
The \startTextSpan and \stopTextSpan commands allow the creation of text spanners as easily as pedal indications or octavations. Override some properties of the TextSpanner object to modify its output.
\version "2.24"
\paper { ragged-right = ##f }
\relative c'' {
\override TextSpanner.bound-details.left.text = #"bla"
\override TextSpanner.bound-details.right.text = #"blu"
a4 \startTextSpan
b4 c
a4 \stopTextSpan
\override TextSpanner.style = #'line
\once \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
a4 \startTextSpan
b4 c
a4 \stopTextSpan
\override TextSpanner.style = #'dashed-line
\override TextSpanner.bound-details.left.text =
\markup { \draw-line #'(0 . 1) }
\override TextSpanner.bound-details.right.text =
\markup { \draw-line #'(0 . -2) }
\once \override TextSpanner.bound-details.right.padding = #-2
a4 \startTextSpan
b4 c
a4 \stopTextSpan
\set Staff.middleCPosition = #-13
\override TextSpanner.dash-period = #10
\override TextSpanner.dash-fraction = #0.5
\override TextSpanner.thickness = #10
a4 \startTextSpan
b4 c
a4 \stopTextSpan
}