X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flayout-page-layout.scm;h=264d38054871e015b83f2f0f6e5f09e99d24c1de;hb=1b344bd7394e98933bc482a7b64b8af681a96861;hp=e370a171323254050179f6e777eea2bece37b859;hpb=7eaeba29769613cb105e71ac40a71746d1601d90;p=lilypond.git diff --git a/scm/layout-page-layout.scm b/scm/layout-page-layout.scm index e370a17132..264d380548 100644 --- a/scm/layout-page-layout.scm +++ b/scm/layout-page-layout.scm @@ -35,8 +35,14 @@ (define (post-process-pages layout pages) "If the write-page-layout paper variable is true, dumps page breaks and tweaks." - (if (ly:output-def-lookup layout 'write-page-layout #f) - (write-page-breaks pages))) + + (let* + ((parser (ly:modules-lookup (list (current-module)) 'parser)) + (output-name (ly:parser-output-name parser)) + ) + + (if (ly:output-def-lookup layout 'write-page-layout #f) + (write-page-breaks pages output-name)))) ;;; ;;; Utilities for computing line distances and positions @@ -73,9 +79,10 @@ "Minimum distance between `line' reference position and `next-line' reference position. If next-line is #f, return #f." (and next-line - (max 0 (- (+ (interval-end (paper-system-extent next-line Y)) - (if ignore-padding 0 (line-next-padding line next-line layout))) - (interval-start (paper-system-extent line Y)))))) + (let ((non-skyline-distance (- (interval-end (paper-system-extent next-line Y)) + (interval-start (paper-system-extent line Y))))) + (max 0 (+ (ly:prob-property next-line 'skyline-distance non-skyline-distance) + (if ignore-padding 0 (line-next-padding line next-line layout))))))) (define (line-ideal-distance line next-line layout ignore-padding) "Ideal distance between `line' reference position and `next-line' @@ -88,7 +95,10 @@ (define (first-line-position line layout) "Position of the first line on page" - (max (+ (ly:output-def-lookup layout 'page-top-space) + (max (+ (if (ly:prob-property? line 'is-title) + ;; do not use page-top-space if first line is a title + 0.0 + (ly:output-def-lookup layout 'page-top-space)) (interval-end (paper-system-staff-extents line))) (interval-end (paper-system-extent line Y)))) @@ -204,8 +214,11 @@ (space-to-fill (page-maximum-space-to-fill page lines paper)) (spacing (space-systems space-to-fill lines ragged paper #f))) - (if (or (not (car spacing)) (inf? (car spacing))) - (cdr (space-systems space-to-fill lines ragged paper #t)) + (if (and (> (length lines) 1) + (or (not (car spacing)) (inf? (car spacing)))) + (begin + (ly:warning (_ "Can't fit systems on page -- ignoring between-system-padding")) + (cdr (space-systems space-to-fill lines ragged paper #t))) (cdr spacing)))))) (page-set-property! page 'configuration posns) page))