summaryrefslogtreecommitdiff
path: root/src/cff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-04-26 12:03:04 +0200
committerWerner Lemberg <wl@gnu.org>2023-05-06 18:53:50 +0200
commit6713b1e41a147897887c3a9b0136104a3f9ed2cf (patch)
treedbfe192183f3f07907d6ac4d06589a6f15aa8766 /src/cff
parentfdcb14a2eebb48bb137f6e9afc27faac931967b6 (diff)
downloadfreetype2-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/cff')
-rw-r--r--src/cff/cffobjs.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 2285c1a48..1f24f3d91 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -719,24 +719,15 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
{
- FT_Service_MultiMasters
- mm = (FT_Service_MultiMasters)face->mm;
- FT_Service_MetricsVariations
- var = (FT_Service_MetricsVariations)face->face_var;
-
FT_UInt instance_index = (FT_UInt)face_index >> 16;
if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
- mm &&
instance_index > 0 )
{
- error = mm->set_named_instance( cffface, instance_index );
+ error = FT_Set_Named_Instance( cffface, instance_index );
if ( error )
goto Exit;
-
- if ( var )
- var->metrics_adjust( cffface );
}
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */