Dmitri Hrapof wrote:
(also posted to CFFI list)
Hello!
I'm trying to use libfreetype.so via CFFI. What I hacked up so far is located here:
http://www.common-lisp.ru/cleft.asd http://www.common-lisp.ru/cleft.lisp
The code like that works:
(with-freetype lib (with-face lib (face "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf") (docharmap (code face) (format t "~a " (code-char code)))))
and prints out all glyphs in a font.
However, the following doesn't do what I want:
(with-freetype lib (with-face lib (face "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf") (set-char-size face (* 16 64) (* 16 64) 300 300) (glyph-pixarray face (char-code #\a))))
It returns #2A() Looks like the whole bitmap structure is set to zeros.
I think I'm following FreeType and CFFI tutorials closely and I can't explain what's wrong...
Thank you for your help, Dmitri
mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
Dmitri, I cargo-culted a mcclim-freetype-cffi out of mcclim-freetype (because the latter was SBCL specific and I use ACL). Have a look in the McCLIM CVS repository. You should find it there.
I'm afraid that I can't help you much beyond that --- I didn't actually *understand* freetype, I just removed the SBCL dependencies from mcclim-freetype (which is really mcclim-freetype-sbcl, AFAICT).
I've been hoping that the CFFI version would become more official, but it doesn't seem to have gotten any traction. I'm not actually sure that freetype in general has, for that matter.
HTH, Robert