summaryrefslogtreecommitdiff
path: root/src/truetype
diff options
context:
space:
mode:
Diffstat (limited to 'src/truetype')
-rw-r--r--src/truetype/ttdriver.c3
-rw-r--r--src/truetype/ttgxvar.c38
-rw-r--r--src/truetype/ttgxvar.h4
3 files changed, 22 insertions, 23 deletions
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 54ad932ed..8bde30fbf 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -533,6 +533,9 @@
NULL, /* set_mm_weightvector */
(FT_Get_MM_WeightVector_Func)
NULL, /* get_mm_weightvector */
+
+ (FT_Construct_PS_Name_Func)
+ tt_construct_ps_name, /* construct_ps_name */
(FT_Var_Load_Delta_Set_Idx_Map_Func)
tt_var_load_delta_set_index_mapping,
/* load_delta_set_idx_map */
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 44483625a..aec43c851 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2936,9 +2936,6 @@
}
}
- /* enforce recomputation of the PostScript name; */
- FT_FREE( face->postscript_name );
-
Exit:
return error;
}
@@ -2978,14 +2975,7 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- FT_Error error;
-
-
- error = tt_set_mm_blend( face, num_coords, coords, 1 );
- if ( error )
- return error;
-
- return FT_Err_Ok;
+ return tt_set_mm_blend( face, num_coords, coords, 1 );
}
@@ -3305,7 +3295,8 @@
* Value 0 indicates to not use an instance.
*
* @Return:
- * FreeType error code. 0~means success.
+ * FreeType error code. 0~means success, -1 means success and unchanged
+ * axis values.
*/
FT_LOCAL_DEF( FT_Error )
TT_Set_Named_Instance( TT_Face face,
@@ -3361,20 +3352,10 @@
error = TT_Set_Var_Design( face,
mmvar->num_axis,
named_style->coords );
- if ( error )
- {
- /* internal error code -1 means `no change' */
- if ( error == -1 )
- error = FT_Err_Ok;
- goto Exit;
- }
}
else
error = TT_Set_Var_Design( face, 0, NULL );
- face->root.face_index = ( instance_index << 16 ) |
- ( face->root.face_index & 0xFFFFL );
-
Exit:
return error;
}
@@ -3419,6 +3400,19 @@
}
+ /* This function triggers (lazy) recomputation of the `postscript_name` */
+ /* field in `TT_Face`. */
+
+ FT_LOCAL_DEF( void )
+ tt_construct_ps_name( TT_Face face )
+ {
+ FT_Memory memory = face->root.memory;
+
+
+ FT_FREE( face->postscript_name );
+ }
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index 0c096f7df..4de772c87 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -378,6 +378,9 @@ FT_BEGIN_HEADER
TT_Get_Default_Named_Instance( TT_Face face,
FT_UInt *instance_index );
+ FT_LOCAL( void )
+ tt_construct_ps_name( TT_Face face );
+
FT_LOCAL( FT_Error )
tt_face_vary_cvt( TT_Face face,
FT_Stream stream );
@@ -401,7 +404,6 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
tt_apply_mvar( TT_Face face );
-
FT_LOCAL( FT_Error )
tt_var_load_item_variation_store( TT_Face face,
FT_ULong offset,