[subset] temporarily disable COLRv1 subsetting.

Currently COLRv1 spec is being changed so the subsetting implementation is out of sync. Disable subsetting by failing sanitization for COLRv1 tables and disable all colrv1 tests.
This commit is contained in:
Garret Rieger 2021-07-27 14:31:18 -07:00 committed by Behdad Esfahbod
parent 5dae8297bb
commit acbd8b27dc
4 changed files with 22 additions and 4 deletions

View File

@ -41,6 +41,10 @@
#define COLRV1_MAX_NESTING_LEVEL 100 #define COLRV1_MAX_NESTING_LEVEL 100
#endif #endif
#ifndef COLRV1_DISABLE_SUBSETTING
#define COLRV1_DISABLE_SUBSETTING 1
#endif
namespace OT { namespace OT {
struct COLR; struct COLR;
@ -970,6 +974,12 @@ struct COLR
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
#if COLRV1_DISABLE_SUBSETTING == 1
return_trace (c->check_struct (this) &&
(this+baseGlyphsZ).sanitize (c, numBaseGlyphs) &&
(this+layersZ).sanitize (c, numLayers) &&
(version == 0));
#else
return_trace (c->check_struct (this) && return_trace (c->check_struct (this) &&
(this+baseGlyphsZ).sanitize (c, numBaseGlyphs) && (this+baseGlyphsZ).sanitize (c, numBaseGlyphs) &&
(this+layersZ).sanitize (c, numLayers) && (this+layersZ).sanitize (c, numLayers) &&
@ -977,6 +987,7 @@ struct COLR
baseGlyphsV1List.sanitize (c, this) && baseGlyphsV1List.sanitize (c, this) &&
layersV1.sanitize (c, this) && layersV1.sanitize (c, this) &&
varStore.sanitize (c, this)))); varStore.sanitize (c, this))));
#endif
} }
template<typename BaseIterator, typename LayerIterator, template<typename BaseIterator, typename LayerIterator,

View File

@ -39,6 +39,7 @@ EXTRA_DIST += \
expected/colr \ expected/colr \
expected/colr_with_components \ expected/colr_with_components \
expected/colrv1.notoemoji \ expected/colrv1.notoemoji \
expected/colrv1 \
expected/cbdt \ expected/cbdt \
expected/variable \ expected/variable \
fonts \ fonts \

View File

@ -8,7 +8,6 @@ TESTS = \
tests/cmap14.tests \ tests/cmap14.tests \
tests/colr.tests \ tests/colr.tests \
tests/colr_with_components.tests \ tests/colr_with_components.tests \
tests/colrv1.notoemoji.tests \
tests/full-font.tests \ tests/full-font.tests \
tests/japanese.tests \ tests/japanese.tests \
tests/layout.context.tests \ tests/layout.context.tests \
@ -35,6 +34,11 @@ TESTS = \
tests/variable.tests \ tests/variable.tests \
$(NULL) $(NULL)
# TODO: re-enable once colrv1 subsetting is stabilized.
# tests/colrv1.notoemoji.tests
# tests/colrv1.tests
XFAIL_TESTS = \ XFAIL_TESTS = \
$(NULL) $(NULL)

View File

@ -29,7 +29,9 @@ tests = [
'cmap14', 'cmap14',
'sbix', 'sbix',
'colr', 'colr',
'colrv1.notoemoji', # TODO: re-enable once colrv1 subsetting is stabilized.
# 'colrv1.notoemoji',
# 'colrv1',
'colr_with_components', 'colr_with_components',
'cbdt', 'cbdt',
'variable', 'variable',