diff --git a/quad/qtest/test-kafka-tester.pdf b/quad/qtest/test-kafka-tester.pdf index 74a2602e..bb2d081e 100644 Binary files a/quad/qtest/test-kafka-tester.pdf and b/quad/qtest/test-kafka-tester.pdf differ diff --git a/quad/quadwriter/page.rkt b/quad/quadwriter/page.rkt index 811e6f5d..47e226df 100644 --- a/quad/quadwriter/page.rkt +++ b/quad/quadwriter/page.rkt @@ -57,15 +57,18 @@ (define (make-footer-quad col-q page-idx path) (define-values (dir name _) (split-path (path-replace-extension path #""))) - (define attrs (let ([attrs (make-hasheq)]) + (define attrs (let ([attrs (make-hasheq)] + [cltq (current-top-level-quad)]) (hash-set*! attrs :footer-text (quad-ref col-q :footer-text) :page-number (+ (quad-ref col-q :page-number-start (add1 (section-pages-used))) (sub1 page-idx)) :doc-title (string-titlecase (path->string name)) - :font-size (* 0.8 (quad-ref col-q :font-size default-font-size)) - :line-height (quad-ref col-q :line-height default-line-height) - :font-family "text") - (resolve-font-path! attrs) + ;; we get font & line-height from cltq + ;; because these are not block attrs + ;; so they are not propagated upward from col-q + :font-size (* 0.8 (quad-ref cltq :font-size)) + :line-height (quad-ref cltq :line-height) + :font-path (quad-ref cltq :font-path)) attrs)) (make-quad #:size (pt 50 default-line-height) #:attrs attrs diff --git a/quad/quadwriter/param.rkt b/quad/quadwriter/param.rkt index c90e5fb1..a97c45b9 100644 --- a/quad/quadwriter/param.rkt +++ b/quad/quadwriter/param.rkt @@ -4,6 +4,7 @@ (define current-pdf (make-parameter #false)) (define current-line-wrap (make-parameter #f)) ; because kp is slow and maybe we want to disable for "draft" mode +(define current-top-level-quad (make-parameter #f)) (define section-pages-used (make-parameter 0)) (define quadwriter-test-mode (make-parameter #f)) ; used during rackunit to suppress nondeterministic elements, like timestamp in header diff --git a/quad/quadwriter/render.rkt b/quad/quadwriter/render.rkt index f3896ff9..69203275 100644 --- a/quad/quadwriter/render.rkt +++ b/quad/quadwriter/render.rkt @@ -172,10 +172,20 @@ ;; convert our input Q-expression into a useful form. ;; some typographic niceties - (define qexpr (decode qx-arg + (define qexpr + (let ([qx (decode qx-arg #:string-proc (compose1 smart-ellipses smart-dashes) - #:txexpr-proc smart-quotes)) - + #:txexpr-proc smart-quotes)]) + (match qx + [(list tag attrs elements ...) + ;; we insert a dummy element "◊" (irrelevant what it is) + ;; to get a sample of the global attrs + ;; which we will strip off after atomization + ;; but keep the attrs around in case anyone needs to use them + ;; for instance, quads added to the layout like footers + ;; won't have another way of getting this + (list* tag attrs (cons "◊" elements))]))) + ;; apply some default styling attributes. ;; These will only be used if the underlying q-expression hasn't specified its own values, ;; which will naturally override these. @@ -194,6 +204,10 @@ #:emoji "fallback-emoji" #:math "fallback-math" #:font-path-resolver resolve-font-path!)] + [qs (let () + ;; store the dummy element and discard + (current-top-level-quad (car qs)) + (cdr qs))] [qs (time-log hyphenate (apply append (map handle-hyphenate qs)))] [qs (map generic->typed-quad qs)] [qs (drop-leading-breaks qs)]