]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/alignment-vertical-spacing.ly: new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 3 Oct 2005 11:30:41 +0000 (11:30 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 3 Oct 2005 11:30:41 +0000 (11:30 +0000)
* python/convertrules.py (conv): add rule.

* ly/music-functions-init.ly: rename outputProperty to overrideProperty

* lily/align-interface.cc (stretch_after_break): new
function. Read fixed-alignment-extra-space property.
(align_elements_to_extents): read alignment-extra-space property.

* scm/page-layout.scm (page-headfoot): annotate headsep and footsep.
(annotate-space-left): new function. Annotate space left on page.
(annotate-y-interval): new function.
(paper-system-annotate-last): new function. Annotate bottom-space.

ChangeLog
Documentation/topdocs/NEWS.tely
VERSION
input/regression/alignment-vertical-spacing.ly [new file with mode: 0644]
lily/align-interface.cc
ly/engraver-init.ly
ly/music-functions-init.ly
python/convertrules.py
scm/page-layout.scm

index 58ab82e285bc775c9a832325c61f38199befb530..2b47d146bf06a09e0775c16f9158b64e3c08902f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2005-10-03  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * input/regression/alignment-vertical-spacing.ly: new file.
+
+       * python/convertrules.py (conv): add rule.
+
+       * ly/music-functions-init.ly: rename outputProperty to overrideProperty
+
+       * lily/align-interface.cc (stretch_after_break): new
+       function. Read fixed-alignment-extra-space property.
+       (align_elements_to_extents): read alignment-extra-space property.
+
+       * lily/lily-guile.cc (robust_scm2dir): new function.
+
        * scm/page-layout.scm (page-headfoot): annotate headsep and footsep.
        (annotate-space-left): new function. Annotate space left on page. 
        (annotate-y-interval): new function.
index 3e60fadbec96e753533aa9cccc199c08bf2fbc1e..4d50e397da3519123a42e1e55d05815bfa6ad649 100644 (file)
@@ -45,6 +45,10 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+@item  
+Vertical alignments of staves may be tuned for individual systems
+easily.
+
 
 @item 
 Vertical spacing for page layout can now be tuned for each system
@@ -58,7 +62,7 @@ individually.  The dimensions that can be tuned can be visualized.
 }
 @end lilypond
 
-This feature was sponsored by Trevor Baca and Nicolas Sceaux.
+This feature was sponsored by Trevor Bača and Nicolas Sceaux.
 
 @item
 The slope of a stem-tremolo may be set manually
@@ -114,7 +118,7 @@ specify tie formatting
 @end lilypond
 
 This improvement has been sponsored by Bertalan Fodor, Jay Hamilton,
-Kieren MacMillan, Steve Doonan, Trevor Baca, and Vicente Solsona
+Kieren MacMillan, Steve Doonan, Trevor Bača, and Vicente Solsona
 Dell¡.
 
 @item
@@ -130,7 +134,7 @@ staff lines, flags and dots, without compromising their shape.
 @end lilypond
 
 This improvement has been sponsored by Bertalan Fodor, Jay Hamilton,
-Kieren MacMillan, Steve Doonan, Trevor Baca, and Vicente Solsona
+Kieren MacMillan, Steve Doonan, Trevor Bača, and Vicente Solsona
 Dell¡.
  
 
@@ -176,7 +180,7 @@ Tuplets can be made to reach the next non-tuplet note by setting the
 }
 @end lilypond  
 
-This feature was sponsored by Trevor Baca. 
+This feature was sponsored by Trevor Bača. 
 
 @item
 When @code{strict-note-spacing} is set, notes are spaced without regard
@@ -187,7 +191,7 @@ for clefs, bar lines, and grace notes. For example,
 \new Staff { c8[ c \clef alto c \grace { c16[ c] } c8 c c]  c32[ c32] }
 @end lilypond
 
-This feature was sponsored by Trevor Baca. 
+This feature was sponsored by Trevor Bača. 
 
 @item
 Beams support the @code{break-overshoot} property, for example
@@ -198,7 +202,7 @@ Beams support the @code{break-overshoot} property, for example
 c2.. c8[ \break c]
 @end lilypond
  
-This feature was sponsored by Trevor Baca. 
+This feature was sponsored by Trevor Bača. 
 
 @item
 Proportional notation is supported.  Notes can be spaced proportional
@@ -213,7 +217,7 @@ to their time-difference by assigning a duration to
 >>
 @end lilypond
 
-This feature was sponsored by Trevor Baca.
+This feature was sponsored by Trevor Bača.
 
 @item 
 Symbol sizes (e.g. accidentals) are disregarded for spacing if
@@ -231,7 +235,7 @@ Symbol sizes (e.g. accidentals) are disregarded for spacing if
 >>
 @end lilypond
 
-This feature was sponsored by Trevor Baca.
+This feature was sponsored by Trevor Bača.
  
 @item
 Endings of broken tuplet brackets can be tuned.  For example, you can
@@ -247,7 +251,7 @@ add arrows to the brackets,
 }
 @end lilypond
 
-This feature was sponsored by Trevor Baca.
+This feature was sponsored by Trevor Bača.
 
 
 @item @textanchor{arrow-glyph}
@@ -262,7 +266,7 @@ Arrow heads were added to the Feta font.
 }
 @end lilypond
 
-These glyphs have been sponsored by Trevor Baca.
+These glyphs have been sponsored by Trevor Bača.
 
 
 @item
@@ -276,8 +280,6 @@ Nested tuplets are automatically positioned,
 }
 @end lilypond
 
-@c This feature was sponsored by Trevor Baca.
-@c where does this fail?
 This feature was sponsored by Trevor Bača.
 
 @item
diff --git a/VERSION b/VERSION
index d5ecc913e8862e23ca9fd3404732fda0c0e6937b..59cd04e448e1546e15c838171ede30f309561ef0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=11
+PATCH_LEVEL=12
 MY_PATCH_LEVEL=
 
diff --git a/input/regression/alignment-vertical-spacing.ly b/input/regression/alignment-vertical-spacing.ly
new file mode 100644 (file)
index 0000000..2fd0c0b
--- /dev/null
@@ -0,0 +1,51 @@
+
+\header {
+
+  texidoc = "By setting properties in @code{NonMusicalPaperColumn}, vertical
+spacing of alignments can be adjusted per system.
+
+By setting @code{alignment-extra-space} or
+@code{fixed-alignment-extra-space} an individual system may be
+stretched vertically.
+
+For technical reasons, @code{overrideProperty} has to be used for
+setting properties on individual object. @code{\override} in a
+@code{\context} block may still be used for global overrides.
+
+"
+
+}
+
+\version "2.7.10"
+
+#(set-global-staff-size 13)
+
+\relative c''
+\new StaffGroup <<
+  \new Staff {
+    c1\break 
+    c\break c\break
+  }
+  \new Staff { c1 c c }
+  \new PianoStaff <<
+    \new Voice  {
+      \set PianoStaff.instrument = #"piano"
+      \set PianoStaff.instr = #"pn"
+      c1_"normal"
+      
+      \overrideProperty
+      #"Score.NonMusicalPaperColumn"
+      #'line-break-system-details
+      #'((fixed-alignment-extra-space . 15))
+      c_"fixed-aligment-extra-space"
+
+      \overrideProperty
+      #"Score.NonMusicalPaperColumn"
+      #'line-break-system-details
+      #'((alignment-extra-space . 15))
+      c_"aligment-extra-space"
+    }
+    { c1 c c }
+  >>
+>>
+
index ce3e9b873173915167ee8d85f3c0a4c1ddfae81e..5394a0dacbe62d5eb4b40cae2bc72778abb6a84c 100644 (file)
@@ -7,7 +7,6 @@
 */
 
 #include "align-interface.hh"
-
 #include "spanner.hh"
 #include "item.hh"
 #include "axis-group-interface.hh"
 #include "hara-kiri-group-spanner.hh"
 #include "grob-array.hh"
 
+/*
+  TODO: for vertical spacing, should also include a rod & spring
+  scheme of sorts into this: the alignment should default to a certain
+  distance between element refpoints, unless bbox force a bigger
+  distance.
+ */
+
 MAKE_SCHEME_CALLBACK (Align_interface, alignment_callback, 2);
 SCM
 Align_interface::alignment_callback (SCM element_smob, SCM axis)
@@ -68,8 +74,7 @@ Align_interface::stretch_after_break (SCM grob)
 
       Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
                                               DOWN);
-  
-      Real delta  = extra_space / elems.size();
+      Real delta  = extra_space / elems.size() * stacking_dir;
       for (int i = 0; i < elems.size (); i++)
        elems[i]->translate_axis (i * delta, Y_AXIS);
     }
@@ -85,11 +90,8 @@ Align_interface::align_to_fixed_distance (Grob *me, Axis a)
 {
   me->set_property ("positioning-done", SCM_BOOL_T);
 
-  SCM d = me->get_property ("stacking-dir");
-
-  Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
-  if (!stacking_dir)
-    stacking_dir = DOWN;
+  Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
+                                          DOWN);
 
   Real dy = robust_scm2double (me->get_property ("forced-distance"), 0.0);
 
@@ -172,11 +174,8 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
   
   me->set_property ("positioning-done", SCM_BOOL_T);
   
-  SCM d = me->get_property ("stacking-dir");
-
-  Direction stacking_dir = scm_is_number (d) ? to_dir (d) : CENTER;
-  if (!stacking_dir)
-    stacking_dir = DOWN;
+  Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
+                                              DOWN);
 
   Interval threshold = robust_scm2interval (me->get_property ("threshold"),
                                            Interval (0, Interval::infinity ()));
@@ -308,9 +307,16 @@ find_fixed_alignment_parent (Grob *g)
   return 0;
 }
 
-ADD_INTERFACE (Align_interface, "align-interface",
+ADD_INTERFACE (Align_interface,
+              "align-interface",
+              
               "Order grobs from top to bottom, left to right, right to left or bottom "
-              "to top.",
+              "to top.  "
+              "For vertical alignments of staves, the @code{break-system-details} of "
+              "the left @internalsref{NonMusicalPaperColumn} may be set to tune vertical spacing "
+              "Set @code{alignment-extra-space} to add extra space for staves. Set "
+              "@code{fixed-alignment-extra-space} to force staves in PianoStaves further apart."
+              ,
               
               /*
                 properties
index 246670fd6850c1d64425d98f6e129cd3effade98..5e1560cb24e8747dfe6b75c85072494c6e37e7e3 100644 (file)
@@ -281,6 +281,8 @@ contained staves are not connected vertically."
   verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
   \override VerticalAlignment #'forced-distance = #12
   \override VerticalAlignment #'self-alignment-Y = #0
+  \override VerticalAlignment #'after-line-breaking-callback
+     = #Align_interface::stretch_after_break
 
   \consists "Vertical_align_engraver"
   \consists "Instrument_name_engraver"
index d14bc4a8b5fd88ccd484954247ca4c76e21506ef..61c033c6bb4640ccc605fd105cb5be3ec167bc9f 100644 (file)
@@ -64,7 +64,7 @@ applyOutput =
                   'origin location
                   'procedure proc))
 
-outputProperty =
+overrideProperty =
 #(def-music-function (parser location name property value)
    (string? symbol? scheme?)
 
index 1816a96e664878a8e243f4961556844c4259fa59..7bd695dd5f6cf407cecc700d7fbb6432ddda5e9d 100644 (file)
@@ -2575,3 +2575,10 @@ def conv (str):
 
 conversions.append (((2, 7, 11), conv,
                     '''\"tabloid\" -> \"11x17\"'''))
+
+def conv (str):
+       str = re.sub(r'outputProperty' , 'overrideProperty', str)
+       return str
+
+conversions.append (((2, 7, 12), conv,
+                    '''outputProperty -> overrideProperty'''))
index 1ddf108b10a5671b894063a142327784432cefa8..64259c0263714dfe44f2b507259c5bea66b4ba60 100644 (file)
@@ -98,7 +98,6 @@
                                    #t)
               #f)))
     
-    (display (list y-extent bottomspace))
     (if arrow
        (set! stencil
              (ly:stencil-add stencil arrow)))
@@ -373,15 +372,15 @@ create offsets.
 
     (map add-system (zip lines offsets))
 
-    
-    (set!
-     page-stencil
-     (annotate-space-left page-stencil layout
-                         (- bottom-edge
-                            (if (ly:stencil? foot)
-                                (interval-length (ly:stencil-extent foot Y))
-                                0))))
-    
+    (if (annotate? layout)
+       (set!
+        page-stencil
+        (annotate-space-left page-stencil layout
+                             (- bottom-edge
+                                (if (ly:stencil? foot)
+                                    (interval-length (ly:stencil-extent foot Y))
+                                    0)))
+        ))
 
     
     (if (and (ly:stencil? foot)