diff --git a/ChangeLog b/ChangeLog index 4a4149049..788685ce2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2017-01-23 Werner Lemberg + + [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 [truetype] Minor updates for OpenType 1.8.1. diff --git a/docs/CHANGES b/docs/CHANGES index da52047a7..be7e149b8 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -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 diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index d51e4fe30..bd24b833b 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -1833,7 +1833,8 @@ FT_BEGIN_HEADER /* */ /* 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 ); diff --git a/include/freetype/ftmodapi.h b/include/freetype/ftmodapi.h index d5bf37651..4147aadf8 100644 --- a/include/freetype/ftmodapi.h +++ b/include/freetype/ftmodapi.h @@ -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 ); + /*************************************************************************/ + /* */ + /* */ + /* FT_Set_Default_Properties */ + /* */ + /* */ + /* 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). */ + /* */ + /* { */ + /* */ + /* ':' */ + /* '=' */ + /* */ + /* ':' */ + /* '=' */ + /* ... */ + /* } */ + /* */ + /* Example: */ + /* */ + /* { */ + /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */ + /* cff:no-stem-darkening=1 \ */ + /* autofitter:warping=1 */ + /* } */ + /* */ + /* */ + /* library :: A handle to a new library object. */ + /* */ + FT_EXPORT( void ) + FT_Set_Default_Properties( FT_Library library ); + + /*************************************************************************/ /* */ /* */ @@ -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. */ diff --git a/src/base/ftinit.c b/src/base/ftinit.c index 1c4b76f56..b3b08fa54 100644 --- a/src/base/ftinit.c +++ b/src/base/ftinit.c @@ -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) - * - * - * ':' - * '=' - * - * ':' - * '=' - * ... - * - * 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; }