diff --git a/quad/qtest/typewriter.rkt b/quad/qtest/typewriter.rkt index 4d7e2ff1..cf4fc908 100644 --- a/quad/qtest/typewriter.rkt +++ b/quad/qtest/typewriter.rkt @@ -54,13 +54,13 @@ (define str (car (quad-elems q))) (font-size doc fontsize) (font doc (path->string charter)) - (list + (pt (string-width doc str) (current-line-height doc)))])) (define line-height 16) (define $line (q #:attrs (hasheq 'type "line") - #:size (list +inf.0 line-height) + #:size (pt +inf.0 line-height) #:out 'sw #:printable #true)) (define $page (q #:attrs (hasheq 'type "page") @@ -95,7 +95,7 @@ [attrs (quad-attrs (car pcs))] [elems (merge-adjacent-strings (apply append (for/list ([pc (in-list run-pcs)]) (quad-elems pc))))] - [size (delay (list (for/sum ([pc (in-list run-pcs)]) + [size (delay (pt (for/sum ([pc (in-list run-pcs)]) (pt-x (size pc))) (pt-y (size (car pcs)))))])) (values (cons new-run runs) rest))) diff --git a/quad/quad/atomize.rkt b/quad/quad/atomize.rkt index f1d10d2f..a067decd 100644 --- a/quad/quad/atomize.rkt +++ b/quad/quad/atomize.rkt @@ -104,13 +104,13 @@ (define (runify qx) ;; runify a quad by reducing it to a series of "runs", ;; which are multi-character quads with the same formatting. - (define first-key (eq-hash-code (current-default-attrs))) + (define first-run-idx (eq-hash-code (current-default-attrs))) (define first-attrs (hash-copy (current-default-attrs))) - (hash-set! first-attrs 'idx first-key) + (hash-set! first-attrs run-key first-run-idx) (dropf (let loop ([x (if (string? qx) (make-quad #f (list qx)) qx)] [attrs first-attrs] - [key first-key]) + [key first-run-idx]) (match x [(? quad?) ;; qexprs with attributes are recursed (define this-attrs (quad-attrs x))