On Wed, Oct 2, 2024 at 12:43 PM Walt North <waltno...@gmail.com> wrote:

> I don't think I'm understanding font-family correctly.  And the
> documentation is not gelling with me.
>
> I see a large number of font family names when I run the display fonts
> command.
>
> But only roman, sans, and typewriter seem to have any affect when I set
> the font-family in the layout.
>
> So far neither the lilypond documentation nor any any google searches is
> helping me understand how font families are set other then the three
> that seem to work. I'm hoping someone can help make it click for me.
>
> Walt North
>
> \version "2.24.4"
>
> #(ly:font-config-display-fonts)
>
> ly = \new Lyrics \lyricmode { \repeat unfold 4 { word1 }}
>
> \score {
>    \ly
> }
>
> \score {
>    \layout {
>      \context {
>        \Lyrics
>        \override LyricText.font-family = #'typewriter
>      }
>    }
>    \ly
> }
>
> \score {
>    \layout {
>      \context {
>        \Lyrics
>        \override LyricText.font-family = #'sans
>      }
>    }
>    \ly
> }
>
> \score {
>    \layout {
>      \context {
>        \Lyrics
>        \override LyricText.font-family = #'Consolas
>      }
>    }
>    \ly
> }
>

Hi Walt,

I usually override font-name:

%%% BEGIN %%%

ly = \new Lyrics \lyricmode { \repeat unfold 4 word1 }

\score {
   \layout {
     \context {
       \Lyrics
       \override LyricText.font-name = "Times"
     }
   }
   \ly
}

\score {
   \layout {
     \context {
       \Lyrics
       \override LyricText.font-name = "Times Italic"
     }
   }
   \ly
}

\score {
   \layout {
     \context {
       \Lyrics
       \override LyricText.font-name = "Palatino"
     }
   }
   \ly
}

\score {
   \layout {
     \context {
       \Lyrics
       \override LyricText.font-name = "Palatino Italic"
     }
   }
   \ly
}

\score {
   \layout {
     \context {
       \Lyrics
       \override LyricText.font-name = "Comic Sans MS"
     }
   }
   \ly
}

%%% END %%%

I've been doing this for years, but usually only for one or two pieces of
markup at a time (rather than globally for an entire context, as shown
above).

But I notice that font-name appears to no longer be mentioned in the 2.25
version of Notation Reference 1.8.3 on fonts. In fact, searching the PDF of
the 2.25 NR seems to yield no results for "font-name" at all. So perhaps
something is changing here.

Trevor.

-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca

Reply via email to