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


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to