lilypond-user
[Top][All Lists]
Advanced

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

Re: Graphics


From: Jean Abou Samra
Subject: Re: Graphics
Date: Sat, 08 Apr 2023 14:06:02 +0200
User-agent: Evolution 3.46.4 (3.46.4-1.fc37)

Le samedi 08 avril 2023 à 10:58 +0200, Johannes Roeßler a écrit :

now I managed to make my EPS accessable in Lilypond, and I am able to use it as markup.
Now I want to use it to replace a clef. In the snippets there is a way, that creates an alternative stencil and then uses:

 \override Clef.stencil =
      #(lambda (grob)
         (let* ((sz (ly:grob-property grob 'font-size 0))
                (mlt (magstep sz))
                (glyph (ly:grob-property grob 'glyph-name)))
                 (cond
                  ((equal? glyph "clefs.F")  
                     (ly:stencil-scale my-clef (* 1 mlt) (* 1 mlt)))
                  ((equal? glyph "clefs.F_change")  
                    (ly:stencil-scale my-clef (* .8 mlt) (* .8 mlt)))
                  (else (ly:clef::print grob)))))

- but in this case I would need to define the stencil. Is there a way to replace a clef glyph with an EPS?

There is a general technique you can use to replace any grob's stencil using a markup: set the stencil property to ly:text-interface::print, which tells LilyPond to compute the stencil using the markup in the text property, and set that property to what you want.

\layout {
  \override Staff.Clef.stencil = #ly:text-interface::print
  \override Staff.Clef.text = \markup \epsfile #X #10 "/home/jean/repos/lilypond/input/regression/lilypond.eps"
}

HTH,

Jean

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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