+ ((pt (eval 'pt module))
+ (ss (/ staff-height 4))
+ (factor (/ staff-height (* 20 pt)))
+ (setm! (lambda (sym val)
+ (module-define! module sym val))))
+
+ ;; 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))
+ (setm! 'staff-height staff-height)
+ (setm! 'staff-space ss)
+
+ (setm! 'line-thickness (calc-line-thickness ss pt))
+
+ ;; sync with feta
+ (setm! 'ledger-line-thickness (+ (* 0.5 pt) (/ ss 10)))
+
+ ;; sync with feta
+ (setm! 'blot-diameter (* 0.4 pt))
+ ))
+
+(define-public (layout-set-absolute-staff-size sz)
+ "Set the absolute staff size inside of a @code{\\layout@{@}} block.
+@var{sz} is in points."
+ (layout-set-absolute-staff-size-in-module (current-module) sz))
+
+(define-public (layout-set-staff-size sz)
+ "Set the staff size inside of a @code{\\layout@{@}} block.
+@var{sz} is in points."
+
+ (layout-set-absolute-staff-size (* (eval 'pt (current-module)) sz)))
+
+(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)))
+
+ ;; maybe not necessary.
+ ;; but let's be paranoid. Maybe someone still refers to the
+ ;; old one.
+ (new-paper (ly:output-def-clone pap))
+
+ (new-scope (ly:output-def-scope new-paper)))
+
+ (if in-layout?
+ (ly:warning (_ "set-global-staff-size: not in toplevel scope")))
+
+ (layout-set-absolute-staff-size-in-module new-scope
+ (* sz (eval 'pt new-scope)))
+ (module-define! current-mod '$defaultpaper new-paper)))
+
+(define-public paper-alist
+
+ ;; don't use decimals.
+ ;; ISO 216 has a tolerance of +- 2mm
+
+ ;; TODO Autogenerate the following list so it appears under the
+ ;; 'Predefined paper sizes' node in notation-appendices.itely
+ ;; currently the list below has been copied and formatted manually.
+ ;; Therefore, please add any new entries to the *itely file as well.
+
+ '(("a10" . (cons (* 26 mm) (* 37 mm)))
+ ("a9" . (cons (* 37 mm) (* 52 mm)))
+ ("a8" . (cons (* 52 mm) (* 74 mm)))
+ ("a7" . (cons (* 74 mm) (* 105 mm)))
+ ("a6" . (cons (* 105 mm) (* 148 mm)))
+ ("a5" . (cons (* 148 mm) (* 210 mm)))
+ ("a4" . (cons (* 210 mm) (* 297 mm)))
+ ("a3" . (cons (* 297 mm) (* 420 mm)))
+ ("a2" . (cons (* 420 mm) (* 594 mm)))
+ ("a1" . (cons (* 594 mm) (* 841 mm)))
+ ("a0" . (cons (* 841 mm) (* 1189 mm)))
+ ("b10" . (cons (* 31 mm) (* 44 mm)))
+ ("b9" . (cons (* 44 mm) (* 62 mm)))
+ ("b8" . (cons (* 62 mm) (* 88 mm)))
+ ("b7" . (cons (* 88 mm) (* 125 mm)))
+ ("b6" . (cons (* 125 mm) (* 176 mm)))
+ ("b5" . (cons (* 176 mm) (* 250 mm)))
+ ("b4" . (cons (* 250 mm) (* 353 mm)))
+ ("b3" . (cons (* 353 mm) (* 500 mm)))
+ ("b2" . (cons (* 500 mm) (* 707 mm)))
+ ("b1" . (cons (* 707 mm) (* 1000 mm)))
+ ("b0" . (cons (* 1000 mm) (* 1414 mm)))
+ ;; Below are two extended sizes defined in DIn 476
+ ("4a0" . (cons (* 1682 mm) (* 2378 mm)))
+ ("2a0" . (cons (* 1189 mm) (* 1682 mm)))
+ ;; Below are ISO 269 standard C series
+ ("c10" . (cons (* 28 mm) (* 40 mm)))
+ ("c9" . (cons (* 40 mm) (* 57 mm)))
+ ("c8" . (cons (* 57 mm) (* 81 mm)))
+ ("c7" . (cons (* 81 mm) (* 114 mm)))
+ ("c6" . (cons (* 114 mm) (* 162 mm)))
+ ("c5" . (cons (* 162 mm) (* 229 mm)))
+ ("c4" . (cons (* 229 mm) (* 324 mm)))
+ ("c3" . (cons (* 324 mm) (* 458 mm)))
+ ("c2" . (cons (* 458 mm) (* 648 mm)))
+ ("c1" . (cons (* 648 mm) (* 917 mm)))
+ ("c0" . (cons (* 917 mm) (* 1297 mm)))
+ ;; Below are North American paper sizes
+ ("junior-legal" . (cons (* 8.0 in) (* 5.0 in)))
+ ("legal" . (cons (* 8.5 in) (* 14.0 in)))