From: Janek WarchoĊ‚ Date: Mon, 23 Jun 2014 21:30:49 +0000 (+0200) Subject: TextScript, CombineTextScript: use aligned_on_parent X-Git-Tag: release/2.19.10-1~20^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6f3f8f0fceed3b318c2572337e7dca83e4a11f6c;p=lilypond.git TextScript, CombineTextScript: use aligned_on_parent 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. --- diff --git a/input/regression/text-spanner-attachment-alignment.ly b/input/regression/text-spanner-attachment-alignment.ly index 098ef131db..02f97ff829 100644 --- a/input/regression/text-spanner-attachment-alignment.ly +++ b/input/regression/text-spanner-attachment-alignment.ly @@ -1,23 +1,21 @@ \header { - texidoc = "Text and trill spanners are attached to note columns, so attachments in other staves have no effect on them." - - } +} \layout { ragged-right = ##t - } +} \version "2.17.6" << - \new Staff { + \new Staff { \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" } } + } >> diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 2a3faa3491..e48781a423 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -626,16 +626,17 @@ (outside-staff-priority . 450) (padding . 0.5) (script-priority . 200) + (self-alignment-X . #f) (side-axis . ,Y) (staff-padding . 0.5) - ;; todo: add X self alignment? (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 + self-alignment-interface side-position-interface text-interface text-script-interface)))))) @@ -2358,14 +2359,15 @@ (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) - ;; todo: add X self alignment? (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