lilypond-user
[Top][All Lists]
Advanced

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

Re: Stencil questions (adding text and defining line style)


From: Urs Liska
Subject: Re: Stencil questions (adding text and defining line style)
Date: Thu, 22 Sep 2016 02:09:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi David,


Am 21.09.2016 um 23:47 schrieb David Nalesnik:
> Hi Urs,
>
> On Wed, Sep 21, 2016 at 1:49 PM, Urs Liska <address@hidden> wrote:
>> Hi all,
>>
>> it may seem unprobable but I don't find the information how I can add
>> some text to my constum-made stencils.
>>
>> Concretely I want to add a text element at a certain position to a
>>   (ly:stencil-add
>> construction
> You would probably create the text stencil using grob-interpret-markup.
> .
>> The other thing I didn't find is: how can I create a dashed (or
>> otherwise styled) line stencil with make-line-stencil?
> You should use ly:line-interface::line (which is available from
> 2.19.27, off the top of my head).
>
> Here's an example with both text and different line styles.
>
> (Even though TextScript doesn't support line-interface, you can still
> tweak line-related properties!)
>
> \version "2.19.46"
>
> #(define (my-stencil grob)
>    (let* ((line (ly:line-interface::line grob 1.5 0 6 0))
>           (text (grob-interpret-markup grob "A"))
>           (stil (apply ly:stencil-add (list line text))))
>      stil))
>
> {
>   \override TextScript.stencil = #my-stencil
>   c''1 -\tweak style #'dashed-line ^""
>   c''1 -\tweak style #'zigzag ^""
> }

Thank you, I could integrate this into my slur editing (helper)
interface. Attached you can see how the handles to the second and third
control points are prolonged by a dashed line. This actually makes
editing easier because the length of this handle (i.e. the distance from
the end points to the neighboring control points) is defined as the
ratio to the baseline. Seeing the "1" unit as a dashed line makes it
much easier to judge what value to try next.

Urs

Attachment: compound-slur-example-sorabij.png
Description: PNG image


reply via email to

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