freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Fwd: buiding ttfautohint with cmake (Re: Freetype-devel D


From: Cosimo Lupo
Subject: Re: [ft-devel] Fwd: buiding ttfautohint with cmake (Re: Freetype-devel Digest, Vol 155, Issue 12
Date: 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.

On Sat, Dec 16, 2017 at 9:14 PM Hin-Tak Leung <address@hidden> wrote:

 Date: Wed, 13 Dec 2017 11:51:47 +0000
 From: Cosimo Lupo <address@hidden>
 To: Werner LEMBERG <address@hidden>
 Cc: address@hidden,
 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
 deallocation instead?

> it's bit more complicated to pass a
 function pointer with ctypes, but it's
 possible.

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
address@hidden
https://lists.nongnu.org/mailman/listinfo/freetype-devel
--
Cosimo Lupo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]