lilypond-user
[Top][All Lists]
Advanced

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

Re: accessing the text stencil of a TextSpanner


From: Urs Liska
Subject: Re: accessing the text stencil of a TextSpanner
Date: Mon, 03 Feb 2014 10:54:59 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 03.02.2014 10:43, schrieb Urs Liska:
It is possible to access/reshape a Metronome Mark like this:

\override MetronomeMark #'stencil =
     #(lambda (grob)
        (ly:stencil-scale (lyric-text::print grob) 0.78 1))

(which will squeeze the font to a width of 0.78 (which surprisingly
matches the font of the printed model very well).

Now I need to make TextSpanners identical to the MetronomeMark, so I
would need to apply the same scaling to
     TextSpanner.bound-details.left.text

but I have no idea how to achieve that.

\once \override TextSpanner.bound-details.stencil =
      #(lambda (grob)
        (ly:stencil-scale (lyric-text::print grob) 0.78 1))

doesn't have any effect.

Any help?

Urs


Hm, I found a partial solution myself:

\once \override TextSpanner.stencil =
     #(lambda (grob)
       (ly:stencil-scale (ly:line-spanner::print grob) 0.78 1))

seems to do what I want with the bound-details.left text.

However, when I have used
    \once \override TextSpanner.bound-details.left-broken.text = ""
to suppress the spanner text after line breaks, I get
    programming error: Improbable offset for stencil: -inf staff space
    Setting to zero.
(with 2.18 as well as with 2.19)

This is probably due to the fact that there isn't any stencil anymore to scale?
The output is correct, but I would like to get rid of the error message.

Any ideas?
Urs



reply via email to

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