From 957d942e2c0fb0a1bdbdaef610961bdd3b23ebdd Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Mon, 10 Aug 2009 22:43:24 +1000 Subject: [PATCH] Rename spacing variables. first-system-spacing -> top-system-spacing first-system-title-spacing -> top-title-spacing last-system-spacing -> bottom-system-spacing --- ...page-spacing-first-system-title-spacing.ly | 19 ------------------- ...page-spacing-loose-lines-header-padding.ly | 4 ++-- ....ly => page-spacing-top-system-spacing.ly} | 4 ++-- .../page-spacing-top-title-spacing.ly | 19 +++++++++++++++++++ lily/page-breaking.cc | 6 +++--- lily/page-layout-problem.cc | 10 +++++----- ly/paper-defaults-init.ly | 6 +++--- scm/page.scm | 4 ++-- 8 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 input/regression/page-spacing-first-system-title-spacing.ly rename input/regression/{page-spacing-first-system-spacing.ly => page-spacing-top-system-spacing.ly} (60%) create mode 100644 input/regression/page-spacing-top-title-spacing.ly diff --git a/input/regression/page-spacing-first-system-title-spacing.ly b/input/regression/page-spacing-first-system-title-spacing.ly deleted file mode 100644 index e6117fcff9..0000000000 --- a/input/regression/page-spacing-first-system-title-spacing.ly +++ /dev/null @@ -1,19 +0,0 @@ -\version "2.13.2" - -#(set-default-paper-size "a6") - -\book { - - \header { - texidoc = "first-system-title-spacing controls the spacing to the title, -provided that it is the first system on a page." - title = "Title" - } - - \paper { - first-system-title-spacing = #'((minimum-distance . 30)) - ragged-bottom = ##t - } - - { c'1 \pageBreak c'1 } -} \ No newline at end of file diff --git a/input/regression/page-spacing-loose-lines-header-padding.ly b/input/regression/page-spacing-loose-lines-header-padding.ly index a3262da1c6..fca9e620b6 100644 --- a/input/regression/page-spacing-loose-lines-header-padding.ly +++ b/input/regression/page-spacing-loose-lines-header-padding.ly @@ -9,8 +9,8 @@ line, whether or not it is spaceable." \book { \paper { - first-system-spacing = #'((space . 1) (padding . 10)) - last-system-spacing = #'((space . 1) (padding . 10)) + top-system-spacing = #'((space . 1) (padding . 10)) + bottom-system-spacing = #'((space . 1) (padding . 10)) annotate-spacing = ##t ragged-last-bottom = ##f } diff --git a/input/regression/page-spacing-first-system-spacing.ly b/input/regression/page-spacing-top-system-spacing.ly similarity index 60% rename from input/regression/page-spacing-first-system-spacing.ly rename to input/regression/page-spacing-top-system-spacing.ly index 82f7b4e805..dbb1689c96 100644 --- a/input/regression/page-spacing-first-system-spacing.ly +++ b/input/regression/page-spacing-top-system-spacing.ly @@ -5,13 +5,13 @@ \book { \header { - texidoc = "first-system-spacing controls the spacing to the first + texidoc = "top-system-spacing controls the spacing to the first non-title staff on every page." title = "Title" } \paper { - first-system-spacing = #'((minimum-distance . 30)) + top-system-spacing = #'((minimum-distance . 30)) ragged-bottom = ##t } diff --git a/input/regression/page-spacing-top-title-spacing.ly b/input/regression/page-spacing-top-title-spacing.ly new file mode 100644 index 0000000000..823b62fe25 --- /dev/null +++ b/input/regression/page-spacing-top-title-spacing.ly @@ -0,0 +1,19 @@ +\version "2.13.2" + +#(set-default-paper-size "a6") + +\book { + + \header { + texidoc = "@var{top-title-spacing} controls the spacing +from the top margin to a title (or markup), provided that it is +the first system on a page." + title = "Title" } + + \paper { + top-title-spacing = #'((minimum-distance . 30)) + ragged-bottom = ##t + } + + { c'1 \pageBreak c'1 } +} \ No newline at end of file diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 8dc19ef357..1b61f38258 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -1365,9 +1365,9 @@ Page_breaking::last_break_position () const Real Page_breaking::min_whitespace_at_top_of_page (Line_details const &line) const { - SCM first_system_spacing = book_->paper_->c_variable ("first-system-spacing"); + SCM first_system_spacing = book_->paper_->c_variable ("top-system-spacing"); if (line.title_) - first_system_spacing = book_->paper_->c_variable ("first-system-title-spacing"); + first_system_spacing = book_->paper_->c_variable ("top-title-spacing"); Real min_distance = -infinity_f; Real padding = 0; @@ -1386,7 +1386,7 @@ Page_breaking::min_whitespace_at_top_of_page (Line_details const &line) const Real Page_breaking::min_whitespace_at_bottom_of_page (Line_details const &line) const { - SCM last_system_spacing = book_->paper_->c_variable ("last-system-spacing"); + SCM last_system_spacing = book_->paper_->c_variable ("bottom-system-spacing"); Real min_distance = -infinity_f; Real padding = 0; diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index fb9e27d12b..d409d3405a 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -64,13 +64,13 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst after_title_spacing = paper->c_variable ("after-title-spacing"); before_title_spacing = paper->c_variable ("before-title-spacing"); between_title_spacing = paper->c_variable ("between-title-spacing"); - last_system_spacing = paper->c_variable ("last-system-spacing"); - first_system_spacing = paper->c_variable ("first-system-spacing"); + last_system_spacing = paper->c_variable ("bottom-system-spacing"); + first_system_spacing = paper->c_variable ("top-system-spacing"); if (scm_is_pair (systems) && unsmob_prob (scm_car (systems))) - first_system_spacing = paper->c_variable ("first-system-title-spacing"); + first_system_spacing = paper->c_variable ("top-title-spacing"); // Note: the page height here does _not_ reserve space for headers and - // footers. This is because we want to anchor the first-system-spacing + // footers. This is because we want to anchor the top-system-spacing // spring at the _top_ of the header. page_height_ -= robust_scm2double (paper->c_variable ("top-margin"), 0) + robust_scm2double (paper->c_variable ("bottom-margin"), 0); @@ -131,7 +131,7 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst { Real bottom_padding; - // TODO: junk bottom-space now that we have last-system-spacing? + // TODO: junk bottom-space now that we have bottom-system-spacing? // bottom-space has the flexibility that one can do it per-system. // NOTE: bottom-space is misnamed since it is not stretchable space. if (Prob *p = elements_.back ().prob) diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly index ab598e5a46..9bffbff7dc 100644 --- a/ly/paper-defaults-init.ly +++ b/ly/paper-defaults-init.ly @@ -45,9 +45,9 @@ after-title-spacing = #'((space . 2) (padding . 0.5)) before-title-spacing = #'((space . 5) (padding . 0.5)) between-title-spacing = #'((space . 1) (padding . 0.5)) - first-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0)) - first-system-title-spacing = #'((space . 1) (padding . 1) (min-distance . 0)) - last-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0) (stretchability . 5)) + top-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0)) + top-title-spacing = #'((space . 1) (padding . 1) (min-distance . 0)) + bottom-system-spacing = #'((space . 1) (padding . 1) (min-distance . 0) (stretchability . 5)) ragged-bottom = ##f diff --git a/scm/page.scm b/scm/page.scm index 2b63218766..ca4e0d8659 100644 --- a/scm/page.scm +++ b/scm/page.scm @@ -88,8 +88,8 @@ (define (annotate-top-space first-system layout header-stencil stencil) (let* ((top-margin (ly:output-def-lookup layout 'top-margin)) (sym (if (paper-system-title? first-system) - 'first-system-title-spacing - 'first-system-spacing)) + 'top-title-spacing + 'top-system-spacing)) (spacing-spec (ly:output-def-lookup layout sym)) (X-offset (ly:prob-property first-system 'X-offset 5)) (header-extent (ly:stencil-extent header-stencil Y))) -- 2.39.2