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 <u...@openlilylib.org> 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.

lilypond-user mailing list

Reply via email to