Jump to content

Lyrics alignment: Difference between revisions

From LilyPond wiki
No edit summary
m New category
Line 23: Line 23:
[[Category:Text]]
[[Category:Text]]
[[Category:Really simple]]
[[Category:Really simple]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Revision as of 23:34, 21 November 2025

Horizontal alignment for lyrics can be set by overriding the self-alignment-X property of the LyricText object. -1 is left, 0 is center, and 1 is right; however, you can use #LEFT, #CENTER and #RIGHT as well.

\version "2.24"

\layout { ragged-right = ##f }

\relative c'' {
  c1
  c1
  c1
}
\addlyrics {
  \once \override LyricText.self-alignment-X = #LEFT
  "This is left-aligned"
  \once \override LyricText.self-alignment-X = #CENTER
  "This is centered"
  \once \override LyricText.self-alignment-X = 1
  "This is right-aligned"
}