]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/paper.scm (set-paper-dimensions): Preliminary support for
authorPedro Kroger <kroeger@pedrokroeger.net>
Sun, 25 Jul 2004 14:55:58 +0000 (14:55 +0000)
committerPedro Kroger <kroeger@pedrokroeger.net>
Sun, 25 Jul 2004 14:55:58 +0000 (14:55 +0000)
left and right margins.

* Documentation/user/changing-defaults.itely (Page layout):
Explain the leftmargin option.

  * Rename a few dashed functions in and scm/page-layout.scm and
    scm/paper.scm not to have dashes.

ChangeLog
Documentation/user/changing-defaults.itely
scm/page-layout.scm
scm/paper.scm

index 0e0c8693dd96301d9d3629a0b19444857d4f6bbb..faab1a198ba4c90fcb62d62136dba75ff25915c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-25  Pedro Kroger  <kroeger@pedrokroeger.net>
+
+       * scm/paper.scm (set-paper-dimensions): Preliminary support for
+       left and right margins.
+
+       * Documentation/user/changing-defaults.itely (Page layout):
+       Explain the leftmargin option.
+
 2004-07-25  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * input/test/lyrics-melisma-variants.ly (texidoc): new file.
index 8e0a4e0990b8c46965debf67159ba32c20e665a4..a8d1ab0fb4aa2d77ac5e20c3671d14ee3ed9e51e 100644 (file)
@@ -2206,6 +2206,10 @@ The default layout responds to the following settings in the
  Margin between header and top of the page
 @item bottommargin
  Margin between footer and bottom of the page
+@item leftmargin
+ Margin between the left side of the page and the beginning  of the music.
+@item linewidth
+ The length of the paper line.
 @item headsep
  Distance between top-most music system and the page header
 @item footsep
@@ -2225,23 +2229,23 @@ The default layout responds to the following settings in the
         @}
 @end example
 
-You can also define these values in scheme. Please note that if you
-define @code{topmargin}, @code{bottommargin}, @code{headsep}, and
-@code{footsep} in scheme you have to insert a dash so they become
-@code{top-margin}, @code{bottom-margin}, @code{head-sep}, and
-@code{foot-sep}.
+You can also define these values in scheme. In that case @code{mm},
+@code{in}, @code{pt} and @code{cm} are variables defined in
+@file{book-paper-defaults.ly} with values in millimeters. That's why the
+value has to be multiplied in the example above.
 
 @example
         \bookpaper@{
-        #(define bottom-margin (* 2 cm)) 
+        #(define bottommargin (* 2 cm)) 
         @}
 @end example
 
-@c is this explanations really necessary?
-In that case @code{mm}, @code{in}, @code{pt} and @code{cm} are variables
-defined in @file{book-paper-defaults.ly} with values in
-millimeters. That's why the value has to be multiplied in the example
-above.
+
+@refbugs
+
+The option rightmargin is defined but doesn't set the right margin
+yet. The value for the right margin has to be defined adjusting the
+values of the leftmargin and linewidth.
 
 The default page header puts the page number and the @code{instrument}
 field from the @code{\header} block on a line.
index 3f9a9baa2ccc4922d7a2aa4edded8a9d38a0e378..3e9ec78197156bf32454908b0c61a490d8412219 100644 (file)
   "Printable area for music and titles; matches default-page-make-stencil." 
   (let*
       ((h (- (ly:output-def-lookup paper 'vsize)
-            (ly:output-def-lookup paper 'top-margin)
-            (ly:output-def-lookup paper 'bottom-margin)))
-       (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
-       (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?)))
+            (ly:output-def-lookup paper 'topmargin)
+            (ly:output-def-lookup paper 'bottommargin)))
+       (head (page-headfoot paper scopes number 'make-header 'headsep UP last?))
+       (foot (page-headfoot paper scopes number 'make-footer 'footsep DOWN last?)))
     (- h (if (ly:stencil? head)
             (interval-length (ly:stencil-extent head Y))
             0)
 (define-public (default-page-make-stencil lines paper scopes number last? )
   "Construct a stencil representing the page from LINES.  "
   (let*
-     ((top-margin  (ly:output-def-lookup paper 'top-margin))
+     ((topmargin  (ly:output-def-lookup paper 'topmargin))
       
       ;; TODO: naming vsize/hsize not analogous to TeX.
       
-      (hsize (ly:output-def-lookup paper 'hsize))
-      (left-margin (/ (- hsize
-                        (ly:output-def-lookup paper 'linewidth)) 2))
+      (leftmargin (ly:output-def-lookup paper 'leftmargin))
+      (rightmargin (ly:output-def-lookup paper 'rightmargin))
       (vsize (ly:output-def-lookup paper 'vsize))
+      (hsize (ly:output-def-lookup paper 'hsize))
       (bottom-edge (- vsize
-                     (ly:output-def-lookup paper 'bottom-margin)))
+                     (ly:output-def-lookup paper 'bottommargin)))
                     
-      (head (page-headfoot paper scopes number 'make-header 'head-sep UP last?))
-      (foot (page-headfoot paper scopes number 'make-footer 'foot-sep DOWN last?))
+      (head (page-headfoot paper scopes number 'make-header 'headsep UP last?))
+      (foot (page-headfoot paper scopes number 'make-footer 'footsep DOWN last?))
       (line-stencils (map ly:paper-system-stencil lines))
       (height-proc (ly:output-def-lookup paper 'page-music-height))
       (music-height (height-proc paper scopes number last?))
                   (/ spc-left (length stretchable-lines))))
 
       (page-stencil (ly:make-stencil '()
-                   (cons left-margin hsize)
-                   (cons (- top-margin) 0)))
+                   (cons leftmargin hsize)
+                   (cons (- topmargin) 0)))
       (was-title #t))
 
     (set! page-stencil (ly:stencil-combine-at-edge
                      (+ (- bottom-edge) (- (car (ly:stencil-extent foot Y)))))
                ))))
 
-    (ly:stencil-translate page-stencil (cons left-margin 0))
+    (ly:stencil-translate page-stencil (cons leftmargin 0))
   ))
   
 
index 1904db71c0351f1361a6d003d6fae986cf6e3884..501d7d187cb99ac39b63086db79dfe6fc3bbc46f 100644 (file)
@@ -28,7 +28,7 @@
                    '(pt mm cm in staffheight staff-space
                         linewidth indent hsize vsize
                         staffspace linethickness ledgerlinethickness
-                        blotdiameter interscoreline))
+                        blotdiameter interscoreline leftmargin rightmargin))
     ))
 
 (define-public (set-global-staff-size sz)
     (module-define! m 'indent (/ w 14))
 
     ;; page layout - what to do with (printer specific!) margin settings?
-    (module-define! m 'top-margin (* 5 mm))
-    (module-define! m 'bottom-margin (* 6 mm))
-    (module-define! m 'head-sep (* 4 mm))
-    (module-define! m 'foot-sep (* 4 mm))))
+    (module-define! m 'topmargin (* 5 mm))
+    (module-define! m 'bottommargin (* 6 mm))
+    (module-define! m 'headsep (* 4 mm))
+    (module-define! m 'footsep (* 4 mm))
+    (module-define! m 'leftmargin (* 10 mm))
+    (module-define! m 'rightmargin (* 10 mm))))
 
 (define (internal-set-paper-size module name)
   (let* ((entry (assoc name paper-alist))