Scribble: improve Unicode handling for Latex/PDF output
Normalize strings to composed form before splitting a string into characters to handle individually. original commit: d970d5aaead2bfbae0651b583f79e6ac719c7d39
This commit is contained in:
parent
6ac2c7cfef
commit
e5ebb45c06
|
@ -823,6 +823,10 @@
|
||||||
[(#\}) (display "\\%7d")]
|
[(#\}) (display "\\%7d")]
|
||||||
[else (display c)]))]
|
[else (display c)]))]
|
||||||
[else
|
[else
|
||||||
|
;; Start by normalizing to "combined" form, so that Racket characters
|
||||||
|
;; are closer to Unicode characters (e.g., ä is one character, instead
|
||||||
|
;; of a combining character followed by "a").
|
||||||
|
(let ([s (string-normalize-nfc s)])
|
||||||
(let ([len (string-length s)])
|
(let ([len (string-length s)])
|
||||||
(let loop ([i 0])
|
(let loop ([i 0])
|
||||||
(unless (= i len)
|
(unless (= i len)
|
||||||
|
@ -1082,7 +1086,7 @@
|
||||||
c)]
|
c)]
|
||||||
[else c])])])
|
[else c])])])
|
||||||
c)])))
|
c)])))
|
||||||
(loop (add1 i)))))]))
|
(loop (add1 i))))))]))
|
||||||
|
|
||||||
|
|
||||||
(define/private (box-character c)
|
(define/private (box-character c)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user