[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Memory management and stream I/O question (Freetype v1 --> v2)
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Memory management and stream I/O question (Freetype v1 --> v2) |
Date: |
Thu, 21 Mar 2013 07:29:10 +0100 (CET) |
> First: When I need to allocate memory from my code, the old method
> was to call ALLOC (wrapper to TT_Alloc), to ensure that the
> appropriate functions were used. However, in Freetype v2 these
> appear to be hidden from the application through the private memory
> manager object. If necessary, I can simply call the system
> allocation function directory, but is this really the correct
> approach?
Yes, I think so, assuming that you are using the FreeType library out
of the box.
> Second: It's vitally important to flush (i.e. close) the Face stream
> every time I pass control back to the application, while otherwise
> keeping the Face object itself. The existing (v1) code uses
> TT_Flush_Face (which in turn calls TT_Flush_Stream). I cannot
> figure out what the equivalent procedure in Freetype v2.x is,
> however. Can anyone help with this?
There is no such functionality anymore, and noone has ever requested
it. May I suggest the following approach: Simply assume that FreeType
does the right thing. In case it doesn't, please open a bug report,
ideally providing a patch. It should be straightforward to add a new
function to the API, but I would prefer if you could provide an OS/2
specific version of `ftsystem.c' (and probably `ftdebug.c' also).
Werner