]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/page-layout.scm
* scm/define-markup-commands.scm (text): add \text markup command.
[lilypond.git] / scm / page-layout.scm
index c2f554bb84bfb9a75790c96b422776dfac757b0a..08590f2f89d99865eecb08071f437d122d10cab7 100644 (file)
@@ -77,6 +77,7 @@
  Offsets is a list of increasing numbers. They must be negated to
 create offsets.
  "
+
   (let* ((topmargin (ly:output-def-lookup layout 'topmargin))
 
        ;; TODO: naming vsize/hsize not analogous to TeX.
@@ -87,7 +88,7 @@ create offsets.
         (system-separator-markup (ly:output-def-lookup layout 'systemSeparatorMarkup))
         (system-separator-stencil (if (markup? system-separator-markup)
                                       (interpret-markup layout
-                                                        (page-properties layout)
+                                                        (layout-extract-page-properties layout)
                                                         system-separator-markup)
                                       #f))
         (lmargin (ly:output-def-lookup layout 'leftmargin))
@@ -142,13 +143,21 @@ create offsets.
 
     (if #f
        (display (list
-                 "leftmargin" leftmargin "rightmargin" rightmargin)))
+                 "leftmargin " leftmargin "rightmargin " rightmargin
+                 )))
 
     (set! page-stencil (ly:stencil-combine-at-edge
-                       page-stencil Y DOWN head 0. 0.))
+                       page-stencil Y DOWN
+                       (if (and
+                            (ly:stencil? head)
+                            (not (ly:stencil-empty? head)))
+                           head
+                           (ly:make-stencil "" (cons 0 0) (cons 0 0)))
+                           0. 0.))
 
     (map add-system (zip lines offsets))
-    (if (ly:stencil? foot)
+    (if (and (ly:stencil? foot)
+            (not (ly:stencil-empty? foot)))
        (set! page-stencil
              (ly:stencil-add
               page-stencil
@@ -413,7 +422,7 @@ DONE."
   (define (line-number node)
     (ly:paper-system-number (car (node-lines node))))
 
-  (display (_ "Calculating page breaks...") (current-error-port))
+  (ly:message (_ "Calculating page breaks..."))
 
   (let* ((best-break-node (walk-lines '() '() lines))
         (break-nodes (get-path best-break-node '()))
@@ -421,7 +430,7 @@ DONE."
 
     (define (node->page-stencil node)
       (if (not (eq? node last-node))
-         (display "[" (current-error-port)))
+         (ly:progress "["))
       (let ((stencil
             ((ly:output-def-lookup paper 'page-make-stencil)
              (node-lines node)
@@ -432,9 +441,9 @@ DONE."
              (eq? node best-break-node))))
        (if (not (eq? node last-node))
            (begin
-             (display (car (last-pair (node-system-numbers node)))
-                      (current-error-port))
-             (display "]" (current-error-port))))
+             (ly:progress (number->string
+                           (car (last-pair (node-system-numbers node)))))
+             (ly:progress "]")))
        stencil))
 
     (if #f; (ly:get-option 'verbose)
@@ -446,5 +455,5 @@ DONE."
                   "\nconfigs " (map node-configuration break-nodes))))
 
     (let ((stencils (map node->page-stencil break-nodes)))
-      (newline (current-error-port))
+      (ly:progress "\n")
       stencils)))