@itemize @bullet
+@item Systems individual systems may be positioned manually.
+
+@lilypond[]
+\header{
+ tagline = "lily was here"
+}
+
+#(set-default-paper-size "a7" 'landscape)
+\paper {
+ headsep = 0.0
+ footsep = 0.0
+ }
+\book {
+ \score {
+ \relative c'' {
+ c1\break
+ \overrideProperty
+ #"Score.NonMusicalPaperColumn"
+ #'line-break-system-details
+ #'((Y-offset . 24.5)
+ (X-offset . -7.5))
+ c1
+ }
+ }
+ \paper {
+ annotatepage = ##t
+ annotateheaders = ##t
+ }
+}
+@end lilypond
+
+This feature was sponsored by Trevor Bača and Nicolas Sceaux.
+
+@item A linebreaking configuration can now be saved as a @file{.ly}
+file automatically. This allows vertical alignments to be stretched to
+fit pages in a second formatting run. This feature was sponsored by
+Trevor Bača and Nicolas Sceaux.
+
@item The tie formatting for chords has been further polished. More
cases are handled gracefully, and all scoring parameters may now be
changed through the @code{details} property of the @code{Tie} grob.
(if (ly:output-def-lookup layout 'write-page-layout #f)
(write-page-breaks pages)))
-;;; optimal page breaking
-
-;;; This is not optimal page breaking, this is optimal distribution of
-;;; lines over pages; line breaks are a given.
+;; Optimal distribution of
+;; lines over pages; line breaks are a given.
;; TODO:
;;
(define scopes (ly:paper-book-scopes paper-book))
(define force-equalization-factor #f)
(define (get-path node done)
+
"Follow NODE.PREV, and return as an ascending list of pages. DONE
is what have collected so far, and has ascending page numbers."
CURRENT-BEST is the best result sofar, or #f."
-
(let* ((this-page-num (if (null? best-paths)
(ly:output-def-lookup paper 'firstpagenumber)
(1+ (page-page-number (car best-paths)))))
(ly:output-def-lookup paper 'verticalequalizationfactor 0.3))
(let* ((best-break-node (walk-lines '() '() lines))
- (break-nodes (get-path best-break-node '()))
- )
+ (break-nodes (get-path best-break-node '())))
(page-set-property! (car (last-pair break-nodes)) 'is-last #t)
(if #f; (ly:get-option 'verbose)
(lambda (pg)
(page-property pg j))))
- '(page-number prev lines force penalty configuration lines))
+ '(page-number prev lines force penalty lines))
-(define (page-system-numbers node)
+(define (page-system-numbers page)
(map (lambda (ps) (ly:prob-property ps 'number))
- (page-lines node)))
+ (page-lines page)))
+
+(define (page-translate-systems page)
+ (for-each
+
+ (lambda (sys-off)
+ (let*
+ ((sys (car sys-off))
+ (off (cadr sys-off)))
+
+ (if (not (number? (ly:prob-property sys 'Y-offset)))
+ (ly:prob-set-property! sys 'Y-offset off))))
+
+ (zip (page-property page 'lines)
+ (page-property page 'configuration))))
(define (annotate-page layout stencil)
(let*
;; add arrow markers
- (if (annotate? layout)
+ (if (or (annotate? layout)
+ (ly:output-def-lookup layout 'annotateheaders #f))
(set! head-stencil
(ly:stencil-add
(ly:stencil-translate-axis
(layout (ly:paper-book-paper p-book))
(scopes (ly:paper-book-scopes p-book))
(lines (page-lines page))
- (offsets (page-configuration page))
(number (page-page-number page))
(last? (page-property page 'is-last))
)
+ (page-translate-systems page)
(let*
((p-book (page-property page 'paper-book))
(prop (lambda (sym) (page-property page sym)))
(layout (ly:paper-book-paper p-book))
(scopes (ly:paper-book-scopes p-book))
(lines (page-lines page))
- (offsets (page-configuration page))
(number (page-page-number page))
;; TODO: naming vsize/hsize not analogous to TeX.
(last-system #f)
(last-y 0.0)
- (add-to-page (lambda (stencil y)
+ (add-to-page (lambda (stencil x y)
(set! page-stencil
(ly:stencil-add page-stencil
(ly:stencil-translate stencil
(cons
- system-xoffset
+ (+ system-xoffset x)
(- 0 head-height y (prop 'top-margin)))
)))))
(add-system
- (lambda (stencil-position)
- (let* ((system (car stencil-position))
- (stencil (paper-system-stencil system))
- (y (cadr stencil-position))
+ (lambda (system)
+ (let* ((stencil (paper-system-stencil system))
+ (y (ly:prob-property system 'Y-offset))
(is-title (paper-system-title?
- (car stencil-position))))
- (add-to-page stencil y)
+ system)))
+ (add-to-page stencil
+ (ly:prob-property system 'X-offset 0.0)
+ y)
(if (and (ly:stencil? system-separator-stencil)
last-system
(not (paper-system-title? system))
(not (paper-system-title? last-system)))
(add-to-page
system-separator-stencil
+ 0
(average (- last-y
(car (paper-system-staff-extents last-system)))
(- y
(foot (prop 'foot-stencil))
)
- (if (annotate? layout)
+ (if (or (annotate? layout)
+ (ly:output-def-lookup layout 'annotatesystems #f))
+
(begin
(for-each (lambda (sys) (paper-system-annotate sys layout))
lines)
(ly:make-stencil "" (cons 0 0) (cons 0 0)))
0. 0.))
- (map add-system (zip lines offsets))
+ (map add-system lines)
(ly:prob-set-property! page 'bottom-system-edge
(car (ly:stencil-extent page-stencil Y)))
(ly:stencil-translate page-stencil (cons (prop 'left-margin) 0)))
;; annotation.
- (if (annotate? layout)
+ (if (or (annotate? layout)
+ (ly:output-def-lookup layout 'annotatepage #f))
(set! page-stencil (annotate-page layout page-stencil)))
page-stencil))