* 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.
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.
@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
}
@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
@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
@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¡.
}
@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
\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
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
>>
@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
>>
@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
}
@end lilypond
-This feature was sponsored by Trevor Baca.
+This feature was sponsored by Trevor Bača.
@item @textanchor{arrow-glyph}
}
@end lilypond
-These glyphs have been sponsored by Trevor Baca.
+These glyphs have been sponsored by Trevor Bača.
@item
}
@end lilypond
-@c This feature was sponsored by Trevor Baca.
-@c where does this fail?
This feature was sponsored by Trevor Bača.
@item
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=7
-PATCH_LEVEL=11
+PATCH_LEVEL=12
MY_PATCH_LEVEL=
--- /dev/null
+
+\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 }
+ >>
+>>
+
*/
#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)
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);
}
{
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);
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 ()));
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
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"
'origin location
'procedure proc))
-outputProperty =
+overrideProperty =
#(def-music-function (parser location name property value)
(string? symbol? scheme?)
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'''))
#t)
#f)))
- (display (list y-extent bottomspace))
(if arrow
(set! stencil
(ly:stencil-add stencil arrow)))
(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)