]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/vertically-aligned-dynamics-and-textscripts.ly
Doc-it: chapter 1 completed
[lilypond.git] / Documentation / snippets / vertically-aligned-dynamics-and-textscripts.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.17.25"
8
9 \header {
10   lsrtags = "spacing, tweaks-and-overrides, workaround"
11
12   texidoc = "
13 By setting the @code{'Y-extent} property to a suitable value, all
14 @code{DynamicLineSpanner} objects (hairpins and dynamic texts) can be
15 aligned to a common reference point, regardless of their actual extent.
16 This way, every element will be vertically aligned, thus producing a
17 more pleasing output.
18
19 The same idea, together with @code{\\textLengthOn}, is used to align
20 the text scripts along their baseline.
21
22 "
23   doctitle = "Vertically aligned dynamics and textscripts"
24 } % begin verbatim
25
26 \markup \vspace #1 %avoid LSR-bug
27
28 music = \relative c' {
29   a'2\p b\f
30   e4\p f\f\> g, b\p
31   c2^\markup { \huge gorgeous } c^\markup { \huge fantastic }
32 }
33
34 {
35   \music
36   \break
37   \override DynamicLineSpanner.staff-padding = #2.0
38   \override DynamicLineSpanner.Y-extent = #'(-1.5 . 1.5)
39   \textLengthOn
40   \override TextScript.Y-extent = #'(-1.5 . 1.5)
41   \music
42 }