use slicef-after

main
Matthew Butterick 10 years ago
parent 44a806bde5
commit 08a4e770dc

@ -194,7 +194,7 @@
(coerce/input? . -> . doc?)
(cond
[(input? x) (load-text-cache-file)
(define multipages (time (input->multipages x))) ; 125 = timings for jude0
(define multipages (input->multipages x)) ; 125 = timings for jude0
(define pages (append-map typeset multipages)) ; 1446
(define doc (typeset pages)) ; 250
(update-text-cache-file)
@ -221,7 +221,7 @@
(require "render.rkt" racket/class profile)
(require "samples.rkt")
(activate-logger quad-logger)
(parameterize ([world:quality-default world:adaptive-quality]
(parameterize ([world:quality-default world:draft-quality]
[world:paper-width-default 600]
[world:paper-height-default 700])
(define to (begin (time (typeset (jude0)))))

@ -69,8 +69,7 @@
(quads? . -> . pieces?)
(define-values (breakable-items items-to-make-unbreakable) (split-at-right qs (min world:minimum-last-line-chars (length qs))))
(define unbreak-qs (append breakable-items (map make-unbreakable items-to-make-unbreakable)))
(define lists-of-quads (slicef-at unbreak-qs (λ(q) (or (not (possible-word-break-quad? q))
(quad-attr-ref q world:unbreakable-key #f)))))
(define lists-of-quads (slicef-after unbreak-qs (λ(q) (and (possible-word-break-quad? q) (not (quad-attr-ref q world:unbreakable-key #f))))))
(define-values (first-lists-of-quads last-list-of-quads) (split-last lists-of-quads))
(define (make-first-pieces qs)
(let-values ([(first-qs last-q) (split-last qs)])

Loading…
Cancel
Save