]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
authorJoe Neeman <joeneeman@gmail.com>
Wed, 31 Jan 2007 07:38:46 +0000 (09:38 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Wed, 31 Jan 2007 07:38:46 +0000 (09:38 +0200)
Conflicts:

lily/text-spanner-engraver.cc

43 files changed:
Documentation/user/spacing.itely
Documentation/user/templates.itely
input/test/music-box.ly
input/typography-demo.ly
lily/align-interface.cc
lily/axis-group-interface.cc
lily/bar-number-engraver.cc
lily/beam.cc
lily/constrained-breaking.cc
lily/dynamic-engraver.cc
lily/grob.cc
lily/include/align-interface.hh
lily/include/axis-group-interface.hh
lily/include/beam.hh
lily/include/constrained-breaking.hh
lily/include/grob.hh
lily/include/simple-spacer.hh
lily/include/skyline.hh
lily/include/slur.hh
lily/include/stem.hh
lily/include/system.hh
lily/include/volta-bracket.hh
lily/mark-engraver.cc
lily/metronome-engraver.cc
lily/page-breaking.cc
lily/paper-score.cc
lily/prob-scheme.cc
lily/simple-spacer.cc
lily/skyline.cc
lily/slur.cc
lily/stem.cc
lily/system-scheme.cc [new file with mode: 0644]
lily/system.cc
lily/text-engraver.cc
lily/text-spanner-engraver.cc
lily/tie-formatting-problem.cc
lily/trill-spanner-engraver.cc
lily/volta-bracket.cc
lily/volta-engraver.cc
ly/engraver-init.ly
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/layout-page-layout.scm

index a15df5904575ec5cccfe755ca847f45d73489974..377a74ea1392fb6d13a8cf68799b679ed76f08d5 100644 (file)
@@ -484,7 +484,6 @@ staves inside a system.
 
 @menu
 * Vertical spacing inside a system::  
-* Vertical spacing of piano staves::  
 * Vertical spacing between systems::  
 * Controlling spacing of individual systems::  
 * Two-pass vertical spacing::
@@ -538,53 +537,6 @@ Example files: @inputfileref{input/regression/,page-spacing.ly},
 @inputfileref{input/regression/,alignment-vertical-spacing.ly}.
 
 
-@node Vertical spacing of piano staves
-@subsection Vertical spacing of piano staves
-
-The distance between staves of a @internalsref{PianoStaff} cannot be
-computed during formatting.  Rather, to make cross-staff beaming work
-correctly, that distance has to be fixed beforehand.
-
-The distance of staves in a @code{PianoStaff} is set with the
-@code{forced-distance} property of the
-@internalsref{VerticalAlignment} object, created in
-@internalsref{PianoStaff}.
-
-It can be adjusted as follows
-@example
-\new PianoStaff \with @{
-  \override VerticalAlignment #'forced-distance = #7
-@} @{
-  ...
-@}
-@end example
-
-@noindent
-This would bring the staves together at a distance of 7 staff spaces,
-measured from the center line of each staff.
-
-The difference is demonstrated in the following example,
-@lilypond[quote,verbatim]
-\relative c'' <<
-  \new PianoStaff \with {
-    \override VerticalAlignment #'forced-distance = #7
-  } <<
-    \new Staff { c1 }
-    \new Staff { c }
-  >>
-  \new PianoStaff <<
-    \new Staff { c }
-    \new Staff { c }
-  >>
->>
-@end lilypond
-
-
-@seealso
-
-Example files: @inputfileref{input/regression/,alignment-vertical-spacing.ly}.
-
-
 @node Vertical spacing between systems
 @subsection Vertical spacing between systems
 
index bc41f8d617e53657dfbbb0e69c9cdd9192ce2dd2..51c27f4f573c702492c11ef2d807cd6f39324ffd 100644 (file)
@@ -366,7 +366,6 @@ pedal = {
     \context {
       \PianoStaff
       \accepts Dynamics
-      \override VerticalAlignment #'forced-distance = #7
     }
   }
 }
index 9e5b09cdb8e3b23c64309e87c2c42cee75169937..ae4567dbf73ddbe01610aad35b62512973adbe20 100644 (file)
@@ -126,10 +126,6 @@ prelude =
    >>
 
    \layout {
-       \context {
-          \PianoStaff
-          \override VerticalAlignment #'forced-distance = #10
-       }
        line-width = 18.0 \cm
    }
 
index 0ea37e871d18464b4f18ad89b9ab359602596a51..9182285cf1b5dc7b64eaa335974dad928f8e03e5 100644 (file)
@@ -157,10 +157,6 @@ pianoLH =  \relative c'' \repeat volta 2\new Voice {
          \override Stem #'stemlet-length = #0.5
          \override Slur #'height-limit = #1.5
        }
-       \context {
-         \PianoStaff
-         \override VerticalAlignment #'forced-distance = #10
-       }
       }
       
   \midi {
index 09887a7c9fd893581d403f539f87fabc495e3570..68077c817622aa69c77bcda35d434bb808a5a12d 100644 (file)
@@ -36,17 +36,13 @@ Align_interface::calc_positioning_done (SCM smob)
   SCM axis = scm_car (me->get_property ("axes"));
   Axis ax = Axis (scm_to_int (axis));
 
-  SCM force = me->get_property ("forced-distance");
-  if (scm_is_number (force))
-    Align_interface::align_to_fixed_distance (me, ax);
-  else
-    Align_interface::align_elements_to_extents (me, ax);
+  Align_interface::align_elements_to_extents (me, ax);
 
   return SCM_BOOL_T;
 }
 
 /*
-  merge with align-to-extents?
+  TODO: This belongs to the old two-pass spacing. Delete me.
 */
 MAKE_SCHEME_CALLBACK(Align_interface, stretch_after_break, 1)
 SCM
@@ -83,55 +79,6 @@ Align_interface::stretch_after_break (SCM grob)
   return SCM_UNSPECIFIED;
 }
 
-/*
-  merge with align-to-extents?
-*/
-void
-Align_interface::align_to_fixed_distance (Grob *me, Axis a)
-{
-  Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
-                                          DOWN);
-
-  Real dy = robust_scm2double (me->get_property ("forced-distance"), 0.0);
-
-  extract_grob_set (me, "elements", elem_source);
-
-  vector<Grob*> elems (elem_source); // writable..
-
-  Real where = 0;
-
-  Interval v;
-  v.set_empty ();
-  vector<Real> translates;
-
-  for (vsize j = elems.size (); j--;)
-    {
-      /*
-       This is not very elegant, in that we need special support for
-       hara-kiri. Unfortunately, the generic wiring of
-       force_hara_kiri_callback () (extent and offset callback) is
-       such that we might get into a loop if we call extent () or
-       offset () the elements.
-      */
-      if (a == Y_AXIS
-         && Hara_kiri_group_spanner::has_interface (elems[j]))
-       Hara_kiri_group_spanner::consider_suicide (elems[j]);
-
-      if (!elems[j]->is_live ())
-       elems.erase (elems.begin () + j);
-    }
-
-  for (vsize j = 0; j < elems.size (); j++)
-    {
-      where += stacking_dir * dy;
-      translates.push_back (where);
-      v.unite (Interval (where, where));
-    }
-
-  for (vsize i = 0; i < translates.size (); i++)
-    elems[i]->translate_axis (translates[i] - v.center (), a);
-}
-
 /* for each grob, find its upper and lower skylines. If the grob has
    an empty extent, delete it from the list instead. If the extent is
    non-empty but there is no skyline available (or pure is true), just
@@ -168,52 +115,54 @@ get_skylines (Grob *me,
   for (vsize i = elements->size (); i--;)
     {
       Grob *g = (*elements)[i];
-      Interval extent = g->maybe_pure_extent (g, a, pure, start, end);
-      Interval other_extent = pure ? Interval (-infinity_f, infinity_f)
-       : g->extent (common_refpoint, other_axis (a));
-      Box b;
-      b[a] = extent;
-      b[other_axis (a)] = other_extent;
-
-      if (extent.is_empty ())
-       {
-         elements->erase (elements->begin () + i);
-         continue;
-       }
-
       Skyline_pair skylines;
-      if (!pure
-         && Skyline_pair::unsmob (g->get_property ("skylines")))
-       skylines = *Skyline_pair::unsmob (g->get_property ("skylines"));
-      else
-       {
-         if (!pure)
-           programming_error ("no skylines for alignment-child\n");
-         
-         skylines = Skyline_pair (b, 0, other_axis (a));
-       }
 
       /* each skyline is calculated relative to (potentially) a different other_axis
         coordinate. In order to compare the skylines effectively, we need to shift them
         to some absolute reference point */
       if (!pure)
        {
+         Skyline_pair *skys = Skyline_pair::unsmob (g->get_property ("skylines"));
+         if (skys)
+           skylines = *skys;
+         else
+           programming_error ("no skylines for alignment-child\n");
+
          /* this is perhaps an abuse of minimum-?-extent: maybe we should create
             another property? But it seems that the only (current) use of
             minimum-Y-extent is to separate vertically-aligned elements */
          SCM min_extent = g->get_property (a == X_AXIS ? "minimum-X-extent" : "minimum-Y-extent");
+
          if (is_number_pair (min_extent))
            {
+             Box b;
+             Interval other_extent = g->extent (common_refpoint, other_axis (a));
              b[a] = ly_scm2interval (min_extent);
-             skylines.insert (b, 0, other_axis (a));
+             b[other_axis (a)] = other_extent;
+             if (!other_extent.is_empty ())
+               skylines.insert (b, 0, other_axis (a));
            }
 
          Real offset = child_refpoints[i]->relative_coordinate (common_refpoint, other_axis (a));
          skylines.shift (offset);
        }
+      else
+       {
+         assert (a == Y_AXIS);
+         Interval extent = g->pure_height (g, start, end);
+         if (!extent.is_empty ())
+           {
+             Box b;
+             b[a] = extent;
+             b[other_axis (a)] = Interval (-infinity_f, infinity_f);
+             skylines.insert (b, 0, other_axis (a));
+           }
+       }
 
-
-      ret->push_back (skylines);
+      if (skylines.is_empty ())
+       elements->erase (elements->begin () + i);
+      else
+       ret->push_back (skylines);
     }
   reverse (*ret);
 }
@@ -250,6 +199,7 @@ Align_interface::get_extents_aligned_translates (Grob *me,
   get_skylines (me, &elems, a, pure, start, end, &skylines);
 
   Real where = 0;
+  /* TODO: extra-space stuff belongs to two-pass spacing. Delete me */
   SCM extra_space_handle = scm_assq (ly_symbol2scm ("alignment-extra-space"), line_break_details);
   Real extra_space = robust_scm2double (scm_is_pair (extra_space_handle)
                                        ? scm_cdr (extra_space_handle)
@@ -310,6 +260,25 @@ Align_interface::align_elements_to_extents (Grob *me, Axis a)
       all_grobs[j]->translate_axis (translates[j], a);
 }
 
+/* After we have already determined the y-offsets of our children, we may still
+   want to stretch them a little. */
+void
+Align_interface::stretch (Grob *me, Real amount, Axis a)
+{
+  extract_grob_set (me, "elements", elts);
+  Real non_empty_elts = stretchable_children_count (me);
+  Real offset = 0.0;
+  Direction dir = robust_scm2dir (me->get_property ("stacking-dir"), DOWN);
+  for (vsize i = 0; i < elts.size (); i++)
+    {
+      elts[i]->translate_axis (dir * offset, a);
+      if (!elts[i]->extent (me, a).is_empty ()
+         && !to_boolean (elts[i]->get_property ("keep-fixed-while-stretching")))
+       offset += amount / non_empty_elts;
+    }
+  me->flush_extent_cache (Y_AXIS);
+}
+
 Real
 Align_interface::get_pure_child_y_translation (Grob *me, Grob *ch, int start, int end)
 {
@@ -379,22 +348,59 @@ Align_interface::set_ordered (Grob *me)
   ga->set_ordered (true);
 }
 
+int
+Align_interface::stretchable_children_count (Grob const *me)
+{
+  extract_grob_set (me, "elements", elts);
+  int ret = 0;
+
+  /* start at 1: we will never move the first child while stretching */
+  for (vsize i = 1; i < elts.size (); i++)
+    if (!to_boolean (elts[i]->get_property ("keep-fixed-while-stretching"))
+       && !elts[i]->extent (elts[i], Y_AXIS).is_empty ())
+      ret++;
+
+  return ret;
+}
+
+MAKE_SCHEME_CALLBACK (Align_interface, calc_max_stretch, 1)
+SCM
+Align_interface::calc_max_stretch (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Spanner *spanner_me = dynamic_cast<Spanner*> (me);
+  Real ret = 0;
+
+  if (spanner_me && stretchable_children_count (me) > 0)
+    {
+      Paper_column *left = dynamic_cast<Paper_column*> (spanner_me->get_bound (LEFT));
+      Real height = me->extent (me, Y_AXIS).length ();
+      SCM line_break_details = left->get_property ("line-break-system-details");
+      SCM fixed_offsets = scm_assq (ly_symbol2scm ("alignment-offsets"),
+                                   line_break_details);
+
+      /* if there are fixed offsets, we refuse to stretch */
+      if (fixed_offsets != SCM_BOOL_F)
+       ret = 0;
+      else
+       ret = height * height / 80.0; /* why this, exactly? -- jneem */
+    }
+  return scm_from_double (ret);
+}
+
 /*
   Find Y-axis parent of G that has a #'forced-distance property. This
   has the effect of finding the piano-staff given an object in that
   piano staff.
+
+  FIXME: piano staves no longer have forced-distance. The code that
+  relies on this function (in line-spanner) is broken.
 */
 Grob *
 find_fixed_alignment_parent (Grob *g)
 {
-  while (g)
-    {
-      if (scm_is_number (g->get_property ("forced-distance")))
-       return g;
-
-      g = g->get_parent (Y_AXIS);
-    }
-
+  (void) g;
+  programming_error ("deprecated. We don't use forced-distance anymore");
   return 0;
 }
 
@@ -414,7 +420,6 @@ ADD_INTERFACE (Align_interface,
               "align-dir "
               "axes "
               "elements "
-              "forced-distance "
               "padding "
               "positioning-done "
               "stacking-dir "
index 23c30872474d31267c92d093122dd1be452d6a1b..8c3ca97607c7873b789a661ad190ba03b07048cb 100644 (file)
@@ -61,9 +61,12 @@ Axis_group_interface::relative_group_extent (vector<Grob*> const &elts,
   for (vsize i = 0; i < elts.size (); i++)
     {
       Grob *se = elts[i];
-      Interval dims = se->extent (common, a);
-      if (!dims.is_empty ())
-       r.unite (dims);
+      if (!to_boolean (se->get_property ("cross-staff")))
+       {
+         Interval dims = se->extent (common, a);
+         if (!dims.is_empty ())
+           r.unite (dims);
+       }
     }
   return r;
 }
@@ -355,6 +358,12 @@ staff_priority_less (Grob * const &g1, Grob * const &g2)
   else if (priority_1 > priority_2)
     return false;
 
+  /* if neither grob has an outside-staff priority, the ordering will have no
+     effect -- we just need to choose a consistent ordering. We do this to
+     avoid the side-effect of calculating extents. */
+  if (isinf (priority_1))
+    return g1 < g2;
+
   /* if there is no preference in staff priority, choose the left-most one */
   Grob *common = g1->common_refpoint (g2, X_AXIS);
   Real start_1 = g1->extent (common, X_AXIS)[LEFT];
@@ -371,7 +380,8 @@ add_boxes (Grob *me, Grob *x_common, Grob *y_common, vector<Box> *const boxes)
       for (vsize i = 0; i < elements->size (); i++)
        add_boxes (elements->grob (i), x_common, y_common, boxes);
     }
-  else if (!scm_is_number (me->get_property ("outside-staff-priority")))
+  else if (!scm_is_number (me->get_property ("outside-staff-priority"))
+          && !to_boolean (me->get_property ("cross-staff")))
     boxes->push_back (Box (me->extent (x_common, X_AXIS),
                           me->extent (y_common, Y_AXIS)));
 }
@@ -486,6 +496,21 @@ Axis_group_interface::skyline_spacing (Grob *me, vector<Grob*> elements)
   return skylines;
 }
 
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_max_stretch, 1)
+SCM
+Axis_group_interface::calc_max_stretch (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Real ret = 0;
+  extract_grob_set (me, "elements", elts);
+
+  for (vsize i = 0; i < elts.size (); i++)
+    if (Axis_group_interface::has_interface (elts[i]))
+      ret += robust_scm2double (elts[i]->get_property ("max-stretch"), 0.0);
+
+  return scm_from_double (ret);
+}
+
 ADD_INTERFACE (Axis_group_interface,
 
               "An object that groups other layout objects.",
@@ -495,6 +520,8 @@ ADD_INTERFACE (Axis_group_interface,
               "Y-common "
               "axes "
               "elements "
+              "keep-fixed-while-stretching "
+              "max-stretch "
               "pure-Y-common "
               "pure-relevant-elements "
               "skylines "
index ecc83ac756b6bfa315c6f788897d4f1d93bd67d1..9f2396504248255304a885ac9d6773718798dfa6 100644 (file)
@@ -98,12 +98,7 @@ Bar_number_engraver::acknowledge_break_alignment (Grob_info inf)
 void
 Bar_number_engraver::stop_translation_timestep ()
 {
-  if (text_)
-    {
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-      text_ = 0;
-    }
+  text_ = 0;
 }
 
 void
index 28492eaee14f74722599118a5f344ea4621aea3a..18cfae23cd2f58462b524a5387c95ad8871d7b92 100644 (file)
@@ -695,7 +695,7 @@ Beam::consider_auto_knees (Grob *me)
            sets stem directions, a constant shift does not have an
            influence.
          */
-         head_extents += stem->relative_coordinate (common, Y_AXIS);
+         head_extents += stem->pure_relative_y_coordinate (common, 0, INT_MAX);
 
          if (to_dir (stem->get_property_data ("direction")))
            {
@@ -974,7 +974,6 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
   Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
 
   Drul_array<Real> pos = ly_scm2interval (posns);
-  
 
   scale_drul (&pos, Staff_symbol_referencer::staff_space (me));
 
@@ -1421,6 +1420,24 @@ Beam::is_knee (Grob *me)
   return knee;
 }
 
+bool
+Beam::is_cross_staff (Grob *me)
+{
+  extract_grob_set (me, "stems", stems);
+  Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me);
+  for (vsize i = 0; i < stems.size (); i++)
+    if (Staff_symbol_referencer::get_staff_symbol (stems[i]) != staff_symbol)
+      return true;
+  return false;
+}
+
+MAKE_SCHEME_CALLBACK (Beam, cross_staff, 1)
+SCM
+Beam::cross_staff (SCM smob)
+{
+  return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+}
+
 int
 Beam::get_direction_beam_count (Grob *me, Direction d)
 {
index a4f3ac4b57a286d514518cb62bbe448f723fc80e..33426c0b3f3b0ca5bcd24bd5f38263431b9013fe 100644 (file)
@@ -109,16 +109,6 @@ Constrained_breaking::calc_subproblem (vsize start, vsize sys, vsize brk)
   return found_something;
 }
 
-vector<Column_x_positions>
-Constrained_breaking::solve ()
-{
-  if (!systems_)
-    return get_best_solution (0, VPOS);
-
-  resize (systems_);
-  return get_solution(0, VPOS, systems_);
-}
-
 Column_x_positions
 Constrained_breaking::space_line (vsize i, vsize j)
 {
@@ -156,7 +146,7 @@ Constrained_breaking::resize (vsize systems)
 }
 
 vector<Column_x_positions>
-Constrained_breaking::get_solution (vsize start, vsize end, vsize sys_count)
+Constrained_breaking::solve (vsize start, vsize end, vsize sys_count)
 {
   vsize start_brk = starting_breakpoints_[start];
   vsize end_brk = prepare_solution (start, end, sys_count);
@@ -190,16 +180,16 @@ Constrained_breaking::get_solution (vsize start, vsize end, vsize sys_count)
         }
     }
   /* if we get to here, just put everything on one line */
-  warning (_ ("cannot find line breaking that satisfies constraints" ));
+  warning (_ ("cannot find line breaking that satisfies constraints"));
   ret.push_back (space_line (0, end_brk));
   return ret;
 }
 
 vector<Column_x_positions>
-Constrained_breaking::get_best_solution (vsize start, vsize end)
+Constrained_breaking::best_solution (vsize start, vsize end)
 {
-  vsize min_systems =  get_min_systems (start, end);
-  vsize max_systems = get_max_systems (start, end);
+  vsize min_systems =  min_system_count (start, end);
+  vsize max_systems = max_system_count (start, end);
   Real best_demerits = infinity_f;
   vector<Column_x_positions> best_so_far;
 
@@ -211,11 +201,11 @@ Constrained_breaking::get_best_solution (vsize start, vsize end)
       if (dem < best_demerits)
        {
          best_demerits = dem;
-         best_so_far = get_solution (start, end, i);
+         best_so_far = solve (start, end, i);
        }
       else
        {
-         vector<Column_x_positions> cur = get_solution (start, end, i);
+         vector<Column_x_positions> cur = solve (start, end, i);
          bool too_many_lines = true;
          
          for (vsize j = 0; j < cur.size (); j++)
@@ -230,11 +220,11 @@ Constrained_breaking::get_best_solution (vsize start, vsize end)
     }
   if (best_so_far.size ())
     return best_so_far;
-  return get_solution (start, end, max_systems);
+  return solve (start, end, max_systems);
 }
 
 std::vector<Line_details>
-Constrained_breaking::get_details (vsize start, vsize end, vsize sys_count)
+Constrained_breaking::line_details (vsize start, vsize end, vsize sys_count)
 {
   vsize brk = prepare_solution (start, end, sys_count);
   Matrix<Constrained_break_node> const &st = state_[start];
@@ -250,7 +240,7 @@ Constrained_breaking::get_details (vsize start, vsize end, vsize sys_count)
 }
 
 int
-Constrained_breaking::get_min_systems (vsize start, vsize end)
+Constrained_breaking::min_system_count (vsize start, vsize end)
 {
   vsize sys_count;
   vsize brk = prepare_solution (start, end, 1);
@@ -272,7 +262,7 @@ Constrained_breaking::get_min_systems (vsize start, vsize end)
 }
 
 int
-Constrained_breaking::get_max_systems (vsize start, vsize end)
+Constrained_breaking::max_system_count (vsize start, vsize end)
 {
   vsize brk = (end >= start_.size ()) ? breaks_.size () : starting_breakpoints_[end];
   return brk - starting_breakpoints_[start];
@@ -352,7 +342,7 @@ Constrained_breaking::initialize ()
 
          line.force_ = forces[i*breaks_.size () + j];
          if (ragged && last && !isinf (line.force_))
-           line.force_ = 0;
+           line.force_ = (line.force_ < 0) ? infinity_f : 0;
          if (isinf (line.force_))
            break;
 
index fd22a33bf60f557ba73a4355310edda7708a57e1..caef2ce4c4231a8fb0d22893be4160a5504f44a5 100644 (file)
@@ -64,10 +64,7 @@ class Dynamic_engraver : public Engraver
   void typeset_all ();
 
   TRANSLATOR_DECLARATIONS (Dynamic_engraver);
-  DECLARE_ACKNOWLEDGER (accidental);
-  DECLARE_ACKNOWLEDGER (stem_tremolo);
   DECLARE_ACKNOWLEDGER (note_column);
-  DECLARE_ACKNOWLEDGER (slur);
   DECLARE_TRANSLATOR_LISTENER (absolute_dynamic);
   DECLARE_TRANSLATOR_LISTENER (span_dynamic);
 
@@ -395,27 +392,6 @@ Dynamic_engraver::typeset_all ()
     }
 }
 
-void
-Dynamic_engraver::acknowledge_accidental (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
-void
-Dynamic_engraver::acknowledge_stem_tremolo (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
-void
-Dynamic_engraver::acknowledge_slur (Grob_info info)
-{
-  if (line_spanner_)
-    Side_position_interface::add_support (line_spanner_, info.grob ());
-}
-
 void
 Dynamic_engraver::acknowledge_note_column (Grob_info info)
 {
@@ -454,10 +430,7 @@ Dynamic_engraver::acknowledge_note_column (Grob_info info)
     finished_cresc_->set_bound (RIGHT, info.grob ());
 }
 
-ADD_ACKNOWLEDGER (Dynamic_engraver, accidental);
 ADD_ACKNOWLEDGER (Dynamic_engraver, note_column);
-ADD_ACKNOWLEDGER (Dynamic_engraver, slur);
-ADD_ACKNOWLEDGER (Dynamic_engraver, stem_tremolo);
 
 ADD_TRANSLATOR (Dynamic_engraver,
                /* doc */
index e12152821b075a4a194f1f3b3e8facb80eb227be..37d715bf0743f4c2cb31b27970656d0ff40a2a51 100644 (file)
@@ -613,6 +613,7 @@ ADD_INTERFACE (Grob,
               "before-line-breaking "
               "cause "
               "color "
+              "cross-staff "
               "extra-X-extent "
               "extra-Y-extent "
               "extra-offset "
index 4f1d3491419a228a2604d6bf789345d82d8738d8..8b0e9d94190a65bb8f0230c18f6a1c523c32acd3 100644 (file)
@@ -17,11 +17,13 @@ struct Align_interface
 {
   DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
   DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element));
-  static void align_to_fixed_distance (Grob *, Axis a);
+  DECLARE_SCHEME_CALLBACK (calc_max_stretch, (SCM));
+  static void stretch (Grob *, Real amount, Axis a);
   static void align_elements_to_extents (Grob *, Axis a);
   static vector<Real> get_extents_aligned_translates (Grob *, vector<Grob*> const&,
                                                      Axis a,
                                                      bool safe, int start, int end);
+  static int stretchable_children_count (Grob const*);
   static void set_ordered (Grob *);
   static Axis axis (Grob *);
   static void add_element (Grob *, Grob *);
index d752a05bb46189557679157e372dbae27c51b492..2f4f501cee8db919a9f7992f9d030c51f45a1f4e 100644 (file)
@@ -25,6 +25,7 @@ struct Axis_group_interface
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM smob, SCM start, SCM end));
   DECLARE_SCHEME_CALLBACK (calc_skylines, (SCM smob));
   DECLARE_SCHEME_CALLBACK (combine_skylines, (SCM smob));
+  DECLARE_SCHEME_CALLBACK (calc_max_stretch, (SCM smob));
   static Interval relative_group_extent (vector<Grob*> const &list,
                                         Grob *common, Axis);
   static Interval relative_pure_height (Grob *me, vector<Grob*> const &list,
index 412540b076a30ce78cfd5c0be0c5a56ece5fa51c..e505cd670926a193e10fb57dbd1e7452ddb4d135 100644 (file)
@@ -74,6 +74,7 @@ public:
   static Grob *last_normal_stem (Grob *);
   DECLARE_GROB_INTERFACE();
   static void add_stem (Grob *, Grob *);
+  static bool is_cross_staff (Grob *);
   static bool is_knee (Grob *);
   static void set_beaming (Grob *, Beaming_pattern const *);
   static void set_stemlens (Grob *);
@@ -93,6 +94,7 @@ public:
   DECLARE_SCHEME_CALLBACK (calc_normal_stems, (SCM));  
   DECLARE_SCHEME_CALLBACK (calc_concaveness, (SCM));
   DECLARE_SCHEME_CALLBACK (set_stem_lengths, (SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
 
   /* position callbacks */
   DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM, SCM));
index 502e8c234a0fa24b940d6656aa305f3fa57818fb..2478afcacaa0281638fc1deed859a4b0ef7e8155 100644 (file)
@@ -93,17 +93,15 @@ struct Constrained_break_node
 class Constrained_breaking
 {
 public:
-  vector<Column_x_positions> solve ();
+  vector<Column_x_positions> solve (vsize start, vsize end, vsize sys_count);
+  vector<Column_x_positions> best_solution (vsize start, vsize end);
+  vector<Line_details> line_details (vsize start, vsize end, vsize sys_count);
+
   Constrained_breaking (Paper_score *ps);
   Constrained_breaking (Paper_score *ps, vector<vsize> const &start_col_posns);
 
-  vector<Column_x_positions> get_solution (vsize start, vsize end, vsize sys_count);
-  vector<Column_x_positions> get_best_solution (vsize start, vsize end);
-  vector<Line_details> get_details (vsize start, vsize end, vsize sys_count);
-  int get_max_systems (vsize start, vsize end);
-  int get_min_systems (vsize start, vsize end);
-
-  void resize (vsize systems);
+  int max_system_count (vsize start, vsize end);
+  int min_system_count (vsize start, vsize end);
 
 private:
   Paper_score *pscore_;
@@ -127,6 +125,7 @@ private:
   vector<vsize> breaks_;
 
   void initialize ();
+  void resize (vsize systems);
 
   Column_x_positions space_line (vsize start_col, vsize end_col);
   vsize prepare_solution (vsize start, vsize end, vsize sys_count);
index c7ecbbabfdeebad050a178490defc73b8bddb8a2..3b5f19d97e77f8db8af88a799d801f4623450e71 100644 (file)
@@ -80,6 +80,7 @@ public:
   SCM get_property_alist_chain (SCM) const;
   SCM internal_get_property (SCM symbol) const;
   SCM internal_get_property_data (SCM symbol) const;
+  SCM internal_get_non_callback_marker_property_data (SCM symbol) const;
   SCM internal_get_object (SCM symbol) const;
   void internal_set_object (SCM sym, SCM val);
   void internal_del_property (SCM symbol);
index 73790d59638c2fb94848542f463ab7b702795eac..ae3206ac5f70c0c75ae452e27542872e7eb90136 100644 (file)
@@ -49,6 +49,7 @@ public:
   vector<Real> spring_positions () const;
 
   Real force () const;
+  Real force_penalty (bool ragged) const;
   bool fits () const;
 
   DECLARE_SIMPLE_SMOBS (Simple_spacer);
index a4ea033fdbab57af3c2e1c297bd751b9f484397d..bccac37238d1fbb7948027d92829732aeb87676b 100644 (file)
@@ -72,6 +72,7 @@ public:
   Real height (Real airplane) const;
   Real max_height () const;
   void set_minimum_height (Real height);
+  bool is_empty () const;
 };
 
 class Skyline_pair
@@ -90,6 +91,7 @@ public:
   void merge (Skyline_pair const &other);
   Skyline &operator [] (Direction d);
   Skyline const &operator [] (Direction d) const;
+  bool is_empty () const;
 };
 
 #endif /* SKYLINE_HH */
index 20fb7030ce60c134b9b20801e2eea5a4e98cba96..a5ea54e77e69fa0bd784114e4e77ab7facae6708 100644 (file)
@@ -27,6 +27,7 @@ public:
   DECLARE_SCHEME_CALLBACK (height, (SCM));
   DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
   DECLARE_GROB_INTERFACE();
   static Bezier get_curve (Grob *me);
 };
index d022175a7c2fbf2430265dd8cc0f9818d7742e8b..c9b509ce7dc036fa05fac8a0627b3c48864a0baf 100644 (file)
@@ -34,6 +34,7 @@ public:
   static int head_count (Grob *);
   static bool is_invisible (Grob *);
   static bool is_normal_stem (Grob *);
+  static bool is_cross_staff (Grob *);
   static Interval head_positions (Grob *);
   static Real stem_end_position (Grob *);
   static Stencil flag (Grob *);
@@ -53,5 +54,6 @@ public:
   DECLARE_SCHEME_CALLBACK (width, (SCM smob));
   DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
   DECLARE_SCHEME_CALLBACK (height, (SCM));
+  DECLARE_SCHEME_CALLBACK (cross_staff, (SCM));
 };
 #endif
index 48e6875dfb43e4aaa2d1984602a5658a7f928dfc..3a5b39ad4e75104cec0d141affe71dd26c78486b 100644 (file)
@@ -20,7 +20,7 @@ class System : public Spanner
 {
   int rank_;
   Grob_array *all_elements_;
-  Drul_array<Skyline> skylines_;
+  Skyline_pair skylines_;
   void build_skylines ();
   void init_elements ();
   friend class Paper_score;    // ugh.
@@ -29,9 +29,11 @@ class System : public Spanner
 public:
   Paper_score *paper_score () const;
   int get_rank () const;
+  void do_break_substitution_and_fixup_refpoints ();
   void post_processing ();
   SCM get_paper_system ();
   SCM get_paper_systems ();
+  SCM get_broken_system_grobs ();
 
   System (SCM);
   System (System const &);
index 4cc75a6ba5c017d7ba2330feb240e263edec28fd..cc69660a42727f03137c3ad99c09f232cbf7d6cc 100644 (file)
@@ -16,7 +16,6 @@ public:
   DECLARE_GROB_INTERFACE();
   DECLARE_SCHEME_CALLBACK (print, (SCM));
   static void modify_edge_height (Spanner *);
-  static void add_column (Grob *, Grob *col);
   static void add_bar (Grob *me, Item *bar);
 };
 
index 984eb687a096a58bd3902234c952d587704ada98..1f4a0c3f728dc174e451b5f26390955fbe06cd49 100644 (file)
@@ -91,12 +91,7 @@ Mark_engraver::acknowledge_break_alignment (Grob_info inf)
 void
 Mark_engraver::stop_translation_timestep ()
 {
-  if (text_)
-    {
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-      text_ = 0;
-    }
+  text_ = 0;
   mark_ev_ = 0;
 }
 
index a663e573515cf5dbf7f6d0e5fe895b2f079d3f59..897948d88b652a8de29aea4fb368212692ab2a45 100644 (file)
@@ -61,9 +61,6 @@ Metronome_mark_engraver::stop_translation_timestep ()
     {
       Grob *mc = unsmob_grob (get_property ("currentMusicalColumn"));
       text_->set_parent (mc, X_AXIS);
-      text_->set_object ("side-support-elements",
-                        grob_list_to_grob_array (get_property ("stavesFound")));
-
       text_ = 0;
     }
 }
index 76a874d4e38f1aac87035c9c09016234fc8b5f23..83add92ae0ba59492d98539914834d02318e7a19 100644 (file)
@@ -93,8 +93,8 @@ Page_breaking::break_into_pieces (vsize start_break, vsize end_break, Line_divis
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
 
          vector<Column_x_positions> pos = ignore_div
-           ? line_breaking_[sys].get_best_solution (start, end)
-           : line_breaking_[sys].get_solution (start, end, div[i]);
+           ? line_breaking_[sys].best_solution (start, end)
+           : line_breaking_[sys].solve (start, end, div[i]);
          all_[sys].pscore_->root_system ()->break_into_pieces (pos);
        }
     }
@@ -108,8 +108,9 @@ Page_breaking::systems ()
     {
       if (all_[sys].pscore_)
        {
-         SCM lines = all_[sys].pscore_->root_system ()->get_paper_systems ();
-         ret = scm_cons (scm_vector_to_list (lines), ret);
+         all_[sys].pscore_->root_system ()->do_break_substitution_and_fixup_refpoints ();
+         SCM lines = all_[sys].pscore_->root_system ()->get_broken_system_grobs ();
+         ret = scm_cons (lines, ret);
        }
       else
        {
@@ -137,7 +138,7 @@ Page_breaking::line_details (vsize start_break, vsize end_break, Line_division c
          vsize end;
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
 
-         vector<Line_details> details = line_breaking_[sys].get_details (start, end, div[i]);
+         vector<Line_details> details = line_breaking_[sys].line_details (start, end, div[i]);
          ret.insert (ret.end (), details.begin (), details.end ());
        }
       else
@@ -186,7 +187,7 @@ Page_breaking::make_pages (vector<vsize> lines_per_page, SCM systems)
   SCM layout_module = scm_c_resolve_module ("scm layout-page-layout");
   SCM page_module = scm_c_resolve_module ("scm page");
 
-  SCM make_page = scm_c_module_lookup (layout_module, "make-page-from-systems");
+  SCM make_page = scm_c_module_lookup (layout_module, "stretch-and-draw-page");
   SCM page_stencil = scm_c_module_lookup (page_module, "page-stencil");
   make_page = scm_variable_ref (make_page);
   page_stencil = scm_variable_ref (page_stencil);
@@ -358,8 +359,8 @@ Page_breaking::system_count_bounds (vector<Break_position> const &chunks, bool m
          vsize end;
          line_breaker_args (sys, chunks[i], chunks[i+1], &start, &end);
          ret[i] = min
-           ? line_breaking_[sys].get_min_systems (start, end)
-           : line_breaking_[sys].get_max_systems (start, end);
+           ? line_breaking_[sys].min_system_count (start, end)
+           : line_breaking_[sys].max_system_count (start, end);
        }
     }
 
index 4a2eceef12e8e6462da1474efe5f798a537bfdd5..db0258328232ee30cec1a199bd7862c0e51f8f61 100644 (file)
@@ -106,9 +106,9 @@ Paper_score::calc_breaking ()
 
   int system_count = robust_scm2int (layout ()->c_variable ("system-count"), 0);
   if (system_count)
-    algorithm.resize (system_count);
+    return algorithm.solve (0, VPOS, system_count);
 
-  return algorithm.solve ();
+  return algorithm.best_solution (0, VPOS);
 }
 
 void
@@ -152,6 +152,7 @@ Paper_score::get_paper_systems ()
       vector<Column_x_positions> breaking = calc_breaking ();
       system_->break_into_pieces (breaking);
       message (_ ("Drawing systems...") + " ");
+      system_->do_break_substitution_and_fixup_refpoints ();
       paper_systems_ = system_->get_paper_systems ();
     }
   return paper_systems_;
index c22c88bc729ab57a1c189ce10def62f0c730fdd7..a9838bb4353be12aafaea4ef3a315bbf19f477d3 100644 (file)
@@ -7,6 +7,7 @@
 */
 
 #include "prob.hh"
+#include "skyline.hh"
 
 LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
           2, 1, 0, (SCM obj, SCM sym, SCM value),
@@ -83,3 +84,28 @@ LY_DEFINE(ly_paper_system_p, "ly:paper-system?",
 {
   return ly_prob_type_p (obj, ly_symbol2scm ("paper-system"));
 }
+
+LY_DEFINE (ly_paper_system_minimum_distance, "ly:paper-system-minimum-distance",
+          2, 0, 0, (SCM sys1, SCM sys2),
+          "Measure the minimum distance between these two paper-systems "
+          "using their stored skylines if possible and falling back to "
+          "their extents otherwise.")
+{
+  Real ret = 0;
+  Prob *p1 = unsmob_prob (sys1);
+  Prob *p2 = unsmob_prob (sys2);
+  Skyline_pair *sky1 = Skyline_pair::unsmob (p1->get_property ("skylines"));
+  Skyline_pair *sky2 = Skyline_pair::unsmob (p2->get_property ("skylines"));
+
+  if (sky1 && sky2)
+    ret = (*sky1)[DOWN].distance ((*sky2)[UP]);
+  else
+    {
+      Stencil *s1 = unsmob_stencil (p1->get_property ("stencil"));
+      Stencil *s2 = unsmob_stencil (p2->get_property ("stencil"));
+      Interval iv1 = s1->extent (Y_AXIS);
+      Interval iv2 = s2->extent (Y_AXIS);
+      ret = iv2[UP] - iv1[DOWN];
+    }
+  return scm_from_double (ret);
+}
index 5f28644ba6451acd847da9e2036f6f45b61282ec..9200554822b87030d8e0b6c452fd7b3fe5ba859a 100644 (file)
@@ -247,6 +247,20 @@ Simple_spacer::spring_positions () const
   return ret;
 }
 
+Real
+Simple_spacer::force_penalty (bool ragged) const
+{
+  /* If we are ragged-right, we don't want to penalise according to the force,
+     but according to the amount of whitespace that is present after the end
+     of the line. */
+  if (ragged)
+    return max (0.0, line_len_ - configuration_length (0.0));
+
+  /* Use a convex compression penalty. */
+  Real f = force_;
+  return f - (f < 0 ? f*f*f*f*4 : 0);
+}
+
 /****************************************************************/
 
 Spring_description::Spring_description ()
@@ -449,14 +463,7 @@ get_line_forces (vector<Grob*> const &columns,
                }
            }
          spacer.solve ((b == 0) ? line_len - indent : line_len, ragged);
-
-         /* add a (convex) penalty for compression. We do this _only_ in get_line_forces,
-            not get_line_configuration. This is temporary, for backwards compatibility;
-            the old line/page-breaking stuff ignores page breaks when it calculates line
-            breaks, so compression penalties can result in scores (eg. wtk-fugue) blowing
-            up to too many pages. */
-         Real f = spacer.force ();
-         force[b * breaks.size () + c] = f - (f < 0 ? f*f*f*f*4 : 0);
+         force[b * breaks.size () + c] = spacer.force_penalty (ragged);
 
          if (!spacer.fits ())
            {
@@ -513,12 +520,8 @@ get_line_configuration (vector<Grob*> const &columns,
     }
 
   spacer.solve (line_len, ragged);
-  ret.force_ = spacer.force ();
+  ret.force_ = spacer.force_penalty (ragged);
 
-  /*
-    We used to have a penalty for compression, no matter what, but that
-    fucked up wtk1-fugue2 (taking 3 full pages.)
-  */
   ret.config_ = spacer.spring_positions ();
   for (vsize i = 0; i < ret.config_.size (); i++)
     ret.config_[i] += indent;
index b729e5312b15a56471f9f7b58ca542e0db947281..5eedbe25373f39f53da02f671c7b00f6826c5074 100644 (file)
@@ -582,6 +582,12 @@ Skyline::to_points () const
   return out;
 }
 
+bool
+Skyline::is_empty () const
+{
+  return buildings_.empty ();
+}
+
 Skyline_pair::Skyline_pair ()
   : skylines_ (Skyline (DOWN), Skyline (UP))
 {
@@ -625,6 +631,13 @@ Skyline_pair::merge (Skyline_pair const &other)
   skylines_[DOWN].merge (other[DOWN]);
 }
 
+bool
+Skyline_pair::is_empty () const
+{
+  return skylines_[UP].is_empty ()
+    && skylines_[DOWN].is_empty ();
+}
+
 Skyline&
 Skyline_pair::operator [] (Direction d)
 {
index 9ce45e61f59bbd515522d72f59eb306ad25cf6f5..3b26af8bebabb63b83ba8c965cbf5687e45b696d 100644 (file)
@@ -356,6 +356,20 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info,
     e->warning ("Ignoring grob for slur. avoid-slur not set?");
 }
 
+MAKE_SCHEME_CALLBACK (Slur, cross_staff, 1)
+SCM
+Slur::cross_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
+  assert (staff); // delete me
+  extract_grob_set (me, "note-columns", cols);
+
+  for (vsize i = 0; i < cols.size (); i++)
+    if (Staff_symbol_referencer::get_staff_symbol (cols[i]) != staff)
+      return SCM_BOOL_T;
+  return SCM_BOOL_F;
+}
 
 ADD_INTERFACE (Slur,
               
index 857dfb7d49fbbc37aceed0421697de11b9806566..09786b750b5d205d4b7f834b6c6fa69fe507453b 100644 (file)
@@ -239,6 +239,10 @@ Stem::pure_height (SCM smob, SCM start, SCM end)
 
   if (!is_normal_stem (me))
     return ly_interval2scm (iv);
+
+  /* if we are part of a cross-staff beam, return empty */
+  if (get_beam (me) && Beam::is_cross_staff (get_beam (me)))
+    return ly_interval2scm (iv);
   
   Real ss = Staff_symbol_referencer::staff_space (me);
   Real len = scm_to_double (calc_length (smob)) * ss / 2;
@@ -1001,6 +1005,20 @@ Stem::beam_multiplicity (Grob *stem)
   return le;
 }
 
+bool
+Stem::is_cross_staff (Grob *stem)
+{
+  Grob *beam = unsmob_grob (stem->get_object ("beam"));
+  return beam && Beam::is_cross_staff (beam);
+}
+
+MAKE_SCHEME_CALLBACK (Stem, cross_staff, 1)
+SCM
+Stem::cross_staff (SCM smob)
+{
+  return scm_from_bool (is_cross_staff (unsmob_grob (smob)));
+}
+
 /* FIXME:  Too many properties  */
 ADD_INTERFACE (Stem,
               "The stem represent the graphical stem.  "
diff --git a/lily/system-scheme.cc b/lily/system-scheme.cc
new file mode 100644 (file)
index 0000000..d0b7cfc
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+  system-scheme.cc -- implement scheme bindings to System
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2007 Joe Neeman <joeneeman@gmail.com>
+*/
+
+#include "align-interface.hh"
+#include "pointer-group-interface.hh"
+#include "system.hh"
+
+
+LY_DEFINE (ly_system_print, "ly:system-print",
+          1, 0, 0, (SCM system),
+          "Draw the system and return the prob containing its "
+          "stencil.")
+{
+  Grob *me = unsmob_grob (system);
+  System *me_system = dynamic_cast<System*> (me);
+  SCM_ASSERT_TYPE (me, system, SCM_ARG1, __FUNCTION__, "grob");
+
+  return me_system->get_paper_system ();
+}
+
+LY_DEFINE (ly_system_stretch, "ly:system-stretch",
+          2, 0, 0, (SCM system, SCM amount_scm),
+          "Stretch the system vertically by the given amount. "
+          "This must be called before the system is drawn (for example "
+          "with ly:system-print).")
+{
+  Grob *me = unsmob_grob (system);
+  Real amount = robust_scm2double (amount_scm, 0.0);
+  
+  extract_grob_set (me, "elements", elts);
+  for (vsize i = 0; i < elts.size (); i++)
+    if (Align_interface::has_interface (elts[i]))
+      {
+       Align_interface::stretch (elts[i], amount, Y_AXIS);
+       break;
+      }
+  return SCM_UNDEFINED;
+}
index 06ac09e39a224b6b31467474d88e14e54bf1d341..85670f2927b087b7044bdc0e03750f2c799f92a0 100644 (file)
@@ -114,8 +114,8 @@ fixup_refpoints (vector<Grob*> const &grobs)
     grobs[i]->fixup_refpoint ();
 }
 
-SCM
-System::get_paper_systems ()
+void
+System::do_break_substitution_and_fixup_refpoints ()
 {
   for (vsize i = 0; i < all_elements_->size (); i++)
     {
@@ -178,7 +178,20 @@ System::get_paper_systems ()
 
   if (be_verbose_global)
     message (_f ("Element count %d.", count + element_count ()));
+}
+
+SCM
+System::get_broken_system_grobs ()
+{
+  SCM ret = SCM_EOL;
+  for (vsize i = 0; i < broken_intos_.size (); i++)
+    ret = scm_cons (broken_intos_[i]->self_scm (), ret);
+  return scm_reverse (ret);
+}
 
+SCM
+System::get_paper_systems ()
+{
   SCM lines = scm_c_make_vector (broken_intos_.size (), SCM_EOL);
   for (vsize i = 0; i < broken_intos_.size (); i++)
     {
@@ -187,14 +200,6 @@ System::get_paper_systems ()
 
       System *system = dynamic_cast<System *> (broken_intos_[i]);
 
-      system->post_processing ();
-      system->build_skylines ();
-      if (i > 0)
-       {
-         System *prev = dynamic_cast<System*> (broken_intos_[i-1]);
-         Real r = prev->skylines_[DOWN].distance (system->skylines_[UP]);
-         system->set_property ("skyline-distance", scm_from_double (r));
-       }
       scm_vector_set_x (lines, scm_from_int (i),
                        system->get_paper_system ());
 
@@ -334,6 +339,9 @@ System::get_paper_system ()
   SCM exprs = SCM_EOL;
   SCM *tail = &exprs;
 
+  post_processing ();
+  build_skylines ();
+
   vector<Layer_entry> entries;
   for (vsize j = 0; j < all_elements_->size (); j++)
     {
@@ -391,25 +399,18 @@ System::get_paper_system ()
 
   /* information that the page breaker might need */
   Grob *right_bound = this->get_bound (RIGHT);
-  pl->set_property ("skyline-distance", get_property ("skyline-distance"));
+  pl->set_property ("skylines", skylines_.smobbed_copy ());
   pl->set_property ("page-break-permission", right_bound->get_property ("page-break-permission"));
   pl->set_property ("page-turn-permission", right_bound->get_property ("page-turn-permission"));
   pl->set_property ("page-break-penalty", right_bound->get_property ("page-break-penalty"));
   pl->set_property ("page-turn-penalty", right_bound->get_property ("page-turn-penalty"));
 
-  if (!scm_is_pair (pl->get_property ("refpoint-Y-extent")))
-    {
-      Interval staff_refpoints;
-      staff_refpoints.set_empty ();
-      extract_grob_set (this, "spaceable-staves", staves);
-      for (vsize i = 0; i < staves.size (); i++)
-       {
-         Grob *g = staves[i];
-         staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
-       }
-      pl->set_property ("refpoint-Y-extent", ly_interval2scm (staff_refpoints));
-    }
+  Interval staff_refpoints;
+  extract_grob_set (this, "spaceable-staves", staves);
+  for (vsize i = 0; i < staves.size (); i++)
+    staff_refpoints.add_point (staves[i]->relative_coordinate (this, Y_AXIS));
 
+  pl->set_property ("staff-refpoint-extent", ly_interval2scm (staff_refpoints));
   pl->set_property ("system-grob", this->self_scm ()); 
 
   return pl->unprotect ();
index c53cf3e4fd2cc6143bca02b6d9c1f6f4dee2eda4..14f519ec85434ad69c8a8234ba7645846ea37cb1 100644 (file)
@@ -31,9 +31,6 @@ protected:
   void process_acknowledged ();
 
   DECLARE_TRANSLATOR_LISTENER (text_script);
-  DECLARE_ACKNOWLEDGER (stem_tremolo);
-  DECLARE_ACKNOWLEDGER (stem);
-  DECLARE_ACKNOWLEDGER (rhythmic_head);
 };
 
 IMPLEMENT_TRANSLATOR_LISTENER (Text_engraver, text_script);
@@ -43,40 +40,6 @@ Text_engraver::listen_text_script (Stream_event *ev)
   evs_.push_back (ev);
 }
 
-void
-Text_engraver::acknowledge_rhythmic_head (Grob_info inf)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    {
-      Grob *t = texts_[i];
-      Side_position_interface::add_support (t, inf.grob ());
-
-      /*
-       ugh.
-      */
-      if (Side_position_interface::get_axis (t) == X_AXIS
-         && !t->get_parent (Y_AXIS))
-       t->set_parent (inf.grob (), Y_AXIS);
-      else if (Side_position_interface::get_axis (t) == Y_AXIS
-              && !t->get_parent (X_AXIS))
-       t->set_parent (inf.grob (), X_AXIS);
-    }
-}
-
-void
-Text_engraver::acknowledge_stem (Grob_info inf)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    Side_position_interface::add_support (texts_[i], inf.grob ());
-}
-
-void
-Text_engraver::acknowledge_stem_tremolo (Grob_info info)
-{
-  for (vsize i = 0; i < texts_.size (); i++)
-    Side_position_interface::add_support (texts_[i], info.grob ());
-}
-
 void
 Text_engraver::process_acknowledged ()
 {
@@ -119,9 +82,6 @@ Text_engraver::Text_engraver ()
 {
 }
 
-ADD_ACKNOWLEDGER (Text_engraver, stem);
-ADD_ACKNOWLEDGER (Text_engraver, stem_tremolo);
-ADD_ACKNOWLEDGER (Text_engraver, rhythmic_head);
 ADD_TRANSLATOR (Text_engraver,
                /* doc */ "Create text-scripts",
                /* create */ "TextScript",
index 0bdc95efc03c183daf390641d7763d562b460e2e..f7b2576d85043c734d0dc9e55add6526ff762ddc 100644 (file)
@@ -22,7 +22,6 @@ public:
   TRANSLATOR_DECLARATIONS (Text_spanner_engraver);
 protected:
   virtual void finalize ();
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_TRANSLATOR_LISTENER (text_span);
   void stop_translation_timestep ();
   void process_music ();
@@ -82,20 +81,6 @@ Text_spanner_engraver::process_music ()
     }
 }
 
-void
-Text_spanner_engraver::acknowledge_note_column (Grob_info info)
-{
-  Spanner *spans[2] ={span_, finished_};
-  for (int i = 0; i < 2; i++)
-    {
-      if (spans[i])
-       {
-         Side_position_interface::add_support (spans[i], info.grob ());
-         add_bound_item (spans[i], info.grob ());
-       }
-    }
-}
-
 void
 Text_spanner_engraver::typeset_all ()
 {
@@ -136,8 +121,6 @@ Text_spanner_engraver::finalize ()
     }
 }
 
-ADD_ACKNOWLEDGER (Text_spanner_engraver, note_column);
-
 ADD_TRANSLATOR (Text_spanner_engraver,
                /* doc */
                "Create text spanner from an event.",
index 6c7e2a024f091d0f5af9adae860c0a790b1cb80c..38510ae5f07d6a7c93296c4bb81fe147d37bb1bd 100644 (file)
@@ -128,7 +128,12 @@ Tie_formatting_problem::set_column_chord_outline (vector<Item*> bounds,
          x.add_point (stem->relative_coordinate (x_refpoint_, X_AXIS));
          x.widen (staff_space / 20); // ugh.
          Interval y;
-         y.add_point (Stem::stem_end_position (stem) * staff_space * .5);
+         Real stem_end_position =
+           Stem::is_cross_staff (stem)
+           ? get_grob_direction (stem) * infinity_f
+           : Stem::stem_end_position (stem) * staff_space * .5;
+
+         y.add_point (stem_end_position);
 
          Direction stemdir = get_grob_direction (stem);
          y.add_point (Stem::head_positions (stem)[-stemdir]
index 0100e66b52bc6f56082796ebd9f88d942db531ae..d2ef7e1eb8045c836316aa3c838ed8ebe3667374 100644 (file)
@@ -29,7 +29,6 @@ public:
   TRANSLATOR_DECLARATIONS (Trill_spanner_engraver);
 protected:
   virtual void finalize ();
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_TRANSLATOR_LISTENER (trill_span);
   void stop_translation_timestep ();
   void process_music ();
@@ -88,20 +87,6 @@ Trill_spanner_engraver::process_music ()
     }
 }
 
-void
-Trill_spanner_engraver::acknowledge_note_column (Grob_info info)
-{
-  Spanner *spans[2] ={span_, finished_};
-  for (int i = 0; i < 2; i++)
-    {
-      if (spans[i])
-       {
-         Side_position_interface::add_support (spans[i], info.grob ());
-         add_bound_item (spans[i], info.grob ());
-       }
-    }
-}
-
 void
 Trill_spanner_engraver::typeset_all ()
 {
@@ -141,7 +126,6 @@ Trill_spanner_engraver::finalize ()
     }
 }
 
-ADD_ACKNOWLEDGER (Trill_spanner_engraver, note_column);
 ADD_TRANSLATOR (Trill_spanner_engraver,
                /* doc */ "Create trill spanner from an event.",
                /* create */
index 49018d8adb1692f4a3913bde223974ad6813a73f..fb3cb12fc604341342dfe847e77189fbb08bf07e 100644 (file)
@@ -160,12 +160,6 @@ Volta_bracket_interface::add_bar (Grob *me, Item *b)
   add_bound_item (dynamic_cast<Spanner *> (me), b);
 }
 
-void
-Volta_bracket_interface::add_column (Grob *me, Grob *c)
-{
-  Side_position_interface::add_support (me, c);
-}
-
 ADD_INTERFACE (Volta_bracket_interface,
               "Volta bracket with number",
 
index 604c53c573493721796b068f66db084b4ae0c5ba..d7611535a7bb9d9e0d9a5b5a062c5e17ddc0a29e 100644 (file)
@@ -33,7 +33,6 @@ protected:
 
   DECLARE_END_ACKNOWLEDGER (staff_symbol);
   DECLARE_ACKNOWLEDGER (staff_symbol);
-  DECLARE_ACKNOWLEDGER (note_column);
   DECLARE_ACKNOWLEDGER (bar_line);
 
   virtual void finalize ();
@@ -175,13 +174,6 @@ Volta_engraver::process_music ()
     }
 }
 
-void
-Volta_engraver::acknowledge_note_column (Grob_info i)
-{
-  if (volta_span_)
-    Volta_bracket_interface::add_column (volta_span_, i.grob ());
-}
-
 void
 Volta_engraver::acknowledge_bar_line (Grob_info i)
 {
@@ -255,7 +247,6 @@ Volta_engraver::stop_translation_timestep ()
 */
 ADD_ACKNOWLEDGER (Volta_engraver, staff_symbol);
 ADD_END_ACKNOWLEDGER (Volta_engraver, staff_symbol);
-ADD_ACKNOWLEDGER (Volta_engraver, note_column);
 ADD_ACKNOWLEDGER (Volta_engraver, bar_line);
 ADD_TRANSLATOR (Volta_engraver,
                /* doc */ "Make volta brackets.",
index aa78dd538ffb4d7633d1d46174d795da5e1fb1d7..0f8560c8106926083f3518db1cedc1f34bbd1cc5 100644 (file)
@@ -57,7 +57,6 @@
   \consists "Figured_bass_position_engraver"
   \consists "Script_row_engraver"
 
-  \override VerticalAxisGroup #'minimum-Y-extent = #'(-3.5 . 3.5)
   localKeySignature = #'()
   createSpacing = ##t
   ignoreFiguredBassRest = ##t 
@@ -307,11 +306,8 @@ contained staves are not connected vertically."
   \description
   "Just like @code{GrandStaff} but with a forced distance between
     the staves, so cross staff beaming and slurring can be used."
-  
-  \override VerticalAlignment #'forced-distance = #12
-  \override VerticalAlignment #'self-alignment-Y = #0
 
-  \consists "Vertical_align_engraver"
+  \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
   \consists "Instrument_name_engraver"
   
   instrumentName = #'()
@@ -380,6 +376,7 @@ printing of a single line of lyrics.  "
 
   \override VerticalAxisGroup #'remove-first = ##t
   \override VerticalAxisGroup #'remove-empty = ##t
+  \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t
   \override SeparationItem #'padding = #0.2
   \override InstrumentName #'self-alignment-Y = ##f
 
index 7de42c3ae1cd6e5b6a5d45b4522a38180a453080..7cf4d853f8ea18c8329f0586af2c0e7884f4389d 100644 (file)
@@ -166,8 +166,6 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.")
      (font-shape ,symbol? "Select the shape of a font. Choices include @code{upright},
 @code{italic}, @code{caps}.")
      (forced ,boolean? "manually forced accidental")
-     (forced-distance ,ly:dimension? "A fixed distance between object
-reference points in an alignment.")
      (force-hshift ,number? "This specifies a manual shift for notes
 in collisions. The unit is the note head width of the first voice
 note.  This is used by @internalsref{note-collision-interface}.")
@@ -207,6 +205,7 @@ set beam/slur quant to this position, and print the respective scores.")
      (inspect-index ,integer? "If debugging is set,
 set beam/slur configuration to this index, and print the respective scores.")
      (implicit ,boolean? "Is this an implicit bass figure?")
+     (keep-fixed-while-stretching ,boolean? "A grob with this property set to true will be fixed relative to the staff above it when systems are stretched.")
      (keep-inside-line ,boolean? "If set, this column cannot have
 things sticking into the margin.")
      (kern ,ly:dimension? "Amount of extra white space to add. For
@@ -239,6 +238,8 @@ column is the start of a system.")
      (long-text ,markup? "Text markup.  See @usermanref{Text markup}.")
      (max-beam-connect ,integer? "Maximum number of beams to connect
 to beams from this stem. Further beams are typeset as beamlets.")
+     (max-stretch ,number? "The maximum amount that this vertical-axis-group
+can be vertically stretched (for example, in order to better fill a page).")
      (measure-length ,ly:moment? "Length of a
 measure. Used in some spacing situations.")
      (measure-count ,integer? "The number of measures for a
@@ -465,6 +466,7 @@ function is to protect objects from being garbage collected.")
      (arpeggio ,ly:grob? "pointer to arpeggio object.")
      (beam ,ly:grob? "pointer to the beam, if applicable.")
      (bracket ,ly:grob? "the bracket for a  number.")
+     (cross-staff ,boolean? "for a beam or a stem, true if we depend on inter-staff spacing")
      (direction-source ,ly:grob? "in case side-relative-direction is
 set, which grob to get the direction from .")
      (dot ,ly:grob? "reference to Dots object.")
index b7d25131bfee6c4afb5885162ad072105a7fa2cc..eefc76fe1343181c821de59f2792f3e4dc52b0c1 100644 (file)
        (beaming . ,ly:beam::calc-beaming)
        (stencil . ,ly:beam::print)
        (clip-edges . #t)
+       (cross-staff . ,ly:beam::cross-staff)
 
        (details .  ((hint-direction-penalty . 20)))
        ;; TODO: should be in SLT.
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (staff-padding . 0.1)
        (padding . 0.6)
-       (avoid-slur . outside)
        (slur-padding . 0.3)
        (minimum-space . 1.2)
        (direction . ,DOWN)
        (font-series . bold)
        (font-encoding . fetaDynamic)
        (font-shape . italic)
-       (avoid-slur . around)
        (extra-spacing-width . (+inf.0 . -inf.0))
        (outside-staff-priority . 250)
        (meta . ((class . Item)
        (minimum-length . 1.5)
        (height-limit . 2.0)
        (ratio . 0.333)
+       (cross-staff . ,ly:slur::cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (height-limit . 2.0)
        (ratio . 0.25)
        (avoid-slur . inside)
+       (cross-staff . ,ly:slur::cross-staff)
        (meta . ((class . Spanner)
                 (interfaces . (slur-interface))))))
 
        (Y-extent . ,ly:stem::height)
        (length . ,ly:stem::calc-length)
        (thickness . 1.3)
+       (cross-staff . ,ly:stem::cross-staff)
        (details
         . (
            ;; 3.5 (or 3 measured from note head) is standard length
        (X-extent . ,ly:axis-group-interface::width)
        (Y-extent . ,ly:axis-group-interface::height)
        (skylines . ,ly:axis-group-interface::calc-skylines)
+       (max-stretch . ,ly:axis-group-interface::calc-max-stretch)
        (skyline-horizontal-padding . 1.0)
        (meta . ((class . System)
                 (interfaces . (system-interface
        (stacking-dir . -1)
        (padding . 0.5)
        (skylines . ,ly:axis-group-interface::combine-skylines)
+       (max-stretch . ,ly:align-interface::calc-max-stretch)
        (meta . ((class . Spanner)
                 (object-callbacks . ((Y-common . ,ly:axis-group-interface::calc-y-common)))
                 (interfaces . (align-interface
        (Y-offset . ,ly:hara-kiri-group-spanner::force-hara-kiri-callback)
        (Y-extent . ,ly:hara-kiri-group-spanner::y-extent)
        (X-extent . ,ly:axis-group-interface::width)
-       (skylines . ,ly:axis-group-interface::calc-skylines);
+       (skylines . ,ly:axis-group-interface::calc-skylines)
+       (max-stretch . ,ly:axis-group-interface::calc-max-stretch)
        (meta . ((class . Spanner)
                 (object-callbacks . ((X-common . ,ly:axis-group-interface::calc-x-common)))
                 (interfaces . (axis-group-interface
index 264d38054871e015b83f2f0f6e5f09e99d24c1de..02583858e49015e5f027167df5ebe62315d4cc98 100644 (file)
   #:use-module (lily)
   #:export (post-process-pages optimal-page-breaks make-page-from-systems
            page-breaking-wrapper
+           stretchable-line? ; delete me
            ;; utilities for writing custom page breaking functions
             line-height line-next-space line-next-padding
            line-minimum-distance line-ideal-distance
            first-line-position
            line-ideal-relative-position line-minimum-relative-position
-            line-minimum-position-on-page stretchable-line?
+            line-minimum-position-on-page
            page-maximum-space-to-fill page-maximum-space-left space-systems))
 
+; this is for 2-pass spacing. Delete me.
+(define (stretchable-line? line)
+  "Say whether a system can be stretched."
+  (not (or (ly:prob-property? line 'is-title)
+          (let ((system-extent (paper-system-staff-extents line)))
+            (= (interval-start system-extent)
+               (interval-end   system-extent))))))
+
+(define (stretch-and-draw-page paper-book systems page-number ragged last)
+  (define (max-stretch sys)
+    (if (ly:grob? sys)
+       (ly:grob-property sys 'max-stretch)
+       0.0))
+
+  (define (stretchable? sys)
+    (and (ly:grob? sys)
+        (> (max-stretch sys) 0.0)))
+
+  (define (height-estimate sys)
+    (interval-length
+     (if (ly:grob? sys)
+        (ly:grob-property sys 'pure-Y-extent)
+        (paper-system-extent sys Y))))
+
+  (define (print-system sys)
+    (if (ly:grob? sys)
+       (ly:system-print sys)
+       sys))
+
+  (define (set-line-stretch! sorted-lines rest-height space-left)
+    (if (not (null? sorted-lines))
+       (let* ((line (first sorted-lines))
+              (height (height-estimate line))
+              (stretch (min (max-stretch line)
+                            (if (positive? rest-height)
+                                (/ (* height space-left) rest-height)
+                                  0.0))))
+         (if (stretchable? line)
+             (ly:system-stretch line stretch))
+         (set-line-stretch! (cdr sorted-lines)
+                            (if (stretchable? line)
+                                (- rest-height height)
+                                rest-height)
+                            (- space-left stretch)))))
+
+  (let* ((page (make-page paper-book
+                         'page-number page-number
+                         'is-last last))
+        (paper (ly:paper-book-paper paper-book))
+        (height (page-printable-height page))
+        ; there is a certain amount of impreciseness going on here:
+        ; the system heights are estimated, we aren't using skyline distances
+        ; yet, etc. If we overstretch because of underestimation, the result
+        ; is very bad. So we stick in some extra space, just to be sure.
+        (buffer (/ height 10.0))
+        (total-system-height (apply + (map height-estimate systems)))
+        (height-left (- height total-system-height buffer)))
+
+    (if (not ragged)
+       (set-line-stretch! (sort systems
+                                (lambda (s1 s2)
+                                  (< (height-estimate s1)
+                                     (height-estimate s2))))
+                          (apply + (map height-estimate
+                                        (filter stretchable? systems)))
+                          (- (page-printable-height page)
+                             total-system-height)))
+
+    (let* ((lines (map print-system systems))
+          (posns (if (null? lines)
+                     (list)
+                     (let* ((paper (ly:paper-book-paper paper-book))
+                            (space-to-fill (page-maximum-space-to-fill
+                                            page lines paper))
+                            (spacing (space-systems space-to-fill lines ragged paper #f)))
+                       (if (and (> (length lines) 1)
+                                (or (not (car spacing)) (inf? (car spacing))))
+                           (begin
+                             (ly:warning (_ "Can't fit systems on page -- ignoring between-system-padding"))
+                             (cdr (space-systems space-to-fill lines ragged paper #t)))
+                           (cdr spacing))))))
+      (page-set-property! page 'lines lines)
+      (page-set-property! page 'configuration posns)
+      page)))
+
 (define (page-breaking-wrapper paper-book)
   "Compute line and page breaks by calling the page-breaking paper variable,
   then performs the post process function using the page-post-process paper
 ;;;
 ;;; Utilities for computing line distances and positions
 ;;;
+(define (line-extent line)
+  "Return the extent of the line (its lowest and highest Y-coordinates)."
+  (paper-system-extent line Y))
+
 (define (line-height line)
   "Return the system height, that is the length of its vertical extent."
-  (interval-length (paper-system-extent line Y)))
+  (interval-length (line-extent line)))
 
 (define (line-next-space line next-line layout)
   "Return space to use between `line' and `next-line'.
   "Minimum distance between `line' reference position and `next-line'
  reference position. If next-line is #f, return #f."
   (and next-line
-       (let ((non-skyline-distance (- (interval-end (paper-system-extent next-line Y))
-                                     (interval-start (paper-system-extent line Y)))))
-        (max 0 (+ (ly:prob-property next-line 'skyline-distance non-skyline-distance)
-                  (if ignore-padding 0 (line-next-padding line next-line layout)))))))
+       (let ((padding (if ignore-padding
+                         0
+                         (line-next-padding line next-line layout))))
+        (if (or (ly:grob? line) (ly:grob? next-line))
+            (max 0 (+ padding
+                      (- (interval-start (line-extent line))
+                         (interval-end (line-extent next-line)))))
+            (max 0 (+ padding
+                      (ly:paper-system-minimum-distance line next-line)))))))
 
 (define (line-ideal-distance line next-line layout ignore-padding)
   "Ideal distance between `line' reference position and `next-line'
              0.0
            (ly:output-def-lookup layout 'page-top-space))
          (interval-end (paper-system-staff-extents line)))
-       (interval-end (paper-system-extent line Y))))
+       (interval-end (line-extent line))))
 
 (define (line-ideal-relative-position line prev-line layout ignore-padding)
   "Return ideal position of `line', relative to `prev-line' position.
          (position (+ (line-minimum-relative-position line prev-line layout #f)
                       (if prev-line prev-position 0.0)))
          (bottom-position (- position
-                             (interval-start (paper-system-extent line Y)))))
+                             (interval-start (line-extent line)))))
     (and (or (not prev-line)
              (< bottom-position (page-printable-height page)))
          position)))
 
-(define (stretchable-line? line)
-  "Say whether a system can be stretched."
-  (not (or (ly:prob-property? line 'is-title)
-          (let ((system-extent (paper-system-staff-extents line)))
-            (= (interval-start system-extent)
-               (interval-end   system-extent))))))
-
 (define (page-maximum-space-to-fill page lines paper)
   "Return the space between the first line top position and the last line
   bottom position. This constitutes the maximum space to fill on `page'
        (first-line-position (first lines) paper)
        (ly:prob-property last-line
                         'bottom-space 0.0)
-       (- (interval-start (paper-system-extent last-line Y))))))
+       (- (interval-start (line-extent last-line))))))
 
 (define (page-maximum-space-left page)
   (let ((paper (ly:paper-book-paper (page-property page 'paper-book))))
                 (and position
                      (- (page-printable-height page)
                         (- position
-                           (interval-start (paper-system-extent line Y)))))
+                           (interval-start (line-extent line)))))
                 (bottom-position (cdr lines) line position)))))))
 
 ;;;
                   (+ y topskip)))
               (cdr space-result)))))
 
-(define (make-page-from-systems paper-book lines page-number ragged last)
-  "Return a new page, filled with `lines'."
-  (let* ((page (make-page paper-book
-                         'lines lines
-                         'page-number page-number
-                         'is-last last))
-        (posns (if (null? lines)
-                   (list)
-                   (let* ((paper (ly:paper-book-paper paper-book))
-                          (space-to-fill (page-maximum-space-to-fill
-                                           page lines paper))
-                          (spacing (space-systems space-to-fill lines ragged paper #f)))
-                     (if (and (> (length lines) 1)
-                              (or (not (car spacing)) (inf? (car spacing))))
-                         (begin
-                           (ly:warning (_ "Can't fit systems on page -- ignoring between-system-padding"))
-                           (cdr (space-systems space-to-fill lines ragged paper #t)))
-                         (cdr spacing))))))
-    (page-set-property! page 'configuration posns)
-    page))
 
 ;;;
 ;;; Page breaking function