From acbd8b27dce3ee369f7d6022eb8bcddfd2fb666c Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 27 Jul 2021 14:31:18 -0700 Subject: [PATCH] [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. --- src/hb-ot-color-colr-table.hh | 15 +++++++++++++-- test/subset/data/Makefile.am | 1 + test/subset/data/Makefile.sources | 6 +++++- test/subset/meson.build | 4 +++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index b714f991f..7085b04a8 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -41,6 +41,10 @@ #define COLRV1_MAX_NESTING_LEVEL 100 #endif +#ifndef COLRV1_DISABLE_SUBSETTING +#define COLRV1_DISABLE_SUBSETTING 1 +#endif + namespace OT { struct COLR; @@ -597,7 +601,7 @@ template class Var> struct PaintTranslate { HB_INTERNAL void closurev1 (hb_colrv1_closure_context_t* c) const; - + bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); @@ -929,7 +933,7 @@ struct COLR if (!numBaseGlyphs || !numLayers) return; hb_array_t baseGlyphs = (this+baseGlyphsZ).as_array (numBaseGlyphs); hb_array_t all_layers = (this+layersZ).as_array (numLayers); - + for (const BaseGlyphRecord record : baseGlyphs) { if (!glyphs->has (record.glyphId)) continue; @@ -970,6 +974,12 @@ struct COLR bool sanitize (hb_sanitize_context_t *c) const { 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) && (this+baseGlyphsZ).sanitize (c, numBaseGlyphs) && (this+layersZ).sanitize (c, numLayers) && @@ -977,6 +987,7 @@ struct COLR baseGlyphsV1List.sanitize (c, this) && layersV1.sanitize (c, this) && varStore.sanitize (c, this)))); +#endif } template