]> git.donarmstrong.com Git - lilypond.git/commitdiff
TextScript, CombineTextScript: use aligned_on_parent
authorJanek Warchoł <lemniskata.bernoullego@gmail.com>
Mon, 23 Jun 2014 21:30:49 +0000 (23:30 +0200)
committerJanek Warchoł <lemniskata.bernoullego@gmail.com>
Sat, 5 Jul 2014 21:09:29 +0000 (23:09 +0200)
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.

input/regression/text-spanner-attachment-alignment.ly
scm/define-grobs.scm

index 098ef131dbe4c417abd352bf69677aa0dc366e64..02f97ff82971b70c61d8f3425f1fe5d428e5c51c 100644 (file)
@@ -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" } }
+  }
 >>
index 2a3faa3491df8ef2baf9c8b9932eac5c3f299bc5..e48781a423080f7fbcbd354449fae2330445c19b 100644 (file)
         (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))))))
         (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