[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Fwd: buiding ttfautohint with cmake (Re: Freetype-devel D
Re: [ft-devel] Fwd: buiding ttfautohint with cmake (Re: Freetype-devel Digest, Vol 155, Issue 12
Sat, 16 Dec 2017 21:18:51 +0000
Thanks Hin Tak,
I have already solved that, it's just a matter of wrapping the python callback function with ctypes.CFUNCTYPE, which defines the prototype for the function pointer. It's working well.
Date: Wed, 13 Dec 2017 11:51:47 +0000
From: Cosimo Lupo <address@hidden>
To: Werner LEMBERG <address@hidden>
Subject: Re: [ft-devel] Fwd: buiding
ttfautohint with cmake?
> What do you think about providing
function pointers to TTF_autohint
> for memory allocation and
> it's bit more complicated to pass a
function pointer with ctypes, but it's
FYI, freetype-py is entirely ctype-based, and my fontval-diag branch works in exactly that way - passing a function pointer in my extra python code to freetype-py to get diagnostic info out of freetype's truetype module. I looked up how to make it work and so it works that way (inherited from the Microsoft design where a function pointer get passed from the c# side of things into their proprietary font module).
I don't remember the details but it is just a few lines of python code. You can just diff my fontval-diag branch of Freetype-py against master to see how it is done.
Freetype-devel mailing list