LilyPond has well-known ways to change the font within markup and for 
the whole document.  It can be harder to find the ways to change the 
font for all of just a specific class of text, such as lyrics; but it 
can be done.  Try:

\lyricmode {
   \override LyricText.font-name = #"Comic Sans MS"
   Blah blah blah
   ...
}

(Obviously the font must be installed in your OS.)  Now, Lilypond likes 
its fonts to be in defined families (roman, sans, and typewriter), which 
you can change globally, and the properties like bold and italic refer 
to these families.  When you change the font outside a family, the \bold 
and \italic commands or overrides are no longer available; you have to 
select the exact required version of the font by name, e.g.:

   \override LyricText.font-name = #"Comic Sans MS Italic"

It is possible to get round this by defining your own font family in 
addition to those provided within LilyPond, like this:

\paper {
    #(define fonts
      (let ((n (set-global-fonts))
            (factor (/ staff-height pt 20)))
        (add-pango-fonts n 'handwriting "Comic Sans MS" (* 1.1 factor))
        n))
}
#(define-markup-command (handwriting layout props arg) (markup?)
    (interpret-markup layout
      (prepend-alist-chain 'font-family 'handwriting props) arg))

You can then set your newly-defined font-family to be used, after which 
the usual facilities are still available, as in:

\lyricmode {
   \override LyricText.font-family = #'handwriting
   Blah blah
   \override LyricText.font-shape = #'italic
   blah
   \once \override LyricText.font-shape = #'normal
   blah
   ...
}

I discovered this method in an archive post: 
https://lists.gnu.org/archive/html/lilypond-user/2019-02/msg00041.html , 
and now know considerably more about fonts myself than I did before I 
wrote this!

The override command can be put at the start of a particular set of 
lyrics if you want only that verse or whatever to use the new font, or 
in a \layout block to change the font for all lyrics.

Paul


On 06/10/2021 04:49:06, "Виноградов Юрий" <[email protected]> wrote:

>Good. I understood you. Thanks. But if I can change the font type in 
>the code section \header {title= \markup { \sans or \serif ...} }. But 
>I can't figure out how to change the font specifically in the voice 
>text code section \verse = \lyricmode {once upon a time}. Sorry for the 
>inaccuracy of the code. I am grateful to you in advance.

Reply via email to