better offset idea

main
Matthew Butterick 6 years ago
parent da85dd3e0b
commit fa76b65de7

@ -2,7 +2,7 @@
# Hyphenate # Hyphenate
A **simple** _hyphenation engine_ that uses the KnuthLiang hyphenation algorithm originally developed for TeX. A simple _hyphenation engine_ that uses the KnuthLiang hyphenation algorithm originally developed for TeX.
I **have added little** to their work. Accordingly, I take no credit, except a spoonful of *snako-bits.* I **have added little** to their work. Accordingly, I take no credit, except a spoonful of *snako-bits.*

@ -108,7 +108,6 @@
#:in 'nw #:in 'nw
#:inner 'sw ; puts baseline at lower right corner of line box #:inner 'sw ; puts baseline at lower right corner of line box
#:out 'sw #:out 'sw
#:offset (pt 4 -6)
#:printable #true #:printable #true
#:draw (λ (q doc) #:draw (λ (q doc)
(draw-debug q doc) (draw-debug q doc)
@ -199,7 +198,9 @@
(pt-y (size pc))))) (pt-y (size pc)))))
#:pre-draw (λ (q doc) #:pre-draw (λ (q doc)
(save doc) (save doc)
(apply rect doc (append (quad-origin q) (size q))) (match-define (list left top) (quad-origin q))
(match-define (list right bottom) (size q))
(rect doc (- left 4) (+ top 6) right (+ bottom 2))
(line-width doc 1) (line-width doc 1)
(fill-and-stroke doc "#eee" "#999") (fill-and-stroke doc "#eee" "#999")
(restore doc)))) (restore doc))))

Loading…
Cancel
Save