lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allow 'staff-padding to work with MeasureCounter (issue 312580043 by add


From: david . nalesnik
Subject: Allow 'staff-padding to work with MeasureCounter (issue 312580043 by address@hidden)
Date: Tue, 28 Mar 2017 16:34:03 -0700

Reviewers: ,

Message:
Please review.  Thanks!


Description:
Allow 'staff-padding to work with MeasureCounter

 -Set 'Y-offset in the grob description to the appropriate
callback.  (This is required for the default setting of
'staff-padding to have any effect.)

 -Provide a doc snippet to illustrate vertical alignment.

Please review this at https://codereview.appspot.com/312580043/

Affected files (+41, -0 lines):
  A Documentation/snippets/new/measure-counter-vertical-alignment.ly
  M scm/define-grobs.scm


Index: Documentation/snippets/new/measure-counter-vertical-alignment.ly
diff --git a/Documentation/snippets/new/measure-counter-vertical-alignment.ly b/Documentation/snippets/new/measure-counter-vertical-alignment.ly
new file mode 100644
index 0000000000000000000000000000000000000000..6c20f509f394558fbc696e3c03eb206f32064e4f
--- /dev/null
+++ b/Documentation/snippets/new/measure-counter-vertical-alignment.ly
@@ -0,0 +1,40 @@
+\version "2.19.59"
+
+\header {
+  lsrtags = "repeats"
+
+  texidoc = "
+The @code{staff-padding} property may be used to align
address@hidden objects vertically.  A group of such objects
+are aligned when @code{staff-padding} has a value greater or equal to
+the distance of the object furthest from the staff.  In the following
+example @code{staff-padding} is increased from the default (shown first)
+to align the first two numbers and finally all three.
+
+"
+  doctitle = "Measure counter vertical alignment"
+}
+
+music = {
+  \startMeasureCount
+  c''2 c''
+  c'''2 c'''
+  c''''2 c''''
+  \bar "||"
+  \stopMeasureCount
+}
+
+{
+  \music
+  \override Staff.MeasureCounter.staff-padding = 4
+  \music
+  \override Staff.MeasureCounter.staff-padding = 8
+  \music
+}
+
+\layout {
+  \context {
+    \Staff
+    \consists #Measure_counter_engraver
+  }
+}
Index: scm/define-grobs.scm
diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
index 45cac04bd3d65b1146beec8acdf89b42bcf8be7c..cdea705c4d6f186122ed164e84b72f0a7079359f 100644
--- a/scm/define-grobs.scm
+++ b/scm/define-grobs.scm
@@ -1455,6 +1455,7 @@
         (side-axis . ,Y)
         (staff-padding . 0.5)
         (stencil . ,measure-counter-stencil)
+        (Y-offset . ,side-position-interface::y-aligned-side)
         (meta . ((class . Spanner)
                  (interfaces . (font-interface
                                 measure-counter-interface





reply via email to

[Prev in Thread] Current Thread [Next in Thread]