lilypond-user
[Top][All Lists]
Advanced

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

Re: text spanner to short


From: Trevor Bača
Subject: Re: text spanner to short
Date: Fri, 22 Feb 2008 09:40:01 -0600

On Fri, Feb 22, 2008 at 9:28 AM, Trevor Bača <address@hidden> wrote:
On Fri, Feb 22, 2008 at 6:06 AM, Stefan Thomas <address@hidden> wrote:
Dear lilypond users,
in the below quoted file, the end of the text spanner is a little bit to early, in my opinion. What can I do, to move it a little to the right?
Thanks for Your help
Stefan

mute = {\textSpannerUp \override TextSpanner #'bound-details #'left #'text = \markup {\italic "mute" } \override TextSpanner #'style = #'dashed-line \override TextSpanner #'dash-period = #0.01 \override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -1) } }

 \relative
{ \mute d\startTextSpan e f e d2\stopTextSpan c1 }


Hi Stefan,

There's an #'attach-dir property that's useful for this sort of thing. TextSpanner #'left #'attach-dir defaults to #-1 (meaning the left edge of the parent notehead). This makes sense. Oddly, however, TextSpanner #'right #'attach-dir likewise defaults to #-1. This is weird. It would be better for TextSpanner #'right #'attach-dir to default to #1 (meaning the *RIGHT* edge of the parent notehead).

Fortunately, this is easy to override:

%%% BEGIN %%%

\version "2.11.34"


mute = {
   \textSpannerUp
   \override TextSpanner #'bound-details #'left #'text =
      \markup {\italic "mute" } \override TextSpanner #'style =
         #'dashed-line
   \override TextSpanner #'dash-period = #0.01
   \override TextSpanner #'bound-details #'right #'attach-dir = #1

   \override TextSpanner #'bound-details #'right #'text =
      \markup { \draw-line #'(0 . -1) }
   }

 \relative
{ \mute d\startTextSpan e f e d2\stopTextSpan c1 }

%%% END %%%


Now the spanner nib lines up exactly at the right edge of the final notehead.

Personally, I prefer the spanner to be even a bit longer in the X direction. There's a padding attribute that is helpful here:


%%% BEGIN %%%

\version "2.11.34"


mute = {
   \textSpannerUp
   \override TextSpanner #'bound-details #'left #'text =
      \markup {\italic "mute" } \override TextSpanner #'style =
         #'dashed-line
   \override TextSpanner #'dash-period = #0.01
   \override TextSpanner #'bound-details #'right #'attach-dir = #1

   \override TextSpanner #'bound-details #'right #'text =
      \markup { \draw-line #'(0 . -1) }
   \override TextSpanner #'bound-details #'right #'padding = #-0.5

   }

 \relative
{ \mute d\startTextSpan e f e d2\stopTextSpan c1 }


%%% END %%%


Note that you could make all of your adjusts using only #'right #'padding. But it's better to set #'right #'attach-dir first, and then save #'right #'padding for optical tweaks only.


Oh, and you might like to try setting #'stencil-align-dir-y to #0 to try out centering the spanner vertically relative to the left text.

And you might also try changing "mute" to "mute " (note the extra space) as a way of getting some whitespace after the left text and before the start of the spanner.

So the complete cluster of settings might look like this:


%%% BEGIN %%%

\version "2.11.34"

mute = {
   \textSpannerUp
   \override TextSpanner #'style = #'dashed-line
   \override TextSpanner #'dash-period = #0.01
   \override TextSpanner #'bound-details #'left #'text =
      \markup {\italic "mute " }
   \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #0
   \override TextSpanner #'bound-details #'right #'attach-dir = #1
   \override TextSpanner #'bound-details #'right #'text =
      \markup { \draw-line #'(0 . -1) }
   \override TextSpanner #'bound-details #'right #'padding = #-0.5
   }

 \relative
{ \mute d\startTextSpan e f e d2\stopTextSpan c1 }

%%% END %%%






--
Trevor Bača
address@hidden
reply via email to

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