/[climacs]/climacs/translate.lisp
ViewVC logotype

Contents of /climacs/translate.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Mon Jan 3 10:45:46 2005 UTC (9 years, 3 months ago) by rstrandh
Branch: MAIN
CVS Tags: works-with-0_9_3, HEAD
replacement for CLX' and McCLIM's translate functions.
1 ;;; remove this file whenever CLX is fixed and McCLIM removes its private
2 ;;; implementation of translate.
3
4 (in-package :clim-clx)
5
6 (defun translate (src src-start src-end afont dst dst-start)
7 (let ((min-char-index (xlib:font-min-char afont))
8 (max-char-index (xlib:font-max-char afont)))
9 (if (stringp src)
10 (loop for i from src-start below src-end
11 for j from dst-start
12 for index = (char-code (aref src i))
13 while (<= min-char-index index max-char-index)
14 do (setf (aref dst j) index)
15 finally (return i))
16 (loop for i from src-start below src-end
17 for j from dst-start
18 for index = (if (characterp (aref src i)) (char-code (aref src i)) (aref src i))
19 while (<= min-char-index index max-char-index)
20 do (setf (aref dst j) index)
21 finally (return i)))))

  ViewVC Help
Powered by ViewVC 1.1.5