slideshow/pict: for `text' in caps mode, kern captials with following
This commit is contained in:
parent
e0256bc9c7
commit
d430656a03
|
@ -281,7 +281,7 @@
|
||||||
[(string style) (caps-text string style 12)]
|
[(string style) (caps-text string style 12)]
|
||||||
[(string style size)
|
[(string style size)
|
||||||
(let ([strings
|
(let ([strings
|
||||||
(let loop ([l (string->list string)][this null][results null][up? #f])
|
(let loop ([l (string->list string)] [this null] [results null] [up? #f])
|
||||||
(if (null? l)
|
(if (null? l)
|
||||||
(reverse (cons (reverse this) results))
|
(reverse (cons (reverse this) results))
|
||||||
(if (eq? up? (char-upper-case? (car l)))
|
(if (eq? up? (char-upper-case? (car l)))
|
||||||
|
@ -302,14 +302,36 @@
|
||||||
[else s]))]
|
[else s]))]
|
||||||
[cap-size (floor (* 8/10 size))])
|
[cap-size (floor (* 8/10 size))])
|
||||||
(let ([picts
|
(let ([picts
|
||||||
(let loop ([l strings][up? #f])
|
(let loop ([l strings] [up? #f])
|
||||||
(if (null? l)
|
(if (null? l)
|
||||||
null
|
null
|
||||||
(cons (not-caps-text (list->string (map char-upcase (car l)))
|
(let* ([first-string (list->string (map char-upcase (car l)))]
|
||||||
(if up? style cap-style)
|
[first
|
||||||
(if up? size cap-size)
|
(not-caps-text first-string
|
||||||
0)
|
(if up? style cap-style)
|
||||||
(loop (cdr l) (not up?)))))])
|
(if up? size cap-size)
|
||||||
|
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)))]))
|
(apply hbl-append 0 picts)))]))
|
||||||
|
|
||||||
(define (linewidth n p) (line-thickness n p))
|
(define (linewidth n p) (line-thickness n p))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user