resume in tw

main
Matthew Butterick 7 years ago
parent b2a327ef99
commit 926ec47828

@ -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

@ -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)

Loading…
Cancel
Save