diff options
author | Werner Lemberg <wl@gnu.org> | 2023-04-26 08:17:17 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2023-04-28 10:44:14 +0200 |
commit | 545d0446b6625e8412f379304b0fc0a20741a8c1 (patch) | |
tree | bda43cfaae11f76d81009e22da09dd2bf8d6f1b9 /include/freetype/ftmm.h | |
parent | 17a0c5dfd5d94944f091c96145a5c96bba46de0a (diff) | |
download | freetype2-545d0446b6625e8412f379304b0fc0a20741a8c1.tar.gz |
New Variation Font function `FT_Get_Default_Named_Instance`.
* include/freetype/ftmm.h, src/base/ftmm.c (FT_Get_Default_Named_Instance):
New function.
* include/freetype/internal/services/svmm.h
(FT_Get_Default_Named_Instance_Func): New typedef.
(FT_Service_MultiMasters): New field `get_default_named_instance`.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
* include/freetype/internal/tttypes.h (TT_Face): New field
`var_default_named_instance`.
* src/sfnt/sfobjc.s (sfnt_init_face): Initialize
`var_default_named_instance`.
* src/cff/cffdrivr.c (cff_get_default_named_instance): New function.
(cff_service_multi_masters): Updated.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize
`var_default_named_instance`.
(TT_Get_Default_Named_Instance): 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.
* docs/CHANGES: Updated.
Diffstat (limited to 'include/freetype/ftmm.h')
-rw-r--r-- | include/freetype/ftmm.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/freetype/ftmm.h b/include/freetype/ftmm.h index 3eabdd5f2..2c2f165fa 100644 --- a/include/freetype/ftmm.h +++ b/include/freetype/ftmm.h @@ -753,6 +753,45 @@ FT_BEGIN_HEADER FT_Set_Named_Instance( FT_Face face, FT_UInt instance_index ); + + /************************************************************************** + * + * @function: + * FT_Get_Default_Named_Instance + * + * @description: + * Retrieve the index of the default named instance, to be used with + * @FT_Set_Named_Instance. + * + * The default instance of a variation font is that instance for which + * the nth axis coordinate is equal to `axis[n].def` (as specified in the + * @FT_MM_Var structure), with~n covering all axes. + * + * FreeType synthesizes a named instance for the default instance if the + * font does not contain such an entry. + * + * @input: + * face :: + * A handle to the source face. + * + * @output: + * instance_index :: + * The index of the default named instance. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * For Adobe MM fonts (which don't have named instances) this function + * always returns zero for `instance_index`. + * + * @since: + * 2.13.1 + */ + FT_EXPORT( FT_Error ) + FT_Get_Default_Named_Instance( FT_Face face, + FT_UInt *instance_index ); + /* */ |