]> git.donarmstrong.com Git - lilypond.git/commitdiff
Adds footnote-footer-padding to the paper bloc.
authorMike Solomon <mike@apollinemike.com>
Sat, 9 Apr 2011 03:21:00 +0000 (23:21 -0400)
committerMike Solomon <mike@apollinemike.com>
Sat, 9 Apr 2011 03:21:00 +0000 (23:21 -0400)
This increases the space between the bottommost footnote and the footer.

Also declares both footnote-padding and footnote-footer-padding in
set-paper-dimension-variables.

input/regression/footnote-footer-padding.ly [new file with mode: 0644]
lily/include/page-breaking.hh
lily/page-breaking.cc
lily/page-layout-problem.cc
lily/page-spacing.cc
ly/paper-defaults-init.ly
scm/paper.scm

diff --git a/input/regression/footnote-footer-padding.ly b/input/regression/footnote-footer-padding.ly
new file mode 100644 (file)
index 0000000..46d4264
--- /dev/null
@@ -0,0 +1,32 @@
+\version "2.13.59"
+\header {
+  texidoc = "The padding between a footnote and the footer can be tweaked."
+}
+
+#(set-default-paper-size "a6")
+
+\paper {
+  footnote-footer-padding = 1\in
+}
+
+\book {
+
+  \relative c' {
+    \footnoteGrob #'NoteHead
+                  #'(1 . -1)
+                  \markup { \tiny 1 }
+                  \markup { 1. Tiny space below. }
+    e1
+
+    \footnoteGrob #'NoteHead
+                  #'(1 . -1)
+                  \markup { \tiny 2 }
+                  \markup { 2. Tiny space below. }
+    e1
+
+    \footnoteGrob #'NoteHead
+                  #'(1 . -1)
+                  \markup { \tiny 3 }
+                  \markup { 3. Big space below. }
+    e1
+}}
index fa68c6175207068f4543498ec5262ca1fc352089..17f64d754b87089b324263e4ea8d1b875ba75286 100644 (file)
@@ -126,6 +126,7 @@ public:
   vsize system_count () const;
   Real footnote_separator_stencil_height () const;
   Real footnote_padding () const;
+  Real footnote_footer_padding () const;
   Real line_count_penalty (int line_count) const;
   int line_count_status (int line_count) const;
   bool too_many_lines (int line_count) const;
@@ -189,6 +190,7 @@ private:
   vsize system_count_;
   Real footnote_separator_stencil_height_;
   Real footnote_padding_;
+  Real footnote_footer_padding_;
   int orphan_penalty_;
 
   vector<Line_division> current_configurations_;
index 80702f59ba2e3517aa8afd8fd1f3acb9d790a9af..fe1d163658a548f7a59489c348bf3eadb8ea91cf 100644 (file)
@@ -263,6 +263,7 @@ Page_breaking::Page_breaking (Paper_book *pb, Break_predicate is_break, Prob_bre
     footnote_separator_stencil_height_ = 0.0;
 
   footnote_padding_ = robust_scm2double (pb->paper_->c_variable ("footnote-padding"), 0.0);
+  footnote_footer_padding_ = robust_scm2double (pb->paper_->c_variable ("footnote-footer-padding"), 0.0);
 
   if (systems_per_page_ && (max_systems_per_page_ || min_systems_per_page_))
     {
@@ -335,6 +336,12 @@ Page_breaking::footnote_padding () const
   return footnote_padding_;
 }
 
+Real
+Page_breaking::footnote_footer_padding () const
+{
+  return footnote_footer_padding_;
+}
+
 bool
 Page_breaking::too_many_lines (int line_count) const
 {
index c9512fcca83a9d6908ae8237a048f47985a1fc98..636e937a72eab6290433b242a24e992d074f3f0b 100644 (file)
@@ -71,7 +71,7 @@ Page_layout_problem::get_footnotes_from_lines (SCM lines, Real padding)
 
   if (!scm_is_pair (footnotes))
     return SCM_EOL;
-    
+
   return scm_reverse (footnotes);
 }
 
@@ -99,8 +99,10 @@ Page_layout_problem::add_footnotes_to_footer (SCM footnotes, Stencil *foot, Pape
 {
   bool footnotes_found = false;
   Real footnote_padding = robust_scm2double (pb->paper_->c_variable ("footnote-padding"), 0.0);
+  Real footnote_footer_padding = robust_scm2double (pb->paper_->c_variable ("footnote-footer-padding"), 0.0);
   
   footnotes = scm_reverse (footnotes);
+
   for (SCM s = footnotes; scm_is_pair (s); s = scm_cdr (s))
     {
       Stencil *stencil = unsmob_stencil (scm_car (s));
@@ -110,7 +112,7 @@ Page_layout_problem::add_footnotes_to_footer (SCM footnotes, Stencil *foot, Pape
 
       if (!stencil->is_empty ())
         {
-          foot->add_at_edge (Y_AXIS, UP, *stencil, footnote_padding);
+          foot->add_at_edge (Y_AXIS, UP, *stencil, (!footnotes_found ? footnote_footer_padding : footnote_padding));
           footnotes_found = true;
         }
     }
index 13c6a0c02a98f45cd0d9208e4a13f2e61fe315c5..b04d3f394a17bde64118bc01598bf6bf19f04488 100644 (file)
@@ -83,8 +83,12 @@ Page_spacing::account_for_footnotes (Line_details const &line)
       Interval extent = line.footnotes_[i]->extent (Y_AXIS);
       footnote_height += extent[UP] - extent[DOWN];
       footnote_height += breaker_->footnote_padding ();
-    }  
-  return footnote_height;
+    }
+
+  return (footnote_height
+         - (has_footnotes_
+           ? breaker_->footnote_padding () + breaker_->footnote_footer_padding ()
+           : 0.0));
 }
 
 void
index 61750d2159db7a001024b406ea67db996ebb12c1..533a2deaebd62e28da8433e2016a0052c682b08c 100644 (file)
   %%
   footnote-separator-markup = \markup { \fill-line \override #`(span-factor . 1/2) { \draw-hline } }
   footnote-padding = 0.5\mm
-
+  footnote-footer-padding = 0.5\mm
 
   %%
   %% Page numbering
index bc6e2e19448189648db604614c3c3a11e54c598a..d00be0d190ef5ec0ce50fa3aa3db1661b86463e5 100644 (file)
@@ -20,6 +20,8 @@
                  '(blot-diameter
                    bottom-margin
                    cm
+                   footnote-footer-padding
+                   footnote-padding
                    horizontal-shift
                    in
                    indent