summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/sfnt/sfobjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/sfnt/sfobjs.c')
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfobjs.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/3rdparty/freetype/src/sfnt/sfobjs.c b/src/3rdparty/freetype/src/sfnt/sfobjs.c
index a0da984e7a..f5d66ef840 100644
--- a/src/3rdparty/freetype/src/sfnt/sfobjs.c
+++ b/src/3rdparty/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
*
* SFNT object management (base).
*
- * Copyright (C) 1996-2022 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -534,17 +534,23 @@
0 );
}
- if ( !face->var )
+ if ( !face->tt_var )
{
/* we want the metrics variations interface */
/* from the `truetype' module only */
FT_Module tt_module = FT_Get_Module( library, "truetype" );
- face->var = ft_module_get_service( tt_module,
- FT_SERVICE_ID_METRICS_VARIATIONS,
- 0 );
+ face->tt_var = ft_module_get_service( tt_module,
+ FT_SERVICE_ID_METRICS_VARIATIONS,
+ 0 );
}
+
+ if ( !face->face_var )
+ face->face_var = ft_module_get_service(
+ &face->root.driver->root,
+ FT_SERVICE_ID_METRICS_VARIATIONS,
+ 0 );
#endif
FT_TRACE2(( "SFNT driver\n" ));
@@ -692,6 +698,9 @@
instance_offset += instance_size;
}
+ /* named instance indices start with value 1 */
+ face->var_default_named_instance = i + 1;
+
if ( i == num_instances )
{
/* no default instance in named instance table; */
@@ -1054,6 +1063,16 @@
GET_NAME( FONT_SUBFAMILY, &face->root.style_name );
}
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ {
+ FT_Memory memory = face->root.memory;
+
+
+ if ( FT_STRDUP( face->non_var_style_name, face->root.style_name ) )
+ goto Exit;
+ }
+#endif
+
/* now set up root fields */
{
FT_Face root = &face->root;
@@ -1107,13 +1126,7 @@
/* Don't bother to load the tables unless somebody asks for them. */
/* No need to do work which will (probably) not be used. */
if ( face->variation_support & TT_FACE_FLAG_VAR_FVAR )
- {
- if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 &&
- tt_face_lookup_table( face, TTAG_gvar ) != 0 )
- flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
- if ( tt_face_lookup_table( face, TTAG_CFF2 ) != 0 )
- flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
- }
+ flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;
#endif
root->face_flags = flags;
@@ -1227,7 +1240,7 @@
if ( count > 0 )
{
- FT_Memory memory = face->root.stream->memory;
+ FT_Memory memory = face->root.memory;
FT_UShort em_size = face->header.Units_Per_EM;
FT_Short avgwidth = face->os2.xAvgCharWidth;
FT_Size_Metrics metrics;
@@ -1506,6 +1519,7 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_FREE( face->var_postscript_prefix );
+ FT_FREE( face->non_var_style_name );
#endif
/* freeing glyph color palette data */