]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add the blank-after-score-page-force for finer granularity.
authorJoe Neeman <joeneeman@gmail.com>
Sun, 25 Nov 2007 21:14:28 +0000 (08:14 +1100)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 26 Nov 2007 23:22:55 +0000 (10:22 +1100)
Look up the blank-X-page-force variables from a layout block if possible.

lily/include/page-breaking.hh
lily/page-breaking.cc
ly/paper-defaults.ly

index b14c780ba5fdf4db3101ec511608f4ae92f6073f..150e09fa9aa726ffb40eee4fc8e0631faebddabc 100644 (file)
@@ -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;
index d3a2762bbb350285dd3d00141976c9c235e793e8..1ae769e82d641d79145e53491bd77795baf2d4a4 100644 (file)
@@ -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
 {
index 8eb3a24f200eb7aa3f4cc61cdbecb81b6ae932a5..67839f9c6c5695869bc39438f08184b901e03416 100644 (file)
@@ -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