diff options
author | Dominik Röttsches <drott@chromium.org> | 2022-06-01 13:24:09 +0200 |
---|---|---|
committer | Dominik Röttsches <drott@chromium.org> | 2022-06-21 12:25:46 +0300 |
commit | 4b6f92e6b3d0d99a839448bc897673b849981997 (patch) | |
tree | 9fd48fb7eb3b32a40437ff0c380be4a998354784 /src | |
parent | b861b24157d3b58368f102dc3632edd7d6e7438f (diff) | |
download | freetype2-4b6f92e6b3d0d99a839448bc897673b849981997.tar.gz |
Proposal: Feature control for variable COLRv1
* include/freetype/ftdriver.h (variable-color-v1 property): Add documentation
for variable-colr-v1 property.
* src/truetype/ttdriver.c (tt_property_set): Ingest variable-control property
when called, set to enable_variable_colrv1 driver flag.
* src/truetype/ttobjs.h (TT_DriverRec): Add enable_variable_colrv1 flag.
Diffstat (limited to 'src')
-rw-r--r-- | src/truetype/ttdriver.c | 17 | ||||
-rw-r--r-- | src/truetype/ttobjs.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 31dcb3c6f..dc063bbb3 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -108,6 +108,23 @@ return error; } + if ( !ft_strcmp( property_name, "TEMPORARY-enable-variable-colrv1" ) ) + { + /* This flag is temporary and can't be set with environment variables. */ + if ( !value_is_string ) + { + FT_Bool* bv = (FT_Bool*)value; + + if ( *bv == TRUE || *bv == FALSE) + driver->enable_variable_colrv1 = *bv; + else + error = FT_ERR( Unimplemented_Feature ); + } else + error = FT_ERR( Invalid_Argument ); + + return error; + } + FT_TRACE2(( "tt_property_set: missing property `%s'\n", property_name )); return FT_THROW( Missing_Property ); diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h index 5fa239d43..b1366fc63 100644 --- a/src/truetype/ttobjs.h +++ b/src/truetype/ttobjs.h @@ -337,6 +337,8 @@ FT_BEGIN_HEADER FT_UInt interpreter_version; + FT_Bool enable_variable_colrv1; + } TT_DriverRec; |