+ (let*
+ ;; page layout - what to do with (printer specific!) margin settings?
+ ((paper-default (or (lookup-paper-name
+ m (ly:get-option 'paper-size) landscape?)
+ (cons w h)))
+ ;; Horizontal margins, marked with #t in the cddr, are stored
+ ;; in renamed variables because they must not be overwritten.
+ ;; The cadr indicates whether a value is a vertical dimension.
+ ;; 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)))
+ (scaled-values
+ (map
+ (lambda (entry)
+ (let ((entry-symbol
+ (string->symbol
+ (string-append (car entry) "-default")))
+ (vertical? (cadr entry)))
+ (cons (if (cddr entry)
+ (string-append (car entry) "-default-scaled")
+ (car entry))
+ (round (* (if vertical? h w)
+ (/ (eval-carefully entry-symbol m 0)
+ ((if vertical? cdr car)
+ paper-default)))))))
+ scaleable-values)))
+