[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make-musicglyph-markup puzzle
From: |
Dan Eble |
Subject: |
Re: make-musicglyph-markup puzzle |
Date: |
Sat, 8 Nov 2014 15:59:51 -0500 |
> On Nov 8, 2014, at 03:48 , David Kastrup <address@hidden> wrote:
>
> Dan Eble <address@hidden> writes:
>
>> I’m having trouble figuring out how to make this function fall back on
>> another time signature style (make-simple-numbered-time-signature-markup
>> fraction) if the requested glyph is not present.
>>
>> (define-public (make-glyph-time-signature-markup style fraction)
>> (make-musicglyph-markup (string-append
>> “timesig.”
>> (symbol->string style)
>> (number->string (car fraction))
>> (number->string (cdr fraction)))))
>
> That's probably not all that easy since a "markup" is just a sequence of
> sort-of function calls producing stencils. And before the calls get
> executed, the fonts in question are not yet known.
>
> So you'll probably rather need to write
>
> (define-markup-command (glyph-time-signature ...
>
> since the code executed in _that_ definition is what is called at
> stencil creation time.
By morning’s light, I realized I had solved this problem before. Behold the
\or markup command:
https://codereview.appspot.com/169290045/
—
Dan