[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Custom glyph depending on the 'glyph-name
From: |
David Kastrup |
Subject: |
Re: Custom glyph depending on the 'glyph-name |
Date: |
Wed, 17 Aug 2016 18:33:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Pierre Perol-Schneider <address@hidden> writes:
> Hi,
>
> I'd like to customize the clefs depending on their glyph-name:
>
> %%
> \version "2.19.46"
>
> my-clef-G = \markup "G"
>
> my-clef-F = \markup "F"
>
> \score {
> \new PianoStaff <<
> \new Staff { c' }
> \new Staff { \clef F c' }
> >>
> \layout {
> \context {
> \Score
> \override Clef.stencil =
> #(lambda (grob)
> (let ((glyph (ly:grob-property grob 'glyph-name)))
> (case glyph
> (("clefs.G") (grob-interpret-markup grob my-clef-G))
> (("clefs.F") (grob-interpret-markup grob my-clef-F))
> (else (ly:clef::print grob)))))
> }
> }
> }
> %%
>
> But nothing happend.
> Any idea?
"case" does not work on strings because it compares using eqv? and
(eqv? "x" "x") -> #f
--
David Kastrup