; (c) 2008 Dmitri Hrapof ; This file is distributed under the terms of the LLGPL. (defpackage oci-lest (:use common-lisp oci cleft)) (in-package oci-lest) (defun char-image (char &key (font "/usr/share/fonts/truetype/freefont/FreeSans. ttf") (size 12) (res 100)) (with-freetype (with-face (face font) (ft-set-char-size face size size res res) (typecase char (character (glyph-pixels face char)) (string (loop for c across char collect (glyph-pixels face c))))))) (defun font->grafs (char &key (font "/usr/share/fonts/truetype/freefont/FreeSans.ttf") (size 12) (res 100)) (let (lst) (with-freetype (dolist (f (mklist font)) (with-face (face f) (dolist (r (mklist res)) (dolist (s (mklist size)) (ft-set-char-size face s s r r) (dolist (c (etypecase char (character (list char)) (string (loop for c across char collect c)) (list char))) (push (list c (graphicalize (glyph-pixels face c))) lst))))))) (nreverse lst))) ;(grafs->file (font->grafs oci::persian-alphabet :font '("/usr/share/fonts/truetype/ttf-freefarsi/FreeFarsi.ttf" "/usr/share/fonts/truetype/ttf-farsiweb/nazli.ttf") :size '(48)) "~/llisp/oci/script-arabic.lsp")