From: Pedro Kroger Date: Sun, 25 Jul 2004 14:55:58 +0000 (+0000) Subject: * scm/paper.scm (set-paper-dimensions): Preliminary support for X-Git-Tag: release/2.3.10~49 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=17efceee923ea5f02abfdccb3b7635cd97e177ce;p=lilypond.git * scm/paper.scm (set-paper-dimensions): Preliminary support for 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. --- diff --git a/ChangeLog b/ChangeLog index 0e0c8693dd..faab1a198b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-07-25 Pedro Kroger + + * 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 * input/test/lyrics-melisma-variants.ly (texidoc): new file. diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index 8e0a4e0990..a8d1ab0fb4 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -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. diff --git a/scm/page-layout.scm b/scm/page-layout.scm index 3f9a9baa2c..3e9ec78197 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -108,10 +108,10 @@ "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) @@ -124,19 +124,19 @@ (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?)) @@ -157,8 +157,8 @@ (/ 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 @@ -187,7 +187,7 @@ (+ (- 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)) )) diff --git a/scm/paper.scm b/scm/paper.scm index 1904db71c0..501d7d187c 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -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) @@ -72,10 +72,12 @@ (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))