;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
(use-modules (scm safe-utility-defs))
(define-public (set-paper-dimension-variables mod)
(module-define! mod 'dimension-variables
(use-modules (scm safe-utility-defs))
(define-public (set-paper-dimension-variables mod)
(module-define! mod 'dimension-variables
;; Synchronized with the `text-font-size'
;; binding in add-pango-fonts (see font.scm).
(setm! 'text-font-size (* 11 factor))
(setm! 'output-scale ss)
;; Synchronized with the `text-font-size'
;; binding in add-pango-fonts (see font.scm).
(setm! 'text-font-size (* 11 factor))
(setm! 'output-scale ss)
(define-safe-public (set-global-staff-size sz)
"Set the default staff size, where SZ is thought to be in PT."
(let* ((current-mod (current-module))
(define-safe-public (set-global-staff-size sz)
"Set the default staff size, where SZ is thought to be in PT."
(let* ((current-mod (current-module))
- (parser (eval 'parser current-mod))
- (pap (ly:parser-lookup parser '$defaultpaper))
- (in-layout? (or (module-defined? current-mod 'is-paper)
- (module-defined? current-mod 'is-layout)))
+ (pap (ly:parser-lookup '$defaultpaper))
+ (in-layout? (or (module-defined? current-mod 'is-paper)
+ (module-defined? current-mod 'is-layout)))
- ;; maybe not necessary.
- ;; but let's be paranoid. Maybe someone still refers to the
- ;; old one.
- (new-paper (ly:output-def-clone pap))
+ ;; maybe not necessary.
+ ;; but let's be paranoid. Maybe someone still refers to the
+ ;; old one.
+ (new-paper (ly:output-def-clone pap))
where @var{landscape?} specifies whether the dimensions should be swapped
unless explicitly overriden in the name."
(let* ((swapped?
where @var{landscape?} specifies whether the dimensions should be swapped
unless explicitly overriden in the name."
(let* ((swapped?
- (cond ((string-suffix? "landscape" name)
- (set! name
- (string-trim-right (string-drop-right name 9)))
- #t)
- ((string-suffix? "portrait" name)
- (set! name
- (string-trim-right (string-drop-right name 8)))
- #f)
- (else landscape?)))
- (is-paper? (module-defined? module 'is-paper))
- (entry (and is-paper?
+ (cond ((string-suffix? "landscape" name)
+ (set! name
+ (string-trim-right (string-drop-right name 9)))
+ #t)
+ ((string-suffix? "portrait" name)
+ (set! name
+ (string-trim-right (string-drop-right name 8)))
+ #f)
+ (else landscape?)))
+ (is-paper? (module-defined? module 'is-paper))
+ (entry (and is-paper?
;; Output_def::normalize () needs to know
;; whether the user set the value or not.
(scaleable-values '(("left-margin" #f . #t)
;; Output_def::normalize () needs to know
;; whether the user set the value or not.
(scaleable-values '(("left-margin" #f . #t)
- ("right-margin" #f . #t)
- ("inner-margin" #f . #t)
- ("outer-margin" #f . #t)
- ("binding-offset" #f . #f)
- ("top-margin" #t . #f)
- ("bottom-margin" #t . #f)
- ("indent" #f . #f)
- ("short-indent" #f . #f)))
+ ("right-margin" #f . #t)
+ ("inner-margin" #f . #t)
+ ("outer-margin" #f . #t)
+ ("binding-offset" #f . #f)
+ ("top-margin" #t . #f)
+ ("bottom-margin" #t . #f)
+ ("indent" #f . #f)
+ ("short-indent" #f . #f)))
(ly:warning (_ "This is not a \\layout {} object, ~S") module))
(entry
(set-paper-dimensions module (car entry) (cdr entry) landscape?)
(ly:warning (_ "This is not a \\layout {} object, ~S") module))
(entry
(set-paper-dimensions module (car entry) (cdr entry) landscape?)
(define-public (set-paper-size name . rest)
(if (module-defined? (current-module) 'is-paper)
(internal-set-paper-size (current-module) name
(define-public (set-paper-size name . rest)
(if (module-defined? (current-module) 'is-paper)
(internal-set-paper-size (current-module) name
(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))
(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)))
+ (dim-vars (ly:output-def-lookup paper 'dimension-variables))
+ (old-scope (ly:output-def-scope paper))
+ (scope (ly:output-def-scope new-paper)))
- (if (number? val)
- (module-define! scope v (/ val scale))
- ;; Cannot warn for non-numbers, eg. for paper-width, paper-height.
- )))
+ (if (number? val)
+ (module-define! scope v (/ val scale))
+ ;; Cannot warn for non-numbers, eg. for paper-width, paper-height.
+ )))