Add `FT_Done_MM_Var'.

This is necessary in case the application's memory routines differ
from FreeType.  A typical example is a Python application on Windows
that calls FreeType compiled as a DLL via the `ctypes' interface.

* include/freetype/ftmm.h, src/base/ftmm.c (FT_Done_MM_Var): Declare
and define.

* docs/CHANGES: Updated.
This commit is contained in:
Werner Lemberg 2018-01-06 08:39:36 +01:00
parent b720070988
commit 3758aed760
4 changed files with 56 additions and 1 deletions

View File

@ -1,3 +1,16 @@
2018-01-06 Werner Lemberg <wl@gnu.org>
Add `FT_Done_MM_Var'.
This is necessary in case the application's memory routines differ
from FreeType. A typical example is a Python application on Windows
that calls FreeType compiled as a DLL via the `ctypes' interface.
* include/freetype/ftmm.h, src/base/ftmm.c (FT_Done_MM_Var): Declare
and define.
* docs/CHANGES: Updated.
2018-01-03 Werner Lemberg <wl@gnu.org>
[truetype] Round offsets of glyph components only if hinting is on.

View File

@ -56,6 +56,9 @@ CHANGES BETWEEN 2.8.1 and 2.8.2
PostScript name is provided, not looking up special entries for
named instances.
- A new function `FT_Done_MM_Var' is provided to free the memory
returned in a call to `FT_Get_MM_Var'.
- On platforms using the `configure' script, the installed
`ftoption.h' file now correctly reflects configuration options
like `--with-harfbuzz'.

View File

@ -286,7 +286,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* amaster :: The variation descriptor. */
/* Allocates a data structure, which the user must */
/* deallocate with `free' after use. */
/* deallocate with a call to @FT_Done_MM_Var after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@ -296,6 +296,26 @@ FT_BEGIN_HEADER
FT_MM_Var* *amaster );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_MM_Var */
/* */
/* <Description> */
/* Free the memory allocated by @FT_Get_MM_Var. */
/* */
/* <Input> */
/* library :: A handle of the face's parent library object that was */
/* used in the call to @FT_Get_MM_Var to create `amaster'. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
FT_EXPORT( FT_Error )
FT_Done_MM_Var( FT_Library library,
FT_MM_Var *amaster );
/*************************************************************************/
/* */
/* <Function> */

View File

@ -145,6 +145,25 @@
}
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )
FT_Done_MM_Var( FT_Library library,
FT_MM_Var* amaster )
{
FT_Memory memory;
if ( !library )
return FT_THROW( Invalid_Library_Handle );
memory = library->memory;
FT_FREE( amaster );
return FT_Err_Ok;
}
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )