From: Mike Solomon Date: Sat, 9 Apr 2011 03:21:00 +0000 (-0400) Subject: Adds footnote-footer-padding to the paper bloc. X-Git-Tag: release/2.13.59-1~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c676b77a6e685d6efbbeb358f8488725fbab34d2;p=lilypond.git Adds footnote-footer-padding to the paper bloc. 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. --- diff --git a/input/regression/footnote-footer-padding.ly b/input/regression/footnote-footer-padding.ly new file mode 100644 index 0000000000..46d4264591 --- /dev/null +++ b/input/regression/footnote-footer-padding.ly @@ -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 +}} diff --git a/lily/include/page-breaking.hh b/lily/include/page-breaking.hh index fa68c61752..17f64d754b 100644 --- a/lily/include/page-breaking.hh +++ b/lily/include/page-breaking.hh @@ -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 current_configurations_; diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 80702f59ba..fe1d163658 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -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 { diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index c9512fcca8..636e937a72 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -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; } } diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc index 13c6a0c02a..b04d3f394a 100644 --- a/lily/page-spacing.cc +++ b/lily/page-spacing.cc @@ -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 diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly index 61750d2159..533a2deaeb 100644 --- a/ly/paper-defaults-init.ly +++ b/ly/paper-defaults-init.ly @@ -108,7 +108,7 @@ %% 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 diff --git a/scm/paper.scm b/scm/paper.scm index bc6e2e1944..d00be0d190 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -20,6 +20,8 @@ '(blot-diameter bottom-margin cm + footnote-footer-padding + footnote-padding horizontal-shift in indent