lilypond-user
[Top][All Lists]
Advanced

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

Text spanners line break bound details


From: Kevin Patrick Barry
Subject: Text spanners line break bound details
Date: Sat, 27 Oct 2012 13:42:37 +0100

Dear LilyPond experts,

I would like to draw a text spanner between two notes across a system
break, with the letter 'x' at either end of the spanner.  When I try
to do this, the cloning process creates an extra letter at the end of
the first system and the beginning of the next.  I need to remove
these, but I don't know how.  I tried copying the after-line-break
expression from the difficult tweaks section of the manuals (and
substituting the desired bound-details property and value) but it
didn't have any effect when I tried to call it.

Here is a pared-down version of what I am trying to do:

\version "2.16"

\relative c'' {
  \override TextSpanner #'(bound-details left text) = x
  \override TextSpanner #'(bound-details right text) = x
  c1 \startTextSpan \break
  c \stopTextSpan
}


...and here is the modified scheme expression. I know nothing about
scheme, so maybe my attempt to alter this is ridiculous, but I
appreciate if anyone could look/help:

  #(define (my-callback grob)
   (let* (
          ;; have we been split?
          (orig (ly:grob-original grob))

          ;; if yes, get the split pieces (our siblings)
          (siblings (if (ly:grob? orig)
                        (ly:spanner-broken-into orig)
                        '())))

     (if (and (>= (length siblings) 2)
              (eq? (car (last-pair siblings)) grob))
         (ly:grob-set-property! grob '(bound-details right text) 'x ))))

...\override TextSpanner #'after-line-breaking = #my-callback has no effect.

Thanks in advance,
Kevin



reply via email to

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