lilypond-user
[Top][All Lists]
Advanced

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

Re: centering text on a measure


From: David Nalesnik
Subject: Re: centering text on a measure
Date: Sat, 10 Sep 2011 18:01:19 -0500

Hi Trevor,

On Sat, Sep 3, 2011 at 1:37 PM, Trevor Daniels <address@hidden> wrote:

David Nalesnik wrote Saturday, September 03, 2011 6:36 PM

   (Unfortunately, if I don't
blank out the default stencil, the text appears on top of the extender line

You can kill the extender line by setting
'dash-period negative, if that helps.

When I do this, the added text ends up on the left side of the modified spanner. (I suppose that killing the extender line also kills the spanner's X-extent?) 
 

Now, I suppose the text's position is dependent on the NoteColumn grobs to
which the spanner is attached.  Would it be possible to reset the attachment
point to another grob?

Not sure I understand.  The spanner start and end
points are defined by the positions of \startTextSpanner
and \stopTextSpanner.  ??

I was hoping to reset the spanner's bounds to align with the barlines; then, if the text is added to the midpoint of the spanner, the text would be centered horizontally on the measure.  (I figured out how to do this using ly:spanner-set-bound! but for some reason, I can only get the left end of the spanner to line up well.) 

Also, I discovered that the TextSpanner approach has an effect on the vertical placement of other grobs, since the blanked-out part of the spanner (at least how I did it) is "still there."

In the meantime, I've generalized the 'extra-offset approach so that you can center a grob of your choice between two others. of which centering between barlines is just one option.  I've attached it in case it's useful to someone, or anyone has any feedback on how to improve it (or what it might be good for!)

So: 

\centerGrobBetween #"TextScript" #'Clef #'TimeSignature #1

would center a piece of text between the clef (right edge) on the left and the time signature (left edge) on the other, assigning 1 to the Y-value of 'extra-offset.

The last example in the file combines it with the MultiMeasureRestText approach that you suggested, offsetting the text to the visual center of the measure.

Thank you for your input/suggestions,
David


Attachment: centerGrobBetween.ly
Description: Binary data


reply via email to

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