Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro. This gives users a possibility to deactivate new features not (yet) in the OpenType standard. * include/freetype/config/ftoption.h, devel/ftoption.h (TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro. * src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar' version 2.0 support.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/devel/ftoption.h b/devel/ftoption.h
index 740b6b3..6e3a2e6 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -741,6 +741,24 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * Define `TT_CONFIG_OPTION_NO_BORING_EXPANSION` if you want to exclude
+ * support for 'boring' OpenType specification expansions.
+ *
+ * https://github.com/harfbuzz/boring-expansion-spec
+ *
+ * Right now, the following features are covered:
+ *
+ * - 'avar' version 2.0
+ *
+ * Most likely, this is a temporary configuration option to be removed in
+ * the near future, since it is assumed that eventually those features are
+ * added to the OpenType standard.
+ */
+/* #define TT_CONFIG_OPTION_NO_BORING_EXPANSION */
+
+
+ /**************************************************************************
+ *
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
* embedded 'BDF~' table within SFNT-based bitmap formats.
*/
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 1381de6..2f6cdc8 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -741,6 +741,24 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * Define `TT_CONFIG_OPTION_NO_BORING_EXPANSION` if you want to exclude
+ * support for 'boring' OpenType specification expansions.
+ *
+ * https://github.com/harfbuzz/boring-expansion-spec
+ *
+ * Right now, the following features are covered:
+ *
+ * - 'avar' version 2.0
+ *
+ * Most likely, this is a temporary configuration option to be removed in
+ * the near future, since it is assumed that eventually those features are
+ * added to the OpenType standard.
+ */
+/* #define TT_CONFIG_OPTION_NO_BORING_EXPANSION */
+
+
+ /**************************************************************************
+ *
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
* embedded 'BDF~' table within SFNT-based bitmap formats.
*/
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 458b958..370a92c 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -364,10 +364,13 @@
FT_Long version;
FT_Long axisCount;
- FT_ULong table_offset;
FT_ULong table_len;
+
+#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
+ FT_ULong table_offset;
FT_ULong store_offset;
FT_ULong axisMap_offset;
+#endif
FT_TRACE2(( "AVAR " ));
@@ -380,7 +383,9 @@
return;
}
+#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
table_offset = FT_STREAM_POS();
+#endif
if ( FT_FRAME_ENTER( table_len ) )
return;
@@ -388,7 +393,11 @@
version = FT_GET_LONG();
axisCount = FT_GET_LONG();
- if ( version != 0x00010000L && version != 0x00020000L )
+ if ( version != 0x00010000L
+#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
+ && version != 0x00020000L
+#endif
+ )
{
FT_TRACE2(( "bad table version\n" ));
goto Exit;
@@ -445,6 +454,7 @@
FT_TRACE5(( "\n" ));
}
+#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
if ( version < 0x00020000L )
goto Exit;
@@ -472,6 +482,7 @@
if ( error )
goto Exit;
}
+#endif
Exit: