Commit 638df2fe32b847d565419fb9becd9f1dccf3429a

Alexei Podtelezhnikov 2023-02-27T21:54:23

[truetype] Treat 38 as 40 without Infinality. * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Reinstate. * src/truetype/ttdriver.c (tt_property_set): Fallback from 38 to 40.

diff --git a/include/freetype/ftdriver.h b/include/freetype/ftdriver.h
index 4ed8b59..59804ab 100644
--- a/include/freetype/ftdriver.h
+++ b/include/freetype/ftdriver.h
@@ -757,7 +757,7 @@ FT_BEGIN_HEADER
    *
    */
 #define TT_INTERPRETER_VERSION_35  35
-#define TT_INTERPRETER_VERSION_38  40
+#define TT_INTERPRETER_VERSION_38  38
 #define TT_INTERPRETER_VERSION_40  40
 
 
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index 4bea63e..4e689e9 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -93,17 +93,27 @@
         interpreter_version = *iv;
       }
 
-      if ( interpreter_version == TT_INTERPRETER_VERSION_35
+      switch ( interpreter_version )
+      {
+      case TT_INTERPRETER_VERSION_35:
+        driver->interpreter_version = TT_INTERPRETER_VERSION_35;
+        break;
+
+      case TT_INTERPRETER_VERSION_38:
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-           || interpreter_version == TT_INTERPRETER_VERSION_38
+        driver->interpreter_version = TT_INTERPRETER_VERSION_38;
+      break;
 #endif
+
+      case TT_INTERPRETER_VERSION_40:
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
-           || interpreter_version == TT_INTERPRETER_VERSION_40
+        driver->interpreter_version = TT_INTERPRETER_VERSION_40;
+      break;
 #endif
-         )
-        driver->interpreter_version = interpreter_version;
-      else
+
+      default:
         error = FT_ERR( Unimplemented_Feature );
+      }
 
       return error;
     }