Lyrics alignment: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
Horizontal alignment for lyrics can be set by overriding the <code>self-alignment-X</code> property of the <code>LyricText</code> object. Value -1 means left-aligned, 0 centered, and 1 right-aligned. Alternatively, you can use the Scheme values <code>LEFT</code>, <code>CENTER</code>, and <code>RIGHT</code> instead of numbers. | Horizontal alignment for lyrics can be set by overriding the <code>self-alignment-X</code> property of the <code>LyricText</code> object. Value -1 means left-aligned, 0 centered, and 1 right-aligned. Alternatively, you can use the Scheme values <code>LEFT</code>, <code>CENTER</code>, and <code>RIGHT</code> instead of numbers. Other numeric values are possible, too – don't forget to add the <samp>#</samp> Scheme prefix for negative numbers! | ||
<lilypond version="2.24"> | <lilypond version="2.24"> | ||
| Line 7: | Line 7: | ||
\relative c'' { | \relative c'' { | ||
c1 | c1 c c c | ||
} | } | ||
\addlyrics { | \addlyrics { | ||
\once \override LyricText.self-alignment-X = #LEFT | \once \override LyricText.self-alignment-X = #LEFT | ||
" | "left-aligned" | ||
\once \override LyricText.self-alignment-X = #CENTER | \once \override LyricText.self-alignment-X = #CENTER | ||
" | "centered" | ||
\once \override LyricText.self-alignment-X = 1 | \once \override LyricText.self-alignment-X = 1 | ||
" | "right-aligned" | ||
\once \override LyricText.self-alignment-X = #-1.5 | |||
"very right" | |||
} | } | ||
</lilypond> | </lilypond> | ||
Latest revision as of 08:03, 28 December 2025
Horizontal alignment for lyrics can be set by overriding the self-alignment-X property of the LyricText object. Value -1 means left-aligned, 0 centered, and 1 right-aligned. Alternatively, you can use the Scheme values LEFT, CENTER, and RIGHT instead of numbers. Other numeric values are possible, too – don't forget to add the # Scheme prefix for negative numbers!
\version "2.24"
\layout {
ragged-right = ##f
}
\relative c'' {
c1 c c c
}
\addlyrics {
\once \override LyricText.self-alignment-X = #LEFT
"left-aligned"
\once \override LyricText.self-alignment-X = #CENTER
"centered"
\once \override LyricText.self-alignment-X = 1
"right-aligned"
\once \override LyricText.self-alignment-X = #-1.5
"very right"
}