5

This should be fairly simple but I'm getting lost in instructions. What is the easiest way to change the font for the tune title only? I don't want to change the whole family of fonts for the whole sheet.

The font I'd like to use is MuseScore's Edwin. If I use the paper block to change the font name to "Edwin", the font is not found. I assume I'd have to specify the path to it.

1 Answer 1

4

Seems to be resolved with \markup and \override, plus specifying the font path:

#(ly:font-config-add-directory "D:/fonts/MuseScore/")

\header {
  title = \markup { \override #'((font-name . "Edwin") (font-size . 6)) "My Tune" }
}

This works. The code can be extracted into a function, and/or into a separate file:

customTitle = #(define-scheme-function
  (title) (markup?)
  #{
     \markup { \override #'((font-name . "Edwin") (font-size . 6)) #title }
  #})

which is then included and used as:

\header {
    title = \customTitle "My Aria"
}

As Abou Samra Jean suggests, it is also possible to create a markup function as

\markup edwin = \markup \override #'((font-name . "Edwin") (font-size . 6)) \etc

which is then used

title = \markup \edwin "My Title"
1
  • 1
    The parser and location arguments are useless in current versions and deprecated. Just remove them. You can even write that function in a very concise way: \markup edwin = \markup \override #'((font-name . "Edwin") (font-size . 6)) \etc. Jan 27 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.