[base] Minor API improvement for default variation axis setting.

* src/base/ftmm.c (FT_Set_MM_Design_Coordinates,
FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
FT_Set_Var_Blend_Coordinates): Allow coords==NULL if num_coords==0.

* docs/CHANGES: Updated.
This commit is contained in:
Werner Lemberg 2017-08-10 12:56:50 +02:00
parent c87fec0299
commit f2e121ab11
4 changed files with 40 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2017-08-10 Werner Lemberg <wl@gnu.org>
[base] Minor API improvement for default variation axis setting.
* src/base/ftmm.c (FT_Set_MM_Design_Coordinates,
FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
FT_Set_Var_Blend_Coordinates): Allow coords==NULL if num_coords==0.
* docs/CHANGES: Updated.
2017-08-08 Werner Lemberg <wl@gnu.org>
[psnames] Really fix issue #49949.

View File

@ -9,6 +9,9 @@ CHANGES BETWEEN 2.8 and 2.8.1
- Some severe problems within the handling of TrueType Variation
Fonts were found and fixed.
- Function `FT_Set_Var_Design_Coordinates' didn't correctly handle
the case with less input coordinates than axes.
II. MISCELLANEOUS
@ -23,6 +26,14 @@ CHANGES BETWEEN 2.8 and 2.8.1
differently). Applications that use the FreeType API are not
affected.
- To reset all design axis values of a variation font to its
default values you can now say
error = FT_Set_Var_Design_Coordinates( face, 0, NULL );
This also works with functions `FT_Set_MM_Design_Coordinates'
and `FT_Set_MM_Blend_Coordinates'.
======================================================================

View File

@ -322,6 +322,11 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* To reset all axes to the default values, call the function with */
/* `num_coords' set to zero and `coords' set to NULL (new feature in */
/* FreeType version 2.8.1). */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
@ -352,6 +357,11 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* To reset all axes to the default values, call the function with */
/* `num_coords' set to zero and `coords' set to NULL (new feature in */
/* FreeType version 2.8.1). */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
@ -416,6 +426,11 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* To reset all axes to the default values, call the function with */
/* `num_coords' set to zero and `coords' set to NULL (new feature in */
/* FreeType version 2.8.1). */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,

View File

@ -158,7 +158,7 @@
/* check of `face' delayed to `ft_face_get_mm_service' */
if ( !coords )
if ( num_coords && !coords )
return FT_THROW( Invalid_Argument );
error = ft_face_get_mm_service( face, &service );
@ -194,7 +194,7 @@
/* check of `face' delayed to `ft_face_get_mm_service' */
if ( !coords )
if ( num_coords && !coords )
return FT_THROW( Invalid_Argument );
error = ft_face_get_mm_service( face, &service_mm );
@ -266,7 +266,7 @@
/* check of `face' delayed to `ft_face_get_mm_service' */
if ( !coords )
if ( num_coords && !coords )
return FT_THROW( Invalid_Argument );
error = ft_face_get_mm_service( face, &service_mm );
@ -313,7 +313,7 @@
/* check of `face' delayed to `ft_face_get_mm_service' */
if ( !coords )
if ( num_coords && !coords )
return FT_THROW( Invalid_Argument );
error = ft_face_get_mm_service( face, &service_mm );