lilypond-user
[Top][All Lists]
Advanced

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

Force text on line without using \textLengthOn


From: Urs Liska
Subject: Force text on line without using \textLengthOn
Date: Tue, 23 Oct 2018 08:27:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

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

Attachment: document.png
Description: PNG image


reply via email to

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