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: Justin Peter
Subject: Re: Lyric alignment bug with markup
Date: Tue, 14 Sep 2021 12:46:53 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 9/14/2021 9:03 AM, Aaron Hill wrote:
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

(Sorry, I think I forgot to cc the mailing list the first time.)

Thank you for all the examples - I don't think I'll need anything quite that complicated, but seeing the different ways to do it was helpful.

Justin




reply via email to

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