Commit 38fc48b2 authored by Robert Strandh's avatar Robert Strandh

replacement for CLX' and McCLIM's translate functions.

parent e636f5c4
;;; remove this file whenever CLX is fixed and McCLIM removes its private
;;; implementation of translate.
(in-package :clim-clx)
(defun translate (src src-start src-end afont dst dst-start)
(let ((min-char-index (xlib:font-min-char afont))
(max-char-index (xlib:font-max-char afont)))
(if (stringp src)
(loop for i from src-start below src-end
for j from dst-start
for index = (char-code (aref src i))
while (<= min-char-index index max-char-index)
do (setf (aref dst j) index)
finally (return i))
(loop for i from src-start below src-end
for j from dst-start
for index = (if (characterp (aref src i)) (char-code (aref src i)) (aref src i))
while (<= min-char-index index max-char-index)
do (setf (aref dst j) index)
finally (return i)))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment