[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stencil questions (adding text and defining line style)
From: |
David Nalesnik |
Subject: |
Re: Stencil questions (adding text and defining line style) |
Date: |
Wed, 21 Sep 2016 16:47:02 -0500 |
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 ^""
}
>
> More generally: how can I learn more about these things? Searching
> lilypond.org seems to only point to snippets and no real explanations.
There's not much to go on.
grob-interpret-markup is mentioned here:
http://lilypond.org/doc/v2.19/Documentation/extending/callback-functions
The function doesn't have a docstring:
#(display (procedure-documentation grob-interpret-markup))
returns #f ...
ly:line-interface::line is listed in the IR (Scheme functions)
Sorry I can't be more helpful.
David