I think this makes more sense than just using "self-alignment".
It makes these grobs consistent with Lyrics and Dynamics, and
allows users to override their alignment more predictably.
Expected changes in output: TextScripts and CombineTextScripts
will be aligned slightly different when the user sets self-alignment-X
explicitly (parent notehead will be included in alignment, as in Lyrics).
Default placement should remain the same.
I'm also changing one regtest, just to make sure that despite slightly
changed alignment the markups will stick out far enough to the left.
texidoc = "Text and trill spanners are attached to note columns, so
attachments in other staves have no effect on them."
texidoc = "Text and trill spanners are attached to note columns, so
attachments in other staves have no effect on them."
\layout {
ragged-right = ##t
\layout {
ragged-right = ##t
\override TextSpanner.bound-details.left.text = "*"
\override TextSpanner.bound-details.left.text = "*"
- c'16 \startTrillSpan c' c' c' \stopTrillSpan
- c'16 \startTextSpan c' c' c' \stopTextSpan
- }
- \new Staff {
- \override TextScript.self-alignment-X = #RIGHT
- \repeat unfold 2 {c'4 _ \markup { "FAT" } }
- }
+ c'16 \startTrillSpan c' c' c' \stopTrillSpan
+ c'16 \startTextSpan c' c' c' \stopTextSpan
+ }
+ \new Staff {
+ \override TextScript.self-alignment-X = #RIGHT
+ \repeat unfold 2 {c'4 _ \markup { "LONG" } }
+ }
(outside-staff-priority . 450)
(padding . 0.5)
(script-priority . 200)
(outside-staff-priority . 450)
(padding . 0.5)
(script-priority . 200)
+ (self-alignment-X . #f)
(side-axis . ,Y)
(staff-padding . 0.5)
(side-axis . ,Y)
(staff-padding . 0.5)
- ;; todo: add X self alignment?
(stencil . ,ly:text-interface::print)
(stencil . ,ly:text-interface::print)
- (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
+ (X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)
(Y-offset . ,side-position-interface::y-aligned-side)
(Y-extent . ,grob::always-Y-extent-from-stencil)
(meta . ((class . Item)
(interfaces . (font-interface
outside-staff-interface
(Y-offset . ,side-position-interface::y-aligned-side)
(Y-extent . ,grob::always-Y-extent-from-stencil)
(meta . ((class . Item)
(interfaces . (font-interface
outside-staff-interface
+ self-alignment-interface
side-position-interface
text-interface
text-script-interface))))))
side-position-interface
text-interface
text-script-interface))))))
(padding . 0.3)
(script-priority . 200)
(padding . 0.3)
(script-priority . 200)
+ ;; self-alignment cannot be LEFT because of fingering diagrams.
+ (self-alignment-X . #f)
(side-axis . ,Y)
(slur-padding . 0.5)
(staff-padding . 0.5)
(stencil . ,ly:text-interface::print)
(vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
(side-axis . ,Y)
(slur-padding . 0.5)
(staff-padding . 0.5)
(stencil . ,ly:text-interface::print)
(vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
- ;; todo: add X self alignment?
(Y-extent . ,grob::always-Y-extent-from-stencil)
(Y-extent . ,grob::always-Y-extent-from-stencil)
- (X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
+ (X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)
(Y-offset . ,side-position-interface::y-aligned-side)
(meta . ((class . Item)
(interfaces . (font-interface
(Y-offset . ,side-position-interface::y-aligned-side)
(meta . ((class . Item)
(interfaces . (font-interface