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
It seems that call (load-char face char :ft-load-monochrome) was not sufficient, contrary to my (under)undestanding of FreeType docs. Instead, two calls (load-char face char :ft-load-default) ... (render-glyph glyph :ft-render-mode-mono) made what I wanted. If anyone knows FreeType expert, please ask him about this. Sincerely yours, Dmitri
participants (1)
-
Dmitri Hrapof