lilypond-user
[Top][All Lists]
Advanced

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

Re: TextSpanner to end of bar / end of piece


From: Lukas-Fabian Moser
Subject: Re: TextSpanner to end of bar / end of piece
Date: Mon, 24 May 2021 17:25:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

Hi Harm,

So this seems to mean that right-broken.text should be changed by a hook that determines if we are at a line break. I'llt try to see if I can figure out how to do this.

It seems to suffice to copy right.text into right-broken.text only for the last bit of a broken TextSpanner:

   \override TextSpanner.after-line-breaking =
    #(lambda (grob)
       ; Copies bound-details.right settings to bound-details.right-broken
       ; for the last part of a broken spanner.
       ; This is needed because, if to-barline = ##t and the last part ends
       ; at a line break, the values from right-broken are used.
       (let*
        ((orig (ly:grob-original grob))
         (siblings (if (ly:grob? orig)
                       (ly:spanner-broken-into orig)
                       '())))
        (if (not (null? siblings))
            (if (eq? grob (car (last-pair siblings)))
                (ly:grob-set-nested-property!
                 grob
                 '(bound-details right-broken)
                 (ly:assoc-get 'right (ly:grob-property grob 'bound-details)))))))



Thanks for the hint, Harm!

Lukas

Attachment: TextSpannerNew.ly
Description: Text Data


reply via email to

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