From 81f5263fa1b6adf642b06970cd34e10d4635495d Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Sun, 23 Aug 2009 23:30:58 +0100 Subject: [PATCH] Remove two-pass spacing code and documentation. --- Documentation/notation/spacing.itely | 65 --------- ly/music-functions-init.ly | 33 ----- ly/paper-defaults-init.ly | 200 +++++++++++++-------------- 3 files changed, 93 insertions(+), 205 deletions(-) diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index a52bc68f90..7e9b1d66aa 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -1286,7 +1286,6 @@ staves inside a system. * Vertical spacing inside a system:: * Vertical spacing between systems:: * Explicit staff and system positioning:: -* Two-pass vertical spacing:: * Vertical collision avoidance:: @end menu @@ -1700,70 +1699,6 @@ Snippets: @rlsr{Spacing}. -@node Two-pass vertical spacing -@subsection Two-pass vertical spacing - -@warning{Two-pass vertical spacing is deprecated and will be removed in -a future version of LilyPond. Systems are now stretched automatically -in a single pass. See @ref{Vertical spacing inside a system}.} - -In order to automatically stretch systems so that they should fill the -space left on a page, a two-pass technique can be used: - -@enumerate -@item In the first pass, the amount of vertical space used to increase -the height of each system is computed and dumped to a file. -@item In the second pass, spacing inside the systems are -stretched according to the data in the page layout file. -@end enumerate - -The @code{ragged-bottom} property adds space between systems, while -the two-pass technique adds space between staves inside a system. - -To allow this behavior, a @code{tweak-key} variable has to be set in -each score @code{\layout} block, and the tweaks included in each score -music, using the @code{\scoreTweak} music function. - -@quotation -@verbatim -%% include the generated page layout file: -\includePageLayoutFile - -\score { - \new StaffGroup << - \new Staff << - %% Include this score tweaks: - \scoreTweak "scoreA" - { \clef french c''1 \break c''1 } - >> - \new Staff { \clef soprano g'1 g'1 } - \new Staff { \clef mezzosoprano e'1 e'1 } - \new Staff { \clef alto g1 g1 } - \new Staff { \clef bass c1 c1 } - >> - \header { - piece = "Score with tweaks" - } - %% Define how to name the tweaks for this score: - \layout { #(define tweak-key "scoreA") } -} -@end verbatim -@end quotation - -For the first pass, the @code{dump-tweaks} option should be set to -generate the page layout file. - -@example -lilypond -dbackend=null -d dump-tweaks .ly -lilypond .ly -@end example - - -@seealso -Snippets: -@rlsr{Spacing}. - - @node Vertical collision avoidance @subsection Vertical collision avoidance diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 7bec31990e..626203d996 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -278,23 +278,6 @@ grace = -%% see comment for page-layout-parser definition below. -includePageLayoutFile = -#(define-music-function (parser location) () - (_i "Include the file @var{-page-layout.ly}. Deprecated as -part of two-pass spacing.") - (if (not (ly:get-option 'dump-tweaks)) - (let ((tweak-filename (format #f "~a-page-layout.ly" - (ly:parser-output-name parser)))) - (if (access? tweak-filename R_OK) - (begin - (ly:message "Including tweak file ~a" tweak-filename) - (set! page-layout-parser (ly:parser-clone parser)) - (ly:parser-parse-string page-layout-parser - (format #f "\\include \"~a\"" - tweak-filename)))))) - (make-music 'SequentialMusic 'void #t)) - instrumentSwitch = #(define-music-function (parser location name) (string?) @@ -461,10 +444,6 @@ or @code{\"GrobName\"}") -%% Parser used to read page-layout file (see includePageLayoutFile -%% above), and then retreive score tweaks (see scoreTweak below). -#(define page-layout-parser #f) - %% pageBreak and pageTurn are music functions (iso music indentifiers), %% because music identifiers are not allowed at top-level. pageBreak = @@ -715,18 +694,6 @@ scaleDurations = (ly:music-compress music (ly:make-moment (car fraction) (cdr fraction)))) -%% see comment for page-layout-parser definition above. -scoreTweak = -#(define-music-function (parser location name) (string?) - (_i "Include the score tweak, if exists.") - (if (and page-layout-parser (not (ly:get-option 'dump-tweaks))) - (let ((tweak-music (ly:parser-lookup page-layout-parser - (string->symbol name)))) - (if (ly:music? tweak-music) - tweak-music - (make-music 'SequentialMusic))) - (make-music 'SequentialMusic))) - setBeatGrouping = #(define-music-function (parser location grouping) (pair?) (_i "Set the beat grouping in the current time signature to diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly index 0bc54798e4..1ee92ed197 100644 --- a/ly/paper-defaults-init.ly +++ b/ly/paper-defaults-init.ly @@ -1,110 +1,96 @@ \version "2.12.0" \paper { - - %%% WARNING - %%% - %%% If you add any new dimensions, don't forget to update - %%% the dimension-variables variable. See paper.scm. - - unit = #(ly:unit) - mm = 1.0 - in = 25.4 - pt = #(/ in 72.27) - cm = #(* 10 mm) - - print-page-number = ##t - - %% - %% 20pt staff, 5 pt = 1.75 mm - %% - - output-scale = #1.7573 - - #(define-public book-title (marked-up-title 'bookTitleMarkup)) - #(define-public score-title (marked-up-title 'scoreTitleMarkup)) - - %% - %% ugh. hard coded? - %% - - #(layout-set-absolute-staff-size (* 20.0 pt)) - - - #(define-public score-title-properties - '((is-title . #t) - (is-book-title . #f) - )) - #(define-public book-title-properties - '((is-title . #t) - (is-book-title . #t) - )) - - %% Note: these are not scaled; they are in staff-spaces. - between-system-spacing = #'((space . 12) (minimum-distance . 8) (padding . 1)) - between-scores-system-spacing = #'((space . 14) (minimum-distance . 8) (padding . 1)) - after-title-spacing = #'((space . 2) (padding . 0.5)) - before-title-spacing = #'((space . 5) (padding . 0.5)) - between-title-spacing = #'((space . 1) (padding . 0.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 - - %% - %% looks best for shorter scores. - %% - ragged-last-bottom= ##t - - %% - %% settings for the page breaker - %% - blank-last-page-force = 0 - blank-after-score-page-force = 2 - blank-page-force = 5 - - %% - %% To limit space between systems on a page with a lot of space left - %% - page-limit-inter-system-space = ##f - page-limit-inter-system-space-factor = 1.4 - - #(define font-defaults - '((font-encoding . fetaMusic))) - - %% - %% the font encoding `latin1' is a dummy value for Pango fonts - %% - #(define text-font-defaults - `((font-encoding . latin1) - (baseline-skip . 3) - (word-space . 0.6))) - - #(define page-breaking ly:optimal-breaking) - - #(define write-page-layout (ly:get-option 'dump-tweaks)) - #(define system-maximum-stretch-procedure - (lambda (line) - (if (stretchable-line? line) - (let ((height (line-height line))) - (/ (* height height) 80.0)) - 0.0))) - -% #(define page-music-height default-page-music-height ) -% #(define page-make-stencil default-page-make-stencil ) - - #(define make-header (marked-up-headfoot 'oddHeaderMarkup 'evenHeaderMarkup)) - #(define make-footer (marked-up-headfoot 'oddFooterMarkup 'evenFooterMarkup)) - #(set-paper-dimension-variables (current-module)) - - \include "titling-init.ly" - - top-margin = 5 \mm - bottom-margin = 6 \mm - head-separation = 4 \mm - foot-separation = 4 \mm - - first-page-number = #1 - print-first-page-number =##f - } + %%% WARNING + %%% + %%% If you add any new dimensions, don't forget to update + %%% the dimension-variables variable. See paper.scm. + + unit = #(ly:unit) + mm = 1.0 + in = 25.4 + pt = #(/ in 72.27) + cm = #(* 10 mm) + + print-page-number = ##t + + %% + %% 20pt staff, 5 pt = 1.75 mm + %% + + output-scale = #1.7573 + + #(define-public book-title (marked-up-title 'bookTitleMarkup)) + #(define-public score-title (marked-up-title 'scoreTitleMarkup)) + + %% + %% ugh. hard coded? + %% + + #(layout-set-absolute-staff-size (* 20.0 pt)) + + + #(define-public score-title-properties + '((is-title . #t) + (is-book-title . #f))) + #(define-public book-title-properties + '((is-title . #t) + (is-book-title . #t))) + + %% Note: these are not scaled; they are in staff-spaces. + between-system-spacing = #'((space . 12) (minimum-distance . 8) (padding . 1)) + between-scores-system-spacing = #'((space . 14) (minimum-distance . 8) (padding . 1)) + after-title-spacing = #'((space . 2) (padding . 0.5)) + before-title-spacing = #'((space . 5) (padding . 0.5)) + between-title-spacing = #'((space . 1) (padding . 0.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 + + %% + %% looks best for shorter scores. + %% + ragged-last-bottom = ##t + + %% + %% settings for the page breaker + %% + blank-last-page-force = 0 + blank-after-score-page-force = 2 + blank-page-force = 5 + + %% + %% To limit space between systems on a page with a lot of space left + %% + page-limit-inter-system-space = ##f + page-limit-inter-system-space-factor = 1.4 + + #(define font-defaults + '((font-encoding . fetaMusic))) + + %% + %% the font encoding `latin1' is a dummy value for Pango fonts + %% + #(define text-font-defaults + `((font-encoding . latin1) + (baseline-skip . 3) + (word-space . 0.6))) + + #(define page-breaking ly:optimal-breaking) + + #(define make-header (marked-up-headfoot 'oddHeaderMarkup 'evenHeaderMarkup)) + #(define make-footer (marked-up-headfoot 'oddFooterMarkup 'evenFooterMarkup)) + #(set-paper-dimension-variables (current-module)) + + \include "titling-init.ly" + + top-margin = 5 \mm + bottom-margin = 6 \mm + head-separation = 4 \mm + foot-separation = 4 \mm + + first-page-number = #1 + print-first-page-number =##f +} -- 2.39.5