diff --git a/quad/quad/quad.rkt b/quad/quad/quad.rkt index e5207f97..0e8f2f1d 100644 --- a/quad/quad/quad.rkt +++ b/quad/quad/quad.rkt @@ -5,9 +5,9 @@ (define (default-size-proc q sig) (match (elems q) - [(list (? char-whitespace? c)) (case sig - [(start end) '(0 0)] - [else '(1 1)])] + [(list (? (λ (x) (and (char? x) (char-whitespace? x))) c)) (case sig + [(start end) '(0 0)] + [else '(1 1)])] [else '(1 1)])) (struct $quad (attrs elems) #:transparent #:mutable diff --git a/quad/quad/typewriter.rkt b/quad/quad/typewriter.rkt index 94c2bc8e..717e1cc9 100644 --- a/quad/quad/typewriter.rkt +++ b/quad/quad/typewriter.rkt @@ -20,18 +20,12 @@ (wrap xs size debug #:break-val (break #\newline) #:optional-break-proc optional-break? - #:size-proc (λ (q) (let ([val (hash-ref (attrs q) 'size (λ () - (if (memv (car (elems q)) '(#\space)) - (delay (values 0 7.2 0)) - (delay (values 7.2 7.2 7.2)))))]) - (if (promise? val) (force val) (val)))) #:finish-segment-proc (λ (pcs) (list ($line (hasheq) (map charify pcs)))))) (define (pbs xs size [debug #f]) (wrap xs size debug #:break-val (break #\page) #:optional-break-proc $break? - #:size-proc (λ (q) (force (hash-ref (attrs q) 'size (λ () (delay (values 12 12 12)))))) #:finish-segment-proc (λ (pcs) (list ($page (hasheq) (filter-not $break? pcs)))))) (define (typeset args)