Commit d2c3bbcd8ec175a750d76f0bf50162ea9e3aaf85

Werner Lemberg 2022-03-19T19:31:25

[cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`. * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro. (cff_slot_load): Use it.

diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 2ef9c76..ff0d9cf 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -29,6 +29,14 @@
 
 #include "cfferrs.h"
 
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#define IS_DEFAULT_INSTANCE( _face )             \
+          ( !( FT_IS_NAMED_INSTANCE( _face ) ||  \
+               FT_IS_VARIATION( _face )      ) )
+#else
+#define IS_DEFAULT_INSTANCE( _face )  1
+#endif
+
 
   /**************************************************************************
    *
@@ -255,8 +263,8 @@
 
 
       if ( size->strike_index != 0xFFFFFFFFUL      &&
-           sfnt->load_eblc                         &&
-           ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
+           ( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
+           IS_DEFAULT_INSTANCE( size->root.face )  )
       {
         TT_SBit_MetricsRec  metrics;