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: Yentl Tijssens
Subject: Re: Custom Music font doesn't scale with staff
Date: Mon, 21 Nov 2022 22:11:07 +0100

Oh, it’s the creator themselves, what an honour!
Your solution worked. I was only wondering how I should calculate the required #:factor depending on the staff size.

PS: I have to tell you, it’s largely thanks to your font that I get so many compliments from the jury of my conservatory on the beauty of my scores.

Kind regards,
Yentl Tijssens

On 21 Nov 2022, at 21:54, Abraham Lee <tisimst.lilypond@gmail.com> wrote:

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]