]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/page.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / page.scm
index f6bb29d701be0c331fadf51fe6b4410a570de06d..20e58b61e21c4bf0bcdac8a61318a15cebace630 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2006--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2006--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
 (define (page-translate-systems page)
   (for-each
 
-   (lambda (sys-off)
-     (let*
-         ((sys (car sys-off))
-          (off (cadr sys-off)))
+   (lambda (sys off)
+     (if (not (number? (ly:prob-property sys 'Y-offset)))
+         (ly:prob-set-property! sys 'Y-offset 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))))
+   (page-property page 'lines)
+   (page-property page 'configuration)))
 
 (define (annotate-top-space first-system layout header-stencil stencil)
   (let* ((top-margin (ly:output-def-lookup layout 'top-margin))
           (ly:stencil-add stencil
                           (ly:stencil-translate-axis
                            (annotate-spacing-spec layout
+                                                  (symbol->string sym)
                                                   spacing-spec
                                                   (- top-margin)
                                                   (car header-extent)
                                                        system-separator-markup)
                                      #f))
 
-       (page-stencil (ly:make-stencil '()))
+       (page-stencil empty-stencil)
 
        (last-system #f)
        (last-y 0.0)
        (add-system
         (lambda (system)
           (let* ((stencil (paper-system-stencil system))
-                 (y (ly:prob-property system 'Y-offset 0))
+                 (extra-offset (ly:prob-property system 'extra-offset '(0 . 0)))
+                 (x (+ (ly:prob-property system 'X-offset 0.0)
+                       (car extra-offset)))
+                 (y (+ (ly:prob-property system 'Y-offset 0.0)
+                       (cdr extra-offset)))
                  (is-title (paper-system-title?
                             system)))
-            (add-to-page stencil
-                         (ly:prob-property system 'X-offset 0.0)
-                         y)
+            (add-to-page stencil x y)
             (if (and (ly:stencil? system-separator-stencil)
                      last-system
                      (not (paper-system-title? system))