summaryrefslogtreecommitdiff
path: root/src/sfnt/sfobjs.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-04-27 23:06:51 +0200
committerWerner Lemberg <wl@gnu.org>2023-05-06 18:53:50 +0200
commit8fe50c2adca74a4eca1501c831251283b4cc6d9b (patch)
treea30f7d5032a68d8e82455d783354ffa7ffc7a76c /src/sfnt/sfobjs.c
parentc8a24209d314c23632deaccd328e107888fab13a (diff)
downloadfreetype2-8fe50c2adca74a4eca1501c831251283b4cc6d9b.tar.gz
[truetype] Fix style name handling for variation fonts.
* include/freetype/internal/tttypes.h (TT_FaceRec): New field `non_var_style_name`. * src/sfnt/sfobjs.c (sfnt_load_face): Initialize `non_var_style_name`. (sfnt_done_face): Free `non_var_style_name`. * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Restore non-VF style name if switching back to non-VF mode.
Diffstat (limited to 'src/sfnt/sfobjs.c')
-rw-r--r--src/sfnt/sfobjs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 1574c353d..f5d66ef84 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1063,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;
@@ -1509,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 */