[base] Add `FT_Set_Default_Properties' (#49187).

* include/freetype/ftmodapi.h: Add declaration.

* src/base/ftinit.c (ft_set_default_properties): Renamed to...
(FT_Set_Default_Properties): ... this.
(FT_Init_FreeType): Updated.

* docs/CHANGES: Updated.
This commit is contained in:
Werner Lemberg 2017-01-23 12:53:18 +01:00
parent f502092bcd
commit 693f56ffcd
5 changed files with 79 additions and 30 deletions

View File

@ -1,3 +1,15 @@
2017-01-23 Werner Lemberg <wl@gnu.org>
[base] Add `FT_Set_Default_Properties' (#49187).
* include/freetype/ftmodapi.h: Add declaration.
* src/base/ftinit.c (ft_set_default_properties): Renamed to...
(FT_Set_Default_Properties): ... this.
(FT_Init_FreeType): Updated.
* docs/CHANGES: Updated.
2017-01-23 Werner Lemberg <wl@gnu.org>
[truetype] Minor updates for OpenType 1.8.1.

View File

@ -15,6 +15,15 @@ CHANGES BETWEEN 2.7.1 and 2.7.2
- Variations font support now takes care of the `MVAR' table also.
II. MISCELLANEOUS
- A new function `FT_Set_Default_Properties' has been added to
parse the `FREETYPE_PROPERTIES' environment variable
(previously, it was internal only). `FT_Init_FreeType' always
call this function, but `FT_New_Library' does not (similar to
`FT_Add_Default_Modules').
======================================================================
CHANGES BETWEEN 2.7 and 2.7.1

View File

@ -1833,7 +1833,8 @@ FT_BEGIN_HEADER
/* <Note> */
/* In case you want to provide your own memory allocating routines, */
/* use @FT_New_Library instead, followed by a call to */
/* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module). */
/* @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module) */
/* and @FT_Set_Default_Properties. */
/* */
/* See the documentation of @FT_Library and @FT_Face for */
/* multi-threading issues. */
@ -1841,6 +1842,11 @@ FT_BEGIN_HEADER
/* If you need reference-counting (cf. @FT_Reference_Library), use */
/* @FT_New_Library and @FT_Done_Library. */
/* */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
/* variable to control driver properties. See sections @auto_hinter, */
/* @cff_driver, @pcf_driver, and @tt_driver for more. */
/* */
FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary );

View File

@ -89,6 +89,7 @@ FT_BEGIN_HEADER
/* */
/* FT_Property_Set */
/* FT_Property_Get */
/* FT_Set_Default_Properties */
/* */
/* FT_New_Library */
/* FT_Done_Library */
@ -437,6 +438,47 @@ FT_BEGIN_HEADER
void* value );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Default_Properties */
/* */
/* <Description> */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
/* variable to control driver properties. See sections @auto_hinter, */
/* @cff_driver, @pcf_driver, and @tt_driver for more. */
/* */
/* If the compilation option is not set, this function does nothing. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here */
/* into multiple lines for better readability). */
/* */
/* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
/* <whitespace> */
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
/* } */
/* */
/* Example: */
/* */
/* { */
/* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */
/* cff:no-stem-darkening=1 \ */
/* autofitter:warping=1 */
/* } */
/* */
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
FT_EXPORT( void )
FT_Set_Default_Properties( FT_Library library );
/*************************************************************************/
/* */
/* <Function> */
@ -477,8 +519,9 @@ FT_BEGIN_HEADER
/* valid for the life of the @FT_Library object. */
/* */
/* Normally, you would call this function (followed by a call to */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
/* instead of @FT_Init_FreeType to initialize the FreeType library. */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, */
/* and a call to @FT_Set_Default_Properties) instead of */
/* @FT_Init_FreeType to initialize the FreeType library. */
/* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */

View File

@ -230,31 +230,10 @@
#define MAX_LENGTH 128
/*
* Set default properties derived from the `FREETYPE_PROPERTIES'
* environment variable.
*
* `FREETYPE_PROPERTIES' has the following syntax form (broken here into
* multiple lines for better readability)
*
* <optional whitespace>
* <module-name1> ':'
* <property-name1> '=' <property-value1>
* <whitespace>
* <module-name2> ':'
* <property-name2> '=' <property-value2>
* ...
*
* Example:
*
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
* cff:no-stem-darkening=1 \
* autofitter:warping=1
*
*/
/* documentation is in ftmodapi.h */
static void
ft_set_default_properties( FT_Library library )
FT_EXPORT_DEF( void )
FT_Set_Default_Properties( FT_Library library )
{
const char* env;
const char* p;
@ -326,8 +305,8 @@
#else
static void
ft_set_default_properties( FT_Library library )
FT_EXPORT_DEF( void )
FT_Set_Default_Properties( FT_Library library )
{
FT_UNUSED( library );
}
@ -365,7 +344,7 @@
else
FT_Add_Default_Modules( *alibrary );
ft_set_default_properties( *alibrary );
FT_Set_Default_Properties( *alibrary );
return error;
}