lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Music font doesn't scale with staff


From: Abraham Lee
Subject: Re: Custom Music font doesn't scale with staff
Date: Mon, 21 Nov 2022 13:54:33 -0700

Hi, Yentl!

On Mon, Nov 21, 2022 at 1:40 PM Yentl Tijssens <yentltijssens@icloud.com> wrote:
Hello,
I use the custom font Beethoven. Even though I have all the correct sizes installed, the font doesn’t use the right one when changing the default size:
Doesn’t anyone have a solution to this?

\version "2.22.2"
#(set-global-staff-size 12)
\paper {
  #(define fonts
     (set-global-fonts
      #:music "beethoven"
      #:brace "beethoven"
      ))
}
\score {
  \relative c' {  c4 d e2 }
}

It’s not the font that’s the problem, but an unexpected nuance of the way fonts are initiated within LilyPond.

What you need to do is add the #:factor variable to set-global-fonts, like this:

(set-global-fonts
  #:music “beethoven”
  #:brace “beethoven”
  #:factor (/ staff-height pt 20)
)

Since you are changing the staff size from the default of 20pt to 12pt, this command will provide the correct scaling factor and make the font symbols the correct size for a 12pt staff.

And, yes, I tried to eliminate the need for that variable, but I could never figure out how to automagically collect the staff-height and perform this calculation behind the scenes so the user doesn’t have to. Alas, it is necessary for the foreseeable future. Enjoy Beethoven! It was fun making it!

Hope that helps,
Abraham



reply via email to

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