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.
This commit is contained in:
parent
e97cb9e8da
commit
ba4bd5b994
|
@ -739,6 +739,24 @@ FT_BEGIN_HEADER
|
||||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* 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
|
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
|
||||||
|
|
|
@ -739,6 +739,24 @@ FT_BEGIN_HEADER
|
||||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* 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
|
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
|
||||||
|
|
|
@ -364,10 +364,13 @@
|
||||||
|
|
||||||
FT_Long version;
|
FT_Long version;
|
||||||
FT_Long axisCount;
|
FT_Long axisCount;
|
||||||
FT_ULong table_offset;
|
|
||||||
FT_ULong table_len;
|
FT_ULong table_len;
|
||||||
|
|
||||||
|
#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
|
||||||
|
FT_ULong table_offset;
|
||||||
FT_ULong store_offset;
|
FT_ULong store_offset;
|
||||||
FT_ULong axisMap_offset;
|
FT_ULong axisMap_offset;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
FT_TRACE2(( "AVAR " ));
|
FT_TRACE2(( "AVAR " ));
|
||||||
|
@ -380,7 +383,9 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
|
||||||
table_offset = FT_STREAM_POS();
|
table_offset = FT_STREAM_POS();
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( FT_FRAME_ENTER( table_len ) )
|
if ( FT_FRAME_ENTER( table_len ) )
|
||||||
return;
|
return;
|
||||||
|
@ -388,7 +393,11 @@
|
||||||
version = FT_GET_LONG();
|
version = FT_GET_LONG();
|
||||||
axisCount = 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" ));
|
FT_TRACE2(( "bad table version\n" ));
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
@ -445,6 +454,7 @@
|
||||||
FT_TRACE5(( "\n" ));
|
FT_TRACE5(( "\n" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef TT_CONFIG_OPTION_NO_BORING_EXPANSION
|
||||||
if ( version < 0x00020000L )
|
if ( version < 0x00020000L )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
@ -472,6 +482,7 @@
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
|
Loading…
Reference in New Issue