Tuesday, April 22, 2008

TextSpanner #'right #'attach-dir

Text spanners attach to the left edge of parent noteheads at both the start and stop of the spanner. This makes sense at the start of the spanner but stops the spanner too early.



\new Staff {
\set Score.proportionalNotationDuration = #(ly:make-moment 1 24)
\override TextSpanner #'style = #'dashed-line
\override TextSpanner #'dash-period = #0.5
\override TextSpanner #'bound-details #'left #'text = \markup { \italic "coperta " }
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #0
\override TextSpanner #'bound-details #'right #'text = \markup { \draw-line #'(0 . -1) }
c'4 \startTextSpan
c'4
c'4
c'4 \stopTextSpan
}

Overriding #'right #'attach-dir to #1 fixes this.



\new Staff {
\set Score.proportionalNotationDuration = #(ly:make-moment 1 24)
\override TextSpanner #'style = #'dashed-line
\override TextSpanner #'dash-period = #0.5
\override TextSpanner #'bound-details #'left #'text = \markup { \italic "coperta " }
\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) }
c'4 \startTextSpan
c'4
c'4
c'4 \stopTextSpan
}

The righthand nib now ends correctly.

No comments: