X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fconstrained-breaking.cc;h=8fb24f1eab90f668b40e7de5eecd034547bf91e3;hb=794dcbdb52faf4292036cd1b0270a956cf4316a3;hp=3a56aa47541190b7bd2f6e2669d5292f7e4d1fac;hpb=8cab78caa0db1ba14f2e52e4c1ddbb541ea0e5cb;p=lilypond.git diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc index 3a56aa4754..8fb24f1eab 100644 --- a/lily/constrained-breaking.cc +++ b/lily/constrained-breaking.cc @@ -12,6 +12,7 @@ #include "international.hh" #include "main.hh" #include "output-def.hh" +#include "page-layout-problem.hh" #include "paper-column.hh" #include "paper-score.hh" #include "simple-spacer.hh" @@ -21,7 +22,7 @@ /* We use the following optimal substructure. Let W (A) be our weight function. - Let A_{k, n} = (a_{k, n,1}, ... a_{k, n, k}) be the optimal set of line breaks + Let A_{k, n} = (a_{k, n, 1}, ... a_{k, n, k}) be the optimal set of line breaks for k systems and n potential breakpoints. a_{k, n, k} = n (it is the end of the piece) @@ -333,11 +334,15 @@ Constrained_breaking::initialize () Output_def *l = pscore_->layout (); System *sys = pscore_->root_system (); - Real space = robust_scm2double (l->c_variable ("ideal-system-space"), 0); - SCM padding_scm = l->c_variable ("page-breaking-between-system-padding"); - if (!scm_is_number (padding_scm)) - padding_scm = l->c_variable ("between-system-padding"); - Real padding = robust_scm2double (padding_scm, 0.0); + + // TODO: add support for minimum-distance and stretchability here and + // to the page-breaker. + SCM spacing_spec = l->c_variable ("between-system-spacing"); + SCM page_breaking_spacing_spec = l->c_variable ("page-breaking-between-system-spacing"); + Real space = 0; + Real padding = 0; + Page_layout_problem::read_spacing_spec (spacing_spec, &padding, ly_symbol2scm ("padding")); + Page_layout_problem::read_spacing_spec (page_breaking_spacing_spec, &padding, ly_symbol2scm ("padding")); Interval first_line = line_dimensions_int (pscore_->layout (), 0); Interval other_lines = line_dimensions_int (pscore_->layout (), 1); @@ -367,6 +372,7 @@ Constrained_breaking::initialize () break; Grob *c = all_[breaks_[j]]; + line.last_column_ = c; line.break_penalty_ = robust_scm2double (c->get_property ("line-break-penalty"), 0); line.page_penalty_ = robust_scm2double (c->get_property ("page-break-penalty"), 0); line.turn_penalty_ = robust_scm2double (c->get_property ("page-turn-penalty"), 0);