diff options
author | Werner Lemberg <wl@gnu.org> | 2023-04-26 12:03:04 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2023-05-06 16:46:59 +0200 |
commit | 472ac82a615692a52114e2546991add30d18960c (patch) | |
tree | 4fd5047a77300558c6071e9a31f3609402dc8d2d /src/truetype/ttgxvar.c | |
parent | 1872713cf282622ce693a9f5aecb6bbec0312aaa (diff) | |
download | freetype2-472ac82a615692a52114e2546991add30d18960c.tar.gz |
[truetype] Fix deactivation of variation font handling.
According to the documentation, the functions `FT_Set_Named_Instance`,
`FT_Set_MM_Design_Coordinates`, `FT_Set_Var_Design_Coordinates`, and
`FT_Set_Var_Blend_Coordinates` can unset the `FT_FACE_FLAG_VARIATION` flag.
(The same is true for `FT_Set_MM_WeightVector` but this information was
accidentally omitted from the documentation.)
However, if a call of these functions didn't change the axis values this
could fail because internal shortcuts exited too early.
This commit reorganizes the code to handle `FT_FACE_FLAG_VARIATION` in the
top-level API functions, also taking care of the issue at hand.
* src/base/ftmm.c (FT_Set_MM_Design_Coordinates, FT_Set_MM_WeightVector,
FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
FT_Set_Var_Blend_Coordinates): Handle `FT_FACE_FLAG_VARIATION`.
* src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design,
TT_Set_Named_Instance) Don't handle `FT_FACE_FLAG_VARIATION`.
* src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_WeightVector,
T1_Set_MM_Design): Ditto.
* src/cff/cffobjs.c (cff_face_init): Use `FT_Set_Named_Instance` instead of
low-level functions.
* src/truetype/ttobjs.c (tt_face_init): Ditto.
Diffstat (limited to 'src/truetype/ttgxvar.c')
-rw-r--r-- | src/truetype/ttgxvar.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index d28cc245e..44483625a 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -2985,11 +2985,6 @@ if ( error ) return error; - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - return FT_Err_Ok; } @@ -3208,11 +3203,6 @@ if ( error ) goto Exit; - if ( num_coords ) - face->root.face_flags |= FT_FACE_FLAG_VARIATION; - else - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; - Exit: FT_FREE( normalized ); return error; @@ -3382,9 +3372,8 @@ else error = TT_Set_Var_Design( face, 0, NULL ); - face->root.face_index = ( instance_index << 16 ) | - ( face->root.face_index & 0xFFFFL ); - face->root.face_flags &= ~FT_FACE_FLAG_VARIATION; + face->root.face_index = ( instance_index << 16 ) | + ( face->root.face_index & 0xFFFFL ); Exit: return error; |