summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh b/src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh
index 984a59cca5..5a0fa70544 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-aat-map.hh
@@ -64,19 +64,24 @@ struct hb_aat_map_builder_t
{
hb_aat_layout_feature_type_t type;
hb_aat_layout_feature_selector_t setting;
+ bool is_exclusive;
unsigned seq; /* For stable sorting only. */
HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
const feature_info_t *a = (const feature_info_t *) pa;
const feature_info_t *b = (const feature_info_t *) pb;
- return (a->type != b->type) ? (a->type < b->type ? -1 : 1) :
- (a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0);
+ if (a->type != b->type) return (a->type < b->type ? -1 : 1);
+ if (!a->is_exclusive &&
+ (a->setting & ~1) != (b->setting & ~1)) return (a->setting < b->setting ? -1 : 1);
+ return (a->seq < b->seq ? -1 : a->seq > b->seq ? 1 : 0);
}
- int cmp (hb_aat_layout_feature_type_t ty) const
+ /* compares type & setting only, not is_exclusive flag or seq number */
+ int cmp (const feature_info_t& f) const
{
- return (type != ty) ? (type < ty ? -1 : 1) : 0;
+ return (f.type != type) ? (f.type < type ? -1 : 1) :
+ (f.setting != setting) ? (f.setting < setting ? -1 : 1) : 0;
}
};