Load GIF images using the Skippy library, instead of the external
[closure-html.git] / src / patch.lisp
blobe70bdc451d8fbbe5bb4f8a9cab02c20f3076df4c
1 ;;;;
2 ;;;; Last minute patches
3 ;;;;
5 ;; from http://paste.lisp.org/display/6063, to allow SBCL to display
6 ;; non-ASCII characters via CLX
7 (in-package :clim-clx)
9 (defun translate (src src-start src-end afont dst dst-start)
10 (let ((min-char-index (xlib:font-min-char afont))
11 (max-char-index (xlib:font-max-char afont)))
12 (if (stringp src)
13 (loop for i from src-start below src-end
14 for j from dst-start
15 for index = (char-code (aref src i))
16 while (<= min-char-index index max-char-index)
17 do (setf (aref dst j) index)
18 finally (return i))
19 (loop for i from src-start below src-end
20 for j from dst-start
21 for index = (if (characterp (aref src i)) (char-code (aref src i)) (aref src i))
22 while (<= min-char-index index max-char-index)
23 do (setf (aref dst j) index)
24 finally (return i)))))