lilypond-user
[Top][All Lists]
Advanced

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

Re: Change clef size


From: Paul Hodges
Subject: Re: Change clef size
Date: Wed, 2 Nov 2022 12:12:05 +0000

I have now used this successfully in four scores (four parts of one work), but I have a mystery.

In the first three, it worked perfectly as expected.  However, in the fourth (a larger score) it worked for a while and then the change clefs reverted to the original default size.  I had to correct this my using an explicit font-size override when it went wrong, but this also lasted only a certain way and then needed to be repeated.  I cannot think of anything in the score which would have any bearing on this, apart from one place (much later than where it went wrong) where I did a \once \override on the clef extent.

It doesn't really matter because I've worked round it fine, but I am left wondering what made it go wrong as I can't think of a mechanism to cause it.

Paul


From: Jean Abou Samra <jean@abou-samra.fr>
To: Paul Hodges <pwh@cassland.org>, Lilypond-User Mailing List <lilypond-user@gnu.org>
Sent: 30/10/2022 22:15
Subject: Re: Change clef size

Le 30/10/2022 à 23:06, Paul Hodges a écrit :
> To get the best match with other pieces being supplied to the same
> publisher I am using the Bravura font instead of Emmentaler.  However,
> the change-clef glyphs in this font are notably smaller than usual,
> and I've been asked to enlarge them.  I know how to use the full size
> clef glyphs, but that's not an acceptable solution, and I cannot find
> any size property attached to clefs which I could tweak.  Am I missing
> something simple, or do I have to find a way to change the glyph in
> the font?




Something like this?

\version "2.22.2"

\layout {
  \context {
    \Score
    \override Clef.font-size =
      #(lambda (grob)
         (let* ((glyph (ly:grob-property grob 'glyph-name))
                (is-change (string-endswith glyph "_change")))
           (if is-change
               0.5 ;; adjust
               0)))
    \override Clef.before-line-breaking =
      #(lambda (grob)
         ;; Necessary to trigger font-size callback.  Otherwise it is
         ;; not triggered because font-size is used via the same property
         ;; alist chain mechanism as markups.
         (ly:grob-property grob 'font-size))
  }
}

{
  \clef "treble"
  c''1
  \clef bass
  c1
}


Best,
Jean


reply via email to

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