lilypond-user
[Top][All Lists]
Advanced

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

Re: alignment of text in TextSpanner


From: Mats Bengtsson
Subject: Re: alignment of text in TextSpanner
Date: Fri, 23 Sep 2005 10:22:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511



Trevor Bača wrote:
On 9/21/05, Graham Percival <address@hidden> wrote:

On 20-Sep-05, at 11:22 AM, address@hidden wrote:


\relative c'' {
 \override TextSpanner #'edge-text = #'("s.p." . "ord.")
 \override TextSpanner #'bound-padding = #1.0
 \override TextSpanner #'dash-fraction = #'()
 \override TextSpanner #'arrow = ##t

 a8\startTextSpan gis8 a4 b4
 b,4 | g' c\stopTextSpan c
}


The problem is that the second word "ord." is aligned on the basis of
the
letter "d", I suppose, and because of this is misaligned compared to
the
arrow and the first word.

What version of lilypond are you using?  I just tried this in 2.7.8 and
it looks
ok to me... what exactly is the problem with the alignment?


Rendering Libero's example under 2.7.9 aligns the far left edge of
both indications (ie, the far left edge of the "s" in the ponticello
indication, and the far left edge of the "o" in the ordinario
indcation) with the dead center of the notehead.

My preference would be to center both indications over the notes,
somewhat by analogy to dynamics.

It seems that the pair of ...

 \override TextScript #'self-alignment-X = #center
 \override TextScript #'X-offset-callbacks =
#`(,Self_alignment_interface::aligned_on_self)

... should do the trick, but I can't make the indications budge at
all, unfortunately. Perhaps the overrides must be somehow *local* to
the pair of strings assigned to #edge-text, but I don't know the
syntax for sticking in the overrides locally.

Maybe Graham or Mats or Nicolas can explain how to adjust the x-axis
alignment of edge text independently?

Well, the first step is to set properties on the TextSpanner object
instead of the TextScript object if you want to affect text spanners. ;-)

Actually, my guess is that there already is some kind of alignment
to the centers of the note head, since the left end of the texts
is aligned to the note head centers.

One way to change the alignment of the text is to use text markup
commands, for example:
\override TextSpanner #'edge-text = #(cons (markup #:hcenter "s.p.") (markup #:hcenter "ord."))
the problem is that the end points of the line (and the arrow in this
case) will remain at the same point, so the line will strike through
the right end text. Of course, you could increase the bound-padding,
but then the result isn't symmetric any more.

I don't see any really good solution, maybe it's time for a feature
request?

   /Mats
be printed




reply via email to

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