bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lyric alignment bug with markup


From: Aaron Hill
Subject: Re: Lyric alignment bug with markup
Date: Tue, 14 Sep 2021 07:03:31 -0700
User-agent: Roundcube Webmail/1.4.9

On 2021-09-14 6:21 am, Justin Peter wrote:
It doesn't appear that any of this is covered in the documentation -
is wanting to format entire verses/groups of lyrics not a common use
case, or would that be something helpful to add?

It is common, but it is done via \override and not \markup.

%%%%
fancyText = {
  \override LyricText.font-shape = #'italic
  \override LyricText.color = #red
}

\new Lyrics \with { \fancyText } \lyricmode { a b c }
\new Lyrics \lyricmode { \fancyText a b c }
\new Lyrics \lyricmode { a \once \fancyText b c }
%%%%

If you need to apply arbitrary \markup commands to all lyrics, you could install a transforming procedure that operates on each individual LyricText:

%%%%
transformText =
#(define-music-function (transformer) (procedure?)
 #{ \override LyricText.text = #(grob-transformer 'text
     (lambda (grob orig) (transformer orig))) #})

boxify = #(lambda (text) #{ \markup \box #text #})
jitter = #(lambda (text) #{ \markup \rotate #(- (random 20) 10) #text #})

\new Lyrics \lyricmode {
  \transformText \boxify lorem ipsum dolor sit amet
  \transformText \jitter lorem ipsum dolor sit amet
}
%%%%


-- Aaron Hill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]