[config] Add HB_NO_VAR to disable variations support, enabled by HB_TINY
Part of https://github.com/harfbuzz/harfbuzz/issues/1652
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index 4bc3d7e..dd54c9b 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -2661,11 +2661,17 @@
bool find_variations_index (const int *coords, unsigned int num_coords,
unsigned int *index) const
- { return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations))
- .find_index (coords, num_coords, index); }
+ {
+#ifdef HB_NOVAR
+ return false;
+#endif
+ return (version.to_int () >= 0x00010001u ? this+featureVars : Null(FeatureVariations))
+ .find_index (coords, num_coords, index);
+ }
const Feature& get_feature_variation (unsigned int feature_index,
unsigned int variations_index) const
{
+#ifndef HB_NO_VAR
if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
version.to_int () >= 0x00010001u)
{
@@ -2674,6 +2680,7 @@
if (feature)
return *feature;
}
+#endif
return get_feature (feature_index);
}
@@ -2695,8 +2702,10 @@
this,
out);
+#ifndef HB_NO_VAR
if (version.to_int () >= 0x00010001u)
out->featureVars.serialize_copy (c->serializer, featureVars, this, out);
+#endif
return_trace (true);
}
@@ -2717,7 +2726,10 @@
scriptList.sanitize (c, this) &&
featureList.sanitize (c, this) &&
CastR<OffsetTo<TLookupList>> (lookupList).sanitize (c, this) &&
- (version.to_int () < 0x00010001u || featureVars.sanitize (c, this)));
+#ifndef HB_NO_VAR
+ (version.to_int () < 0x00010001u || featureVars.sanitize (c, this)) &&
+#endif
+ true);
}
template <typename T>