From c3278d5aa51b5b9681a9b04ad464628b84372182 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Thu, 23 May 2019 21:43:37 -0700 Subject: [PATCH] don't step on top-level attrs --- quad/quadwriter/core.rkt | 3 ++- quad/quadwriter/tags.rkt | 12 ++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/quad/quadwriter/core.rkt b/quad/quadwriter/core.rkt index 42867c4e..4cdfdf10 100644 --- a/quad/quadwriter/core.rkt +++ b/quad/quadwriter/core.rkt @@ -606,7 +606,8 @@ (define qs (let* ([qx qx-arg] [qx (replace-breaks qx)] [qx (qexpr->quad `(q ((font-family ,default-font-family) - (font-size ,(number->string default-font-size))) ,qx))]) + (font-size ,(number->string default-font-size)) + (line-height ,(number->string (floor (* 1.42 default-font-size))))) ,qx))]) (setup-font-path-table! pdf-path) (parameterize ([current-missing-glyph-action 'fallback]) (time-name atomize (atomize qx #:attrs-proc handle-cascading-attrs diff --git a/quad/quadwriter/tags.rkt b/quad/quadwriter/tags.rkt index 5178760d..b9abe72e 100644 --- a/quad/quadwriter/tags.rkt +++ b/quad/quadwriter/tags.rkt @@ -11,16 +11,8 @@ (provide (all-defined-out)) (define (root attrs exprs) - (qexpr (append `(#;(first-line-indent "12") - #;(line-align "center") - #;(line-wrap "kp") - (page-margin-left "120") ; by default, is mirrored to right - #;(page-margin-right "200") - (page-margin-top "80") - (page-margin-bottom "120") - (font-family "default-serif") - (line-height "17") - #;(line-align-last "center")) attrs) exprs)) + ;; don't put any attributes in root, so they can be overriden by top-level attributes in source + (qexpr attrs exprs)) (define-tag-function (p attrs exprs) ;; no font-family so that it adopts whatever the surrounding family is