diff options
author | Werner Lemberg <wl@gnu.org> | 2023-04-27 11:40:46 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2023-04-28 10:44:14 +0200 |
commit | d7551af0986d2098f23899301f152039bd428ad6 (patch) | |
tree | b3a83891c15c26e11b65af4fd58e1f2dbe0b4ad9 /src/type1/t1load.c | |
parent | d9199546f25cfe2230d9fdcbbc31cb1d2c532ce5 (diff) | |
download | freetype2-d7551af0986d2098f23899301f152039bd428ad6.tar.gz |
[truetype] Fix PostScript name handling for variation fonts.
A variation font's PostScript name of a named instance is usually different
from the PostScript name of an unnamed instance. However, if a change
between a named instance and an unnamed instance with exactly the same
design axis values happened, it was possible that the PostScript name wasn't
correctly updated.
This commit reorganizes the code to handle this issue within the top-level
API functions, using a new service to trigger recomputation of the
PostScript name.
* include/freetype/internal/services/svmm.h (FT_Construct_PS_Name_Func): New
typedef.
(FT_Service_MultiMasters): New field `construct_ps_name`.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
* src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Call
`mm->construct_ps_name` to handle `postscript_name`.
(FT_Set_Named_Instance): Call `mm->construct_ps_name` to handle
`postscript_name`.
Use shortcut.
* src/cff/cffdrivr.c (cff_construct_ps_name): New function.
(cff_service_multi_masters): Updated.
* src/truetype/ttgxvar.c (tt_set_mm_blend): Don't handle `postscript_name`.
(TT_Set_MM_Blend): Simplify.
(TT_Set_Named_Instance): Return -1 if axis values haven't changed.
Don't set `face_index`.
(tt_construct_ps_name): New function.
* src/truetype/ttgxvar.h: Updated.
* src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
* src/type1/t1driver.c (t1_service_multi_masters): Updated.
* src/type1/t1load.c (T1_Set_MM_Blend): Simplify.
Diffstat (limited to 'src/type1/t1load.c')
-rw-r--r-- | src/type1/t1load.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/type1/t1load.c b/src/type1/t1load.c index a3b281009..ee52bf276 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -442,14 +442,7 @@ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Error error; - - - error = t1_set_mm_blend( face, num_coords, coords ); - if ( error ) - return error; - - return FT_Err_Ok; + return t1_set_mm_blend( face, num_coords, coords ); } |