lilypond-user
[Top][All Lists]
Advanced

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

Re: Text centralized above a TextSpan


From: David Nalesnik
Subject: Re: Text centralized above a TextSpan
Date: Sat, 19 Sep 2015 09:53:16 -0500

Hi Kieren,

On Sat, Sep 19, 2015 at 9:10 AM, Kieren MacMillan <address@hidden> wrote:
Hi David,

> Sure, no problem.  I added a 'line-Y-offset property which just raises/lowers the line without any reference to the texts.

Perfect! Thanks.
(To my eye, a setting of about 0.0875 is right.)


Ah, OK.  I see what the issue is.  The lines are drawn centered to the baseline.  (Up TextSpanner.thickness and you'll get a vivid demonstration.)

This correction can be automated.  Try running this example:

\relative c' {
  \override TextSpanner.thickness = 5
  \override TextSpanner.line-X-offset = #'(0.5 . 0.5)
  \override TextSpanner.line-Y-offset =
  #(lambda (grob)
     (let* ((line-th (ly:staff-symbol-line-thickness grob))
           (th (* (ly:grob-property grob 'thickness 1.0) line-th)))
       (/ th 2.0)))
  \addTextSpannerText #'("ral" "len" "tan" "do")
  c1\startTextSpan
  d'1\stopTextSpan
}

--David

reply via email to

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