(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
"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))))