Lyrics alignment: Difference between revisions

mNo edit summary
Demonstrate more alignment values
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 &nbsp;-1 means left-aligned, 0&nbsp;centered, and 1&nbsp;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 &nbsp;-1 means left-aligned, 0&nbsp;centered, and 1&nbsp;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
  c1
  c1
}
}
\addlyrics {
\addlyrics {
   \once \override LyricText.self-alignment-X = #LEFT
   \once \override LyricText.self-alignment-X = #LEFT
   "This is left-aligned"
   "left-aligned"
   \once \override LyricText.self-alignment-X = #CENTER
   \once \override LyricText.self-alignment-X = #CENTER
   "This is centered"
   "centered"
   \once \override LyricText.self-alignment-X = 1
   \once \override LyricText.self-alignment-X = 1
   "This is right-aligned"
   "right-aligned"
  \once \override LyricText.self-alignment-X = #-2
  "very left"
}
}
</lilypond>
</lilypond>