From: Joe Neeman Date: Sun, 25 Nov 2007 21:14:28 +0000 (+1100) Subject: Add the blank-after-score-page-force for finer granularity. X-Git-Tag: release/2.11.36-1~65^2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=57676f9e8170d821cbca436c5db6c4c86c1f5fe9;p=lilypond.git Add the blank-after-score-page-force for finer granularity. Look up the blank-X-page-force variables from a layout block if possible. --- diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index b14c780ba5..150e09fa9a 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -100,6 +100,7 @@ public: bool ragged () const; bool ragged_last () const; bool is_last () const; + bool ends_score () const; Real page_height (int page_number, bool last) const; Real page_top_space () const; vsize system_count () const; diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index d3a2762bbb..1ae769e82d 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -713,7 +713,19 @@ Page_breaking::space_systems_on_n_pages (vsize configuration, vsize n, vsize fir Real Page_breaking::blank_page_penalty () const { - SCM penalty_sym = is_last () ? ly_symbol2scm ("blank-last-page-force") : ly_symbol2scm ("blank-page-force"); + SCM penalty_sym; + + if (is_last ()) + penalty_sym = ly_symbol2scm ("blank-last-page-force"); + else if (ends_score ()) + penalty_sym = ly_symbol2scm ("blank-after-score-page-force"); + else + penalty_sym = ly_symbol2scm ("blank-page-force"); + + Break_position const &pos = breaks_[current_end_breakpoint_]; + if (Paper_score *ps = system_specs_[pos.system_spec_index_].pscore_) + return robust_scm2double (ps->layout ()->lookup_variable (penalty_sym), 0.0); + return robust_scm2double (book_->paper_->lookup_variable (penalty_sym), 0.0); } @@ -1008,6 +1020,12 @@ Page_breaking::is_last () const return current_end_breakpoint_ == last_break_position (); } +bool +Page_breaking::ends_score () const +{ + return breaks_[current_end_breakpoint_].score_ender_; +} + vsize Page_breaking::last_break_position () const { diff --git a/ly/paper-defaults.ly b/ly/paper-defaults.ly index 8eb3a24f20..67839f9c6c 100644 --- a/ly/paper-defaults.ly +++ b/ly/paper-defaults.ly @@ -80,7 +80,8 @@ %% settings for the page breaker %% blank-last-page-force = 0 - blank-page-force = 2 + blank-after-score-page-force = 2 + blank-page-force = 5 %% %% To limit space between systems on a page with a lot of space left