lilypond-user
[Top][All Lists]
Advanced

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

Re: Finetuning TextSpanner beginning and end positions?


From: Stefano Troncaro
Subject: Re: Finetuning TextSpanner beginning and end positions?
Date: Mon, 6 May 2019 19:22:32 -0300

Hi Rick,

Thank you for your answer. I didn't know that 'bound-details had an X property. It does what I need but it can get tedious to use because I need to specify a number from the start of the spanner (or the system if the spanner is broken into many systems). It takes some trial and error to find the right number and all that work is undone if the spacing changes.

That however led me to writing this function that offsets the 'X value of the 'right-bound-info property, which is the procedure that calculates where the spanner ends. I'm copying it here so it can be used if someone finds it useful or is searching for a similar question in the future.

\version "2.19.83"

ALB-OffsetRBNfo-X =
#(define-scheme-function (n) (number?)
   "Offset the X position at the end of a breakable object that determines its X position
    through the 'right-bound-info procedure."
   (lambda (grob)
     (let* ((bound-right (ly:spanner-bound grob RIGHT))
            (broken-right (= (ly:item-break-dir bound-right) CENTER)))
       (if broken-right
           (let* ((rbnfo (ly:grob-property grob 'right-bound-info #f))
                  (rbnfo (map (lambda (pair)
                                (if (eq? 'X (car pair))
                                    (cons 'X (+ (cdr pair) n))
                                    pair))
                           rbnfo)))
             (ly:grob-set-property! grob 'right-bound-info rbnfo))))))

\relative {
  \override TextSpanner.bound-details.left.text = "sample spanner"
  \override TextSpanner.after-line-breaking = \ALB-OffsetRBNfo-X 15
  c'\startTextSpan d e f | g a g f \break | e f e d | c1\stopTextSpan
}



El lun., 6 may. 2019 a las 17:27, Rick Kimpel (<address@hidden>) escribió:
Stefano,
Have you tried bound-details? I use this for glissandi, and it works well.
http://lilypond.org/doc/v2.19/Documentation/internals/textspanner
Rick


From: lilypond-user <lilypond-user-bounces+rick.kimpel=address@hidden> on behalf of Stefano Troncaro <address@hidden>
Sent: Monday, May 6, 2019 11:50 AM
To: lilypond-user Mailinglist
Subject: Finetuning TextSpanner beginning and end positions?
 
Hello again everyone,

I was expecting to be able to use shorten-pair for this in the same way that is used with Hairpins, but it doesn't seem to work and I can't seem to find what property I need to tweak.

Any pointers?
Thanks for your help,
Stéfano

reply via email to

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