lilypond-user
[Top][All Lists]
Advanced

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

Re: TextSpanner and line thickness


From: Neil Puttock
Subject: Re: TextSpanner and line thickness
Date: Sun, 1 Aug 2010 20:41:04 +0100

On 1 August 2010 09:40, Mike Solomon <address@hidden> wrote:

>    I'm working on a piece where the thickness of a text spanner represents
> playing intensity, and in writing it, I'm realizing that the thickness of
> text spanners has an effect on their X extents (see the minimal example
> below).  This is due (I think) to the round-cap line ending.  I would gladly
> use non-rounded lines so that they stop consistently at the same horizontal
> spot independent of their thickness.  Before I dive into my git repository
> to cobble together a solution, if any of you know a way to get around this
> problem by standardizing the horizontal lengths of text spanners, I'd
> appreciate it!

I think the simplest way around this is to emend the drawing routine
to remove the round-cap ending.

Unfortunately, the extent box assumes the line's rounded, so there's a
hard-coded widening in line-interface.cc.  Your best bet is to change
the default X-extent callback to remove it:

\override TextSpanner #'X-extent =
#(lambda (grob)
   (let ((thick (* (ly:grob-property grob 'thickness)
                   (ly:staff-symbol-line-thickness grob)))
         (ext (ly:grob::stencil-width grob)))
     (interval-widen ext (/ thick -2))))

Cheers,
Neil



reply via email to

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