--- /dev/null
+\version "2.13.4"
+
+#(set-default-paper-size "a6")
+
+\book {
+ \header {
+ texidoc = "Padding between titles is honoured by the page breaker.
+This should take up two pages."
+ }
+
+ \paper {
+ between-title-spacing = #'((padding . 300))
+ }
+
+ \markup "00"
+ \markup "01"
+ { c' }
+}
--- /dev/null
+\version "2.13.4"
+
+#(set-default-paper-size "a6")
+
+\book {
+ \header {
+ texidoc = "Padding after titles is honoured by the page breaker.
+This should take up two pages."
+ }
+
+ \paper {
+ after-title-spacing = #'((padding . 300))
+ }
+
+ \markup "00"
+ \markup "01"
+ { c' }
+}
--- /dev/null
+\version "2.13.4"
+
+#(set-default-paper-size "a6")
+
+\book {
+ \header {
+ texidoc = "Padding before titles is honoured by the page breaker.
+This should take up two pages."
+ }
+
+ \paper {
+ before-title-spacing = #'((padding . 300))
+ }
+
+ \markup "00"
+ \markup "01"
+ \score {
+ { c'1 \allowPageTurn }
+ }
+ \markup "02"
+}
*/
between_system_space_ = 0;
between_system_padding_ = 0;
+ before_title_padding_ = 0;
Output_def *l = pscore_->layout ();
SCM spacing_spec = l->c_variable ("between-system-spacing");
+ SCM title_spec = l->c_variable ("before-title-spacing");
SCM page_breaking_spacing_spec = l->c_variable ("page-breaking-between-system-spacing");
Page_layout_problem::read_spacing_spec (spacing_spec,
&between_system_padding_,
Page_layout_problem::read_spacing_spec (page_breaking_spacing_spec,
&between_system_padding_,
ly_symbol2scm ("padding"));
+ Page_layout_problem::read_spacing_spec (title_spec,
+ &before_title_padding_,
+ ly_symbol2scm ("padding"));
Interval first_line = line_dimensions_int (pscore_->layout (), 0);
Interval other_lines = line_dimensions_int (pscore_->layout (), 1);
|| isnan (extent[RIGHT]))
? Interval (0, 0) : extent;
out->padding_ = between_system_padding_;
+ out->title_padding_ = before_title_padding_;
out->space_ = between_system_space_;
out->inverse_hooke_ = extent.length () + between_system_space_;
}
return force * force + (prev_force - force) * (prev_force - force);
}
+Line_details::Line_details (Prob *pb, Output_def *paper)
+{
+ SCM spec = paper->c_variable ("after-title-spacing");
+ SCM title_spec = paper->c_variable ("between-title-spacing");
+ padding_ = 0;
+ title_padding_ = 0;
+ Page_layout_problem::read_spacing_spec (spec, &padding_, ly_symbol2scm ("padding"));
+ Page_layout_problem::read_spacing_spec (title_spec, &title_padding_, ly_symbol2scm ("padding"));
+
+ last_column_ = 0;
+ force_ = 0;
+ extent_ = unsmob_stencil (pb->get_property ("stencil")) ->extent (Y_AXIS);
+ bottom_padding_ = 0;
+ space_ = robust_scm2double (pb->get_property ("next-space"), 1.0);
+ inverse_hooke_ = 1.0;
+ break_permission_ = ly_symbol2scm ("allow");
+ page_permission_ = pb->get_property ("page-break-permission");
+ turn_permission_ = pb->get_property ("page-turn-permission");
+ break_penalty_ = 0;
+ page_penalty_ = robust_scm2double (pb->get_property ("page-break-penalty"), 0);
+ turn_penalty_ = robust_scm2double (pb->get_property ("page-turn-penalty"), 0);
+ title_ = to_boolean (pb->get_property ("is-title"));
+ compressed_lines_count_ = 1;
+ compressed_nontitle_lines_count_ = title_ ? 0 : 1;
+}
Real padding_; /* compulsory space after this system (if we're not
last on a page) */
+ Real title_padding_;
Real bottom_padding_;
Real space_; /* spring length */
Real inverse_hooke_;
last_column_ = 0;
force_ = infinity_f;
padding_ = 0;
+ title_padding_ = 0;
bottom_padding_ = 0;
space_ = 0;
inverse_hooke_ = 1;
compressed_nontitle_lines_count_ = 1;
}
- Line_details (Prob *pb)
- {
- last_column_ = 0;
- force_ = 0;
- extent_ = unsmob_stencil (pb->get_property ("stencil")) ->extent (Y_AXIS);
- padding_ = robust_scm2double (pb->get_property ("next-padding"), 0);
- bottom_padding_ = 0;
- space_ = robust_scm2double (pb->get_property ("next-space"), 1.0);
- inverse_hooke_ = 1.0;
- break_permission_ = ly_symbol2scm ("allow");
- page_permission_ = pb->get_property ("page-break-permission");
- turn_permission_ = pb->get_property ("page-turn-permission");
- break_penalty_ = 0;
- page_penalty_ = robust_scm2double (pb->get_property ("page-break-penalty"), 0);
- turn_penalty_ = robust_scm2double (pb->get_property ("page-turn-penalty"), 0);
- title_ = to_boolean (pb->get_property ("is-title"));
- compressed_lines_count_ = 1;
- compressed_nontitle_lines_count_ = title_ ? 0 : 1;
- }
+ Line_details (Prob *pb, Output_def *paper);
};
/*
bool ragged_right_;
bool ragged_last_;
Real between_system_space_;
+ Real before_title_padding_;
Real between_system_padding_;
/* the (i,j)th entry is the configuration for breaking between
{
Line_details const &old = ret.back ();
Line_details compressed = orig[i];
+ Real padding = orig[i].title_ ? old.title_padding_ : old.padding_;
+
compressed.extent_[DOWN] = old.extent_[DOWN];
- compressed.extent_[UP] = old.extent_[UP] + orig[i].extent_.length () + old.padding_;
+ compressed.extent_[UP] = old.extent_[UP] + orig[i].extent_.length () + padding;
compressed.space_ += old.space_;
compressed.inverse_hooke_ += old.inverse_hooke_;
if (cached_configuration_index_ != configuration_index)
{
cached_configuration_index_ = configuration_index;
- Real padding = 0;
- SCM spacing_spec = book_->paper_->c_variable ("between-system-spacing");
- SCM page_breaking_spacing_spec = book_->paper_->c_variable ("page-breaking-between-system-spacing");
- 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"));
Line_division &div = current_configurations_[configuration_index];
uncompressed_line_details_.clear ();
else
{
assert (div[i] == 1);
- uncompressed_line_details_.push_back (Line_details (system_specs_[sys].prob_));
- uncompressed_line_details_.back ().padding_ =
- robust_scm2double (system_specs_[sys].prob_->get_property ("next-padding"),
- padding);
+ uncompressed_line_details_.push_back (Line_details (system_specs_[sys].prob_, book_->paper_));
}
}
cached_line_details_ = compress_lines (uncompressed_line_details_);
for (vsize i = 0; i < cached_line_details_.size (); i++)
{
Real ext_len = cached_line_details_[i].extent_.length ();
- Real next_rod_height = cur_rod_height + ext_len
- + ((cur_rod_height > 0) ? cached_line_details_[i].padding_: 0);
+ Real padding = 0;
+ if (cur_rod_height > 0)
+ padding = cached_line_details_[i].title_ ?
+ cached_line_details_[i-1].title_padding_ : cached_line_details_[i-1].padding_;
+
+ Real next_rod_height = cur_rod_height + ext_len + padding;
Real next_spring_height = cur_spring_height + cached_line_details_[i].space_;
Real next_height = next_rod_height + (ragged () ? next_spring_height : 0)
+ min_whitespace_at_bottom_of_page (cached_line_details_[i]);
if (!rod_height_)
first_line_ = line;
- rod_height_ += last_line_.padding_;
+ rod_height_ += line.title_ ? last_line_.title_padding_ : last_line_.padding_;
rod_height_ += line.extent_.length ();
spring_len_ += line.space_;
Page_spacing::prepend_system (const Line_details &line)
{
if (rod_height_)
- rod_height_ += line.padding_;
+ rod_height_ += first_line_.title_ ? line.title_padding_ : line.padding_;
else
last_line_ = line;