]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/paper.scm
output-distance: don't barf if either to be compared PNG is borked.
[lilypond.git] / scm / paper.scm
index 19e92824cb5014eb8c56dff0e4c8e1b07e3a982b..6c0c031c02aa1ccb905dac3d9fddc358eb37afe1 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2004--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 (define-public (set-paper-dimension-variables mod)
   (module-define! mod 'dimension-variables
     (module-define! old-mod '$defaultpaper new-paper)))
 
 (define-public paper-alist
-  '(("a7" . (cons (* 74.48 mm) (* 105 mm)))
-    ("a6" . (cons (* 105 mm) (* 148.95 mm)))
-    ("a5" . (cons (* 148.95 mm) (* 210 mm)))
-    ("a4" . (cons (* 210 mm) (* 297.9 mm)))
-    ("a3" . (cons (* 297.9 mm) (* 420 mm)))
+
+  ;; don't use decimals.
+  ;; ISO 216 has a tolerance of +- 2mm
+  
+  '(("a7" . (cons (* 74 mm) (* 105 mm)))
+    ("a6" . (cons (* 105 mm) (* 148 mm)))
+    ("a5" . (cons (* 148 mm) (* 210 mm)))
+    ("a4" . (cons (* 210 mm) (* 297 mm)))
+    ("a3" . (cons (* 297 mm) (* 420 mm)))
     ("legal" . (cons (* 8.5 in) (* 14.0 in)))
     ("letter" . (cons (* 8.5 in) (* 11.0 in)))
     ("11x17" . (cons (* 11.0 in) (* 17.0 in)))
   (let* ((mm (eval 'mm m)))
     (module-define! m 'paper-width w)
     (module-define! m 'paper-height h)
-    (module-define! m 'line-width (- w (* 20 mm)))
+    (module-define! m 'line-width (- w
+                                    (ly:modules-lookup (list m) 'left-margin (* 10 mm))
+                                    (ly:modules-lookup (list m) 'right-margin (* 10 mm))))
+
     (module-define! m 'indent (/ w 14))
 
     ;; page layout - what to do with (printer specific!) margin settings?
       (set-paper-dimensions module (car entry) (cdr entry))
 
       (module-define! module 'papersizename name)
-
-      (if landscape?
-         (module-define! module 'landscape #t)))
+      (module-define! module 'landscape 
+                     (if landscape? #t #f)))
      (else
-      (ly:warning (_ ("Unknown papersize: ~a" name)))))))
+      (ly:warning (_ "Unknown papersize: ~a" name))))))
 
 (define-safe-public (set-default-paper-size name . rest)
   (internal-set-paper-size