-
- Paper_system *pl = new Paper_system (sys_stencil, false);
- pl->staff_refpoints_ = staff_refpoints;
- Item * break_point =this->get_bound(LEFT);
- pl->penalty_ =
- robust_scm2double (break_point->get_property ("page-penalty"), 0.0);
-
- return scm_gc_unprotect_object (pl->self_scm ());
+ if (debug_skylines)
+ {
+ sys_stencil.add_stencil (points_to_line_stencil (skylines_[UP].to_points ()).in_color (255, 0, 0));
+ sys_stencil.add_stencil (points_to_line_stencil (skylines_[DOWN].to_points ()).in_color (0, 255, 0));
+ }
+
+ Grob *left_bound = this->get_bound (LEFT);
+ SCM prop_init = left_bound->get_property ("line-break-system-details");
+ Prob *pl = make_paper_system (prop_init);
+ paper_system_set_stencil (pl, sys_stencil);
+
+ /* 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 ("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));
+ }
+
+ pl->set_property ("system-grob", this->self_scm ());
+
+ return pl->unprotect ();