better offset idea

main
Matthew Butterick 6 years ago
parent da85dd3e0b
commit fa76b65de7

@ -2,7 +2,7 @@
# 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.*

@ -108,7 +108,6 @@
#:in 'nw
#:inner 'sw ; puts baseline at lower right corner of line box
#:out 'sw
#:offset (pt 4 -6)
#:printable #true
#:draw (λ (q doc)
(draw-debug q doc)
@ -199,7 +198,9 @@
(pt-y (size pc)))))
#:pre-draw (λ (q 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)
(fill-and-stroke doc "#eee" "#999")
(restore doc))))

Loading…
Cancel
Save