2006-01-26 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * input/regression/alignment-vertical-manual-setting.ly (Module):
+ new file.
+
+ * lily/align-interface.cc (align_elements_to_extents): overwrite
+ translations with numbers in alignment-offsets from left bound
+
* scm/page.scm (make-page-stencil): read X-offset from paper-system.
(page-translate-systems): new function: take into account Y-offset.
@itemize @bullet
+@item Alignments of staves may be tuned per system.
+@lilypond[]
+\relative c'' \new StaffGroup <<
+ \new Staff { c1 c }
+ \new Staff { c c }
+ \new Staff {
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((alignment-offsets . (0 -5 -20)))
+ c1 \break
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((alignment-offsets . (0 -15 -20)))
+ c1
+ }
+ >>
+@end lilypond
+
+This feature was sponsored by Trevor Bača.
-@item Systems individual systems may be positioned manually.
+@item Individual systems may be positioned manually,
@lilypond[]
\header{
@item A linebreaking configuration can now be saved as a @file{.ly}
file automatically. This allows vertical alignments to be stretched to
-fit pages in a second formatting run. This feature was sponsored by
-Trevor Bača and Nicolas Sceaux.
+fit pages in a second formatting run. See
+@inputfileref{input/regression/,page-layout-twopass.ly} for an
+example.
+
+This feature was sponsored by Trevor Bača and Nicolas Sceaux.
@item The tie formatting for chords has been further polished. More
cases are handled gracefully, and all scoring parameters may now be
--- /dev/null
+\header {
+
+ texidoc = "Alignments may be changed pre system by setting
+ @code{alignment-offsets} in the @code{line-break-system-details}
+ property"
+
+}
+
+\book {
+ \score {
+ \relative c'' \new StaffGroup <<
+ \new Staff { c1 c c c }
+ \new Staff { c c c c }
+ \new Staff {
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((alignment-offsets . (#f #f -30)))
+ c1 \break
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((alignment-offsets . (0 -5 -20)))
+ c1 \break
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((alignment-offsets . (0 -15 -20)))
+ c1 c
+ }
+ >>
+ }
+}
void
Align_interface::align_elements_to_extents (Grob *me, Axis a)
{
- Real extra_space = 0.0;
Spanner *me_spanner = dynamic_cast<Spanner *> (me);
- if (a == Y_AXIS
- && me_spanner)
- {
-#if 0
- /*
- TODO: messes up for figured bass alignments.
- */
- if (me_spanner->get_bound (LEFT)->break_status_dir () == CENTER)
- me->warning (_ ("vertical alignment called before line-breaking. "
- "Only do cross-staff spanners with PianoStaff."));
-#endif
- SCM details = me_spanner->get_bound (LEFT)->get_property ("line-break-system-details");
- SCM extra_space_handle = scm_assoc (ly_symbol2scm ("alignment-extra-space"), details);
- extra_space = robust_scm2double (scm_is_pair (extra_space_handle)
- ? scm_cdr (extra_space_handle)
- : SCM_EOL,
- extra_space);
- }
+ SCM line_break_details = SCM_EOL;
+ if (a == Y_AXIS && me_spanner)
+ line_break_details = me_spanner->get_bound (LEFT)->get_property ("line-break-system-details");
Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
- DOWN);
+ DOWN);
Interval threshold = robust_scm2interval (me->get_property ("threshold"),
Interval (0, Interval::infinity ()));
Array<Interval> dims;
-
Link_array<Grob> elems;
extract_grob_set (me, "elements", all_grobs);
? me->get_property ("self-alignment-X")
: me->get_property ("self-alignment-Y"));
- Array<Real> translates;
Interval total;
Real where = 0;
+ Real extra_space = 0.0;
+ SCM extra_space_handle = scm_assq (ly_symbol2scm ("alignment-extra-space"), line_break_details);
+ extra_space = robust_scm2double (scm_is_pair (extra_space_handle)
+ ? scm_cdr (extra_space_handle)
+ : SCM_EOL,
+ extra_space);
+
+ Array<Real> translates;
for (int j = 0; j < elems.size (); j++)
{
Real dy = -dims[j][-stacking_dir];
translates.push (where);
}
+ SCM offsets_handle = scm_assq (ly_symbol2scm ("alignment-offsets"), line_break_details);
+ if (scm_is_pair (offsets_handle))
+ {
+ int i = 0;
+
+ for (SCM s = scm_cdr (offsets_handle); scm_is_pair (s) && i < translates.size (); s = scm_cdr (s), i++)
+ {
+ if (scm_is_number (scm_car (s)))
+ translates[i] = scm_to_double (scm_car (s));
+ }
+ }
+
+
Real center_offset = 0.0;
/*