Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / src / hb-aat-layout-feat-table.hh
index 788d408..359e859 100644 (file)
@@ -129,6 +129,11 @@ struct FeatureName
 
   hb_ot_name_id_t get_feature_name_id () const { return nameIndex; }
 
+  bool is_exclusive () const { return featureFlags & Exclusive; }
+
+  /* A FeatureName with no settings is meaningless */
+  bool has_data () const { return nSettings; }
+
   bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
@@ -139,7 +144,7 @@ struct FeatureName
   protected:
   HBUINT16     feature;        /* Feature type. */
   HBUINT16     nSettings;      /* The number of records in the setting name array. */
-  LOffsetTo<UnsizedArrayOf<SettingName>, false>
+  LNNOffsetTo<UnsizedArrayOf<SettingName>>
                settingTableZ;  /* Offset in bytes from the beginning of this table to
                                 * this feature's setting name array. The actual type of
                                 * record this offset refers to will depend on the
@@ -172,6 +177,9 @@ struct feat
     return featureNameCount;
   }
 
+  bool exposes_feature (hb_aat_layout_feature_type_t feature_type) const
+  { return get_feature (feature_type).has_data (); }
+
   const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const
   { return namesZ.bsearch (featureNameCount, feature_type); }