]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/vertically-centered-dynamics-and-textscripts.ly
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
[lilypond.git] / input / lsr / vertically-centered-dynamics-and-textscripts.ly
1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
3 \version "2.11.38"
4
5 \header {
6   lsrtags = "tweaks-and-overrides, spacing"
7  texidoc = "
8 By setting the Y-extent property to a fixed value (here -1.5 . 1.5), we
9 force LilyPond to align every elements of the DynamicLineSpanner (text
10 elements and dynamics) to a common reference point, regardless to the
11 actual extent of these objects. This way, every element will be
12 vertically centered, for a nicer output (you can compare the first and
13 the second line in this example; the trick is only applied on the
14 second line).
15
16 The same idea is used to align the text scripts along their baseline.
17 " }
18 % begin verbatim
19 \paper { indent = 0 line-width = 5\in }
20
21 music = \relative c''
22 {
23    c2\p^\markup { "gorgeous" } c\f^\markup { "fantastic" }
24    c4\p c \f \> c c \! \p
25 }
26
27 \score
28 {
29    {
30        \music \break
31
32        \override DynamicLineSpanner #'staff-padding = #2.0
33        \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5)
34        \override TextScript #'Y-extent = #'(-1.5 . 1.5)
35        \music
36    }
37 }
38