Hi,

I want to use TextScript.staff-padding to produce markup elements that are aligned to their baseline. In order to prevent the texts from moving vertically to avoid collisions I used \textLengthOn (or its spelled-out variant):

\version "2.19.82"

test =
#(define-event-function (text)(markup?)
   #{
     -\tweak extra-spacing-width #(cons -0.0 0.4)
     -\tweak extra-spacing-height #(cons -inf.0 +inf.0)
     -\tweak staff-padding 3
     -\markup #text
   #})

\relative {
  c''8 ^\test "foobar" d16 c
  c8 ^\test "foobar" d16 ^\test "John Doe" c
}

However, this does not only push the next notes when there actually is some neighboring text (as in the second beat of the following example) but also when it wouldn't be needed (see atttached image):

Uncommenting the extra-spacing... tweaks will result in the texts moving vertically which is not desired.

Is there another approach to make the following note columns move - but only if there *is* something in the way?

Thanks
Urs

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

Reply via email to