Showing posts with label halign. Show all posts
Showing posts with label halign. Show all posts

Tuesday, April 22, 2008

LilyPond text spanner text with \halign

Text spanner text can align directly in markup. Use \halign



\new Staff {
c'4
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y =
#center
\override TextSpanner #'bound-details #'left #'text =
\markup { \halign #-1 \italic "vif" \hspace #2 }
c'4 \startTextSpan
c'4
c'4 \stopTextSpan
}


\new Staff {
c'4
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y =
#center
\override TextSpanner #'bound-details #'left #'text =
\markup { \halign #0 \italic "vif" \hspace #2 }
c'4 \startTextSpan
c'4
c'4 \stopTextSpan
}


\new Staff {
c'4
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y =
#center
\override TextSpanner #'bound-details #'left #'text =
\markup { \halign #1 \italic "vif" \hspace #2 }
c'4 \startTextSpan
c'4
c'4 \stopTextSpan
}

The reference point is, in each case, the left edge of the attachment note.