X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fpaper.scm;h=93566d5e453548c455924a3ead9be7d70c02ba08;hb=43516525d4320a6d1af0c659c8e9036f6283faf7;hp=117bbb0fffb0bcbfd2048b4e9584a54f088b23bd;hpb=bc95f4434f760d41191341ab4508b2064eb19025;p=lilypond.git diff --git a/scm/paper.scm b/scm/paper.scm index 117bbb0fff..93566d5e45 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -69,7 +69,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)) @@ -324,25 +326,23 @@ 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) (let* ((var (module-variable old-scope v)) (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))