[mcclim-devel] Freetype and CFFI
    Robert P. Goldman 
    rpgoldman at sift.info
       
    Thu Dec  7 13:40:47 UTC 2006
    
    
  
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 at 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
-- 
Robert P. Goldman
Senior Scientist
Smart Information Flow Technologies (d/b/a SIFT, LLC)
211 N. First St., Suite 300
Minneapolis, MN 55401
Voice:	(612) 384-3454
Email:    rpgoldman at SIFT.info
    
    
More information about the mcclim-devel
mailing list