summaryrefslogtreecommitdiff
path: root/src/base/ftmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftmm.c')
-rw-r--r--src/base/ftmm.c82
1 files changed, 75 insertions, 7 deletions
diff --git a/src/base/ftmm.c b/src/base/ftmm.c
index c061431a4..9e2dd7ee7 100644
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -301,10 +301,26 @@
if ( !error || error == -1 )
{
+ FT_Bool is_variation_old = FT_IS_VARIATION( face );
+
+
if ( num_coords )
face->face_flags |= FT_FACE_FLAG_VARIATION;
else
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ if ( service_mm->construct_ps_name )
+ {
+ if ( error == -1 )
+ {
+ /* The PS name of a named instance and a non-named instance */
+ /* usually differs, even if the axis values are identical. */
+ if ( is_variation_old != FT_IS_VARIATION( face ) )
+ service_mm->construct_ps_name( face );
+ }
+ else
+ service_mm->construct_ps_name( face );
+ }
}
/* internal error code -1 means `no change'; we can exit immediately */
@@ -385,10 +401,26 @@
if ( !error || error == -1 )
{
+ FT_Bool is_variation_old = FT_IS_VARIATION( face );
+
+
if ( num_coords )
face->face_flags |= FT_FACE_FLAG_VARIATION;
else
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ if ( service_mm->construct_ps_name )
+ {
+ if ( error == -1 )
+ {
+ /* The PS name of a named instance and a non-named instance */
+ /* usually differs, even if the axis values are identical. */
+ if ( is_variation_old != FT_IS_VARIATION( face ) )
+ service_mm->construct_ps_name( face );
+ }
+ else
+ service_mm->construct_ps_name( face );
+ }
}
/* internal error code -1 means `no change'; we can exit immediately */
@@ -444,10 +476,26 @@
if ( !error || error == -1 )
{
+ FT_Bool is_variation_old = FT_IS_VARIATION( face );
+
+
if ( num_coords )
face->face_flags |= FT_FACE_FLAG_VARIATION;
else
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ if ( service_mm->construct_ps_name )
+ {
+ if ( error == -1 )
+ {
+ /* The PS name of a named instance and a non-named instance */
+ /* usually differs, even if the axis values are identical. */
+ if ( is_variation_old != FT_IS_VARIATION( face ) )
+ service_mm->construct_ps_name( face );
+ }
+ else
+ service_mm->construct_ps_name( face );
+ }
}
/* internal error code -1 means `no change'; we can exit immediately */
@@ -577,6 +625,33 @@
error = FT_ERR( Invalid_Argument );
if ( service_mm->set_named_instance )
error = service_mm->set_named_instance( face, instance_index );
+
+ if ( !error || error == -1 )
+ {
+ FT_Bool is_variation_old = FT_IS_VARIATION( face );
+
+
+ face->face_flags &= ~FT_FACE_FLAG_VARIATION;
+ face->face_index = ( instance_index << 16 ) |
+ ( face->face_index & 0xFFFFL );
+
+ if ( service_mm->construct_ps_name )
+ {
+ if ( error == -1 )
+ {
+ /* The PS name of a named instance and a non-named instance */
+ /* usually differs, even if the axis values are identical. */
+ if ( is_variation_old != FT_IS_VARIATION( face ) )
+ service_mm->construct_ps_name( face );
+ }
+ else
+ service_mm->construct_ps_name( face );
+ }
+ }
+
+ /* internal error code -1 means `no change'; we can exit immediately */
+ if ( error == -1 )
+ return FT_Err_Ok;
}
if ( !error )
@@ -594,13 +669,6 @@
face->autohint.data = NULL;
}
- if ( !error )
- {
- face->face_index = ( instance_index << 16 ) |
- ( face->face_index & 0xFFFFL );
- face->face_flags &= ~FT_FACE_FLAG_VARIATION;
- }
-
return error;
}