slideshow/pict: for `text' in caps mode, kern captials with following

This commit is contained in:
Matthew Flatt 2012-05-17 16:21:27 -06:00
parent e0256bc9c7
commit d430656a03

View File

@ -305,11 +305,33 @@
(let loop ([l strings] [up? #f])
(if (null? l)
null
(cons (not-caps-text (list->string (map char-upcase (car l)))
(let* ([first-string (list->string (map char-upcase (car l)))]
[first
(not-caps-text first-string
(if up? style cap-style)
(if up? size cap-size)
0)
(loop (cdr l) (not up?)))))])
0)]
[rest (loop (cdr l) (not up?))])
(if (and up? (pair? (cdr l)))
;; kern capital followed by non-captial
(let ([plain-first (not-caps-text first-string
cap-style
cap-size
0)]
[together (not-caps-text (string-append
first-string
(list->string (map char-upcase (cadr l))))
cap-style
cap-size
0)])
(cons (hbl-append (- (pict-width together)
(+ (pict-width plain-first)
(pict-width (car rest))))
first
(car rest))
(cdr rest)))
;; no kerning needed:
(cons first rest)))))])
(apply hbl-append 0 picts)))]))
(define (linewidth n p) (line-thickness n p))