Hi Rutger,

On Wed, Oct 12, 2016 at 6:53 AM, Rutger Hofman <rut...@cs.vu.nl> wrote:
> Good afternoon list,
>
> I have been noticing the following bug for a long time. If a TextSpanner
> bound-details.right.text is set, the text may disappear if it is right after
> a line break, and if it runs into some other markup-ish stuff. I am not sure
> whether this may also happen if bound-details.right.padding is *not*
> specified; but quite often, I need to pad the TextSpanner right to keep it
> at the same height as the following text. Try the attachment with
> right.padding = #0 to see what I mean: the right.text is pushed under the
> following markup.

Looks like a bug to me.

>
> This happens with the vanilla TextSpanner, and also with David Nalesnik's
> spanner-id TextSpanner.

That's guaranteed, since mine is just an enhancement of what's there
with the goal of allowing spanner-id.

>
> A workaround can be found by inserting \breaks or \noBreaks, but that is an
> unappealing hack, and not maintenance-friendly.
>
> Is there a 'good' workaround, or a 'good' way to let the TextSpanner behave
> in the way I want?

In this situation, you could use the code for text spanners with inner
texts found here:
https://github.com/davidnalesnik/lilypond-text-spanner-inner-texts

In this case, you could transform your snippet like so:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\include "text-spanner-inner-texts.ily"

spanners = {
  s2*7 |
  s4
  \override TextSpanner.staff-padding = 2
  \textSpannerInnerTexts \lyricmode { "(poco accel." -- "poco rit.)" "a tempo" }
  <>\startTextSpan
  s4 |
  s2 |
  s4. s8 |
  s4 <>\stopTextSpan s4 |
}

notes = \relative c'' {
  \time 2/4
  \repeat unfold 8 { a4 a4 }
  R2*7
  r4 a~ |
  \repeat unfold 6 a2~ |
  a |
}

\layout {
  \context {
    \Score {
      \compressFullBarRests
    }
  }
}

\score {
  <<
    \new Staff <<
      \spanners
      \notes
    >>
  >>
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It doesn't work with spanner-id, though.

Hope this is helpful,
David

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to