]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/paper.scm
Use my_round from libc-extension instead of casting.
[lilypond.git] / scm / paper.scm
index 117bbb0fffb0bcbfd2048b4e9584a54f088b23bd..bc6e2e19448189648db604614c3c3a11e54c598a 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2004--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2004--2011 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
@@ -20,8 +20,6 @@
                  '(blot-diameter
                    bottom-margin
                    cm
-                   foot-separation
-                   head-separation
                    horizontal-shift
                    in
                    indent
@@ -69,7 +67,9 @@
        (setm! (lambda (sym val)
                (module-define! module sym val))))
 
-    (setm! 'text-font-size (* 12 factor))
+    ;; Synchronized with the `text-font-size'
+    ;; binding in add-pango-fonts (see font.scm).
+    (setm! 'text-font-size (* 11 factor))
 
     (setm! 'output-scale ss)
     (setm! 'fonts (make-century-schoolbook-tree factor))
     ))
 
 (define-public (layout-set-absolute-staff-size sz)
-  "Function to be called inside a \\layout{} block to set the staff
-size. SZ is in points"
+  "Set the absolute staff size inside of a @code{\\layout@{@}} block.
+@var{sz} is in points."
   (layout-set-absolute-staff-size-in-module (current-module) sz))
 
 (define-public (layout-set-staff-size sz)
-  "Function to be called inside a \\layout{} block to set the staff
-size. SZ is in points"
+  "Set the staff size inside of a @code{\\layout@{@}} block.
+@var{sz} is in points."
 
   (layout-set-absolute-staff-size (* (eval 'pt (current-module)) sz)))
 
@@ -249,8 +249,6 @@ size. SZ is in points"
                           (("binding-offset" . ,w) . '())
                           (("top-margin" . ,h) . '())
                           (("bottom-margin" . ,h) . '())
-                          (("head-separation" . ,h) . '())
-                          (("foot-separation" . ,h) . '())
                           (("indent" . ,w) . '())
                           (("short-indent" . ,w) . '())))
        (scaled-values
@@ -324,11 +322,12 @@ size. SZ is in points"
       ;;; that in parse-scm.cc
       (ly:warning (_ "Must use #(set-paper-size .. ) within \\paper { ... }"))))
 
-(define-public (scale-layout pap scale)
-  (let* ((new-pap (ly:output-def-clone pap))
-        (dim-vars (ly:output-def-lookup pap 'dimension-variables))
-        (old-scope (ly:output-def-scope pap))
-        (scope (ly:output-def-scope new-pap)))
+(define-public (scale-layout paper scale)
+  "Return a clone of the paper, scaled by the given scale factor."
+  (let* ((new-paper (ly:output-def-clone paper))
+        (dim-vars (ly:output-def-lookup paper 'dimension-variables))
+        (old-scope (ly:output-def-scope paper))
+        (scope (ly:output-def-scope new-paper)))
 
     (for-each
      (lambda (v)
@@ -336,13 +335,10 @@ size. SZ is in points"
              (val (if (variable? var) (variable-ref var) #f)))
 
         (if (number? val)
-            (module-define! scope v
-                            (/ val scale))
-
-            ;; spurious warnings, eg. for paper-width, paper-height.
-            ;; (ly:warning (_ "not a number, ~S = ~S " v  val))
+            (module-define! scope v (/ val scale))
+            ;; Cannot warn for non-numbers, eg. for paper-width, paper-height.
             )))
-
      dim-vars)
-
-    new-pap))
+    ;; Mark the clone.
+    (ly:output-def-set-variable! new-paper 'cloned #t)
+    new-paper))