Commit 4c3916e901ac88243321b7518c023dc8c51a7586

Alexei Podtelezhnikov 2023-02-08T14:58:46

[truetype, type1] Additional variation tags. Sync with https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags * src/truetype/ttgxvar.h (TTAG_ital): New tag. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it. * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.

diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 699acb6..55861c5 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2713,6 +2713,8 @@
           a->name = (char*)"OpticalSize";
         else if ( a->tag == TTAG_slnt )
           a->name = (char*)"Slant";
+        else if ( a->tag == TTAG_ital )
+          a->name = (char*)"Italic";
 
         next_name += 5;
         a++;
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index 9d88ce7..4fec980 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -343,6 +343,7 @@ FT_BEGIN_HEADER
 #define TTAG_wdth  FT_MAKE_TAG( 'w', 'd', 't', 'h' )
 #define TTAG_opsz  FT_MAKE_TAG( 'o', 'p', 's', 'z' )
 #define TTAG_slnt  FT_MAKE_TAG( 's', 'l', 'n', 't' )
+#define TTAG_ital  FT_MAKE_TAG( 'i', 't', 'a', 'l' )
 
 
   FT_LOCAL( FT_Error )
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 30720f6..5a1afd8 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -355,6 +355,10 @@
         mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' );
       else if ( ft_strcmp( mmvar->axis[i].name, "OpticalSize" ) == 0 )
         mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' );
+      else if ( ft_strcmp( mmvar->axis[i].name, "Slant" ) == 0 )
+        mmvar->axis[i].tag = FT_MAKE_TAG( 's', 'l', 'n', 't' );
+      else if ( ft_strcmp( mmvar->axis[i].name, "Italic" ) == 0 )
+        mmvar->axis[i].tag = FT_MAKE_TAG( 'i', 't', 'a', 'l' );
     }
 
     mm_weights_unmap( blend->default_weight_vector,