diff --git a/src/hb-config.hh b/src/hb-config.hh index 509768e61..db8ec0e90 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -100,6 +100,7 @@ #ifdef HB_NO_BORING_EXPANSION #define HB_NO_BEYOND_64K +#define HB_NO_VARIATIONS2 #endif #ifdef HB_DISABLE_DEPRECATED diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh index 7bd2e2f37..d549fbe86 100644 --- a/src/hb-ot-var-avar-table.hh +++ b/src/hb-ot-var-avar-table.hh @@ -141,9 +141,13 @@ struct avar bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (unlikely (!(version.sanitize (c) && - (version.major == 1 || version.major == 2) && - c->check_struct (this)))) + if (!(version.sanitize (c) && + (version.major == 1 +#ifndef HB_NO_VARIATIONS2 + || version.major == 2 +#endif + ) && + c->check_struct (this))) return_trace (false); const SegmentMaps *map = &firstAxisSegmentMaps; @@ -155,12 +159,14 @@ struct avar map = &StructAfter (*map); } +#ifndef HB_NO_VARIATIONS2 if (version.major == 2) { const auto *v2 = (const avarV2Tail *) map; if (unlikely (!v2->sanitize (c, this))) return_trace (false); } +#endif return_trace (true); } @@ -176,6 +182,7 @@ struct avar map = &StructAfter (*map); } +#ifndef HB_NO_VARIATIONS2 if (version.major < 2) return; @@ -201,6 +208,7 @@ struct avar for (unsigned i = 0; i < coords_length; i++) coords[i] = out[i]; +#endif } void unmap_coords (int *coords, unsigned int coords_length) const