Commit 70704b34ace5667ac700a5d85d7d8a1ba2b58da0

Werner Lemberg 2016-12-20T12:27:22

[truetype] Improve logic for getting fast advance widths. * src/cff/cffdrivr.c (cff_get_advances), src/truetype/ttdriver.c (tt_get_advances): Use `is_default_instance' for test; this gets recomputed after changing blend coordinates.

diff --git a/ChangeLog b/ChangeLog
index db292bf..b0e3691 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-12-20  Werner Lemberg  <wl@gnu.org>
+
+	[truetype] Improve logic for getting fast advance widths.
+
+	* src/cff/cffdrivr.c (cff_get_advances), src/truetype/ttdriver.c
+	(tt_get_advances): Use `is_default_instance' for test; this gets
+	recomputed after changing blend coordinates.
+
 2016-12-20  Ben Wagner  <bungeman@google.com>
 	    Werner Lemberg  <wl@gnu.org>
 
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 3e0ef86..3f426c6 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -219,8 +219,8 @@
       {
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
         /* no fast retrieval for blended MM fonts without VVAR table */
-        if ( ( FT_HAS_MULTIPLE_MASTERS( face ) && ttface->blend ) &&
-             !( var && var->vadvance_adjust )                     )
+        if ( !ttface->is_default_instance     &&
+             !( var && var->vadvance_adjust ) )
           return FT_THROW( Unimplemented_Feature );
 #endif
 
@@ -251,8 +251,8 @@
       {
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
         /* no fast retrieval for blended MM fonts without HVAR table */
-        if ( ( FT_HAS_MULTIPLE_MASTERS( face ) && ttface->blend ) &&
-             !( var && var->hadvance_adjust )                     )
+        if ( !ttface->is_default_instance     &&
+             !( var && var->hadvance_adjust ) )
           return FT_THROW( Unimplemented_Feature );
 #endif
 
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 66e721e..91ddff5 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -238,8 +238,8 @@
     {
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
       /* no fast retrieval for blended MM fonts without VVAR table */
-      if ( ( FT_HAS_MULTIPLE_MASTERS( ttface ) && face->blend ) &&
-           !( var && var->vadvance_adjust )                     )
+      if ( !face->is_default_instance       &&
+           !( var && var->vadvance_adjust ) )
         return FT_THROW( Unimplemented_Feature );
 #endif
 
@@ -258,8 +258,8 @@
     {
 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
       /* no fast retrieval for blended MM fonts without HVAR table */
-      if ( ( FT_HAS_MULTIPLE_MASTERS( ttface ) && face->blend ) &&
-           !( var && var->hadvance_adjust )                     )
+      if ( !face->is_default_instance       &&
+           !( var && var->hadvance_adjust ) )
         return FT_THROW( Unimplemented_Feature );
 #endif