diff options
author | Werner Lemberg <wl@gnu.org> | 2023-04-26 12:03:04 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2023-05-06 18:53:50 +0200 |
commit | 6713b1e41a147897887c3a9b0136104a3f9ed2cf (patch) | |
tree | dbfe192183f3f07907d6ac4d06589a6f15aa8766 /src/truetype/ttobjs.c | |
parent | fdcb14a2eebb48bb137f6e9afc27faac931967b6 (diff) | |
download | freetype2-6713b1e41a147897887c3a9b0136104a3f9ed2cf.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/ttobjs.c')
-rw-r--r-- | src/truetype/ttobjs.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index c351e082b..29d41da07 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -777,7 +777,6 @@ } #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT - { FT_UInt instance_index = (FT_UInt)face_index >> 16; @@ -785,14 +784,11 @@ if ( FT_HAS_MULTIPLE_MASTERS( ttface ) && instance_index > 0 ) { - error = TT_Set_Named_Instance( face, instance_index ); + error = FT_Set_Named_Instance( ttface, instance_index ); if ( error ) goto Exit; - - tt_apply_mvar( face ); } } - #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ /* initialize standard glyph loading routines */ |