]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/layout-page-layout.scm
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scm / layout-page-layout.scm
index 6328b8d1229bed22826dd1dcefab752a8cd07c59..f7853b01bbb0128cde2c7d31cc83047bd1e62d25 100644 (file)
@@ -3,7 +3,7 @@
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;;
 ;;;; (c) 2004--2006 Jan Nieuwenhuizen <janneke@gnu.org>
-;;;;         Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;;         Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 (define-module (scm layout-page-layout)
   #:use-module (srfi srfi-1)
   "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'
 
 (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))))