diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sfnt/sfobjs.c | 11 | ||||
-rw-r--r-- | src/truetype/ttgxvar.c | 11 |
2 files changed, 20 insertions, 2 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 */ diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index aec43c851..249ef316a 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -3306,6 +3306,8 @@ GX_Blend blend; FT_MM_Var* mmvar; + FT_Memory memory = face->root.memory; + FT_UInt num_instances; @@ -3329,8 +3331,7 @@ if ( instance_index > 0 ) { - FT_Memory memory = face->root.memory; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; FT_Var_Named_Style* named_style; FT_String* style_name; @@ -3354,7 +3355,13 @@ named_style->coords ); } else + { + /* restore non-VF style name */ + FT_FREE( face->root.style_name ); + if ( FT_STRDUP( face->root.style_name, face->non_var_style_name ) ) + goto Exit; error = TT_Set_Var_Design( face, 0, NULL ); + } Exit: return error; |