summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-06-01 07:53:31 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-06-06 14:09:03 +0000
commitd390ac99f2c2a0f70319df5f6ed3068cc5cbd6fe (patch)
tree1c0251b2ab390410e5ddb47dd3d049d4192cf490 /src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh
parent79436bd34ddf2dc39d42ed9b80a54f4d581c44d9 (diff)
Upgrade Harfbuzz to 7.3.0
Fixes: QTBUG-114098 Pick-to: 6.2 6.5 6.6 Change-Id: I7bc766e6edada6f964c2dc40f18ff710249fb159 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh
index 52b7dc254b..36f123b559 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common.hh
@@ -189,7 +189,7 @@ struct hb_collect_variation_indices_context_t :
hb_set_t *layout_variation_indices;
hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *varidx_delta_map;
- hb_font_t *font;
+ hb_vector_t<int> *normalized_coords;
const VariationStore *var_store;
const hb_set_t *glyph_set;
const hb_map_t *gpos_lookups;
@@ -197,14 +197,14 @@ struct hb_collect_variation_indices_context_t :
hb_collect_variation_indices_context_t (hb_set_t *layout_variation_indices_,
hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *varidx_delta_map_,
- hb_font_t *font_,
+ hb_vector_t<int> *normalized_coords_,
const VariationStore *var_store_,
const hb_set_t *glyph_set_,
const hb_map_t *gpos_lookups_,
float *store_cache_) :
layout_variation_indices (layout_variation_indices_),
varidx_delta_map (varidx_delta_map_),
- font (font_),
+ normalized_coords (normalized_coords_),
var_store (var_store_),
glyph_set (glyph_set_),
gpos_lookups (gpos_lookups_),
@@ -1769,6 +1769,7 @@ struct ClassDefFormat2_4
return_trace (true);
}
+ unsigned unsorted = false;
unsigned num_ranges = 1;
hb_codepoint_t prev_gid = (*it).first;
unsigned prev_klass = (*it).second;
@@ -1789,6 +1790,10 @@ struct ClassDefFormat2_4
if (cur_gid != prev_gid + 1 ||
cur_klass != prev_klass)
{
+
+ if (unlikely (cur_gid < prev_gid))
+ unsorted = true;
+
if (unlikely (!record)) break;
record->last = prev_gid;
num_ranges++;
@@ -1804,8 +1809,14 @@ struct ClassDefFormat2_4
prev_gid = cur_gid;
}
+ if (unlikely (c->in_error ())) return_trace (false);
+
if (likely (record)) record->last = prev_gid;
rangeRecord.len = num_ranges;
+
+ if (unlikely (unsorted))
+ rangeRecord.as_array ().qsort (RangeRecord<Types>::cmp_range);
+
return_trace (true);
}
@@ -2097,8 +2108,15 @@ struct ClassDef
#ifndef HB_NO_BEYOND_64K
if (glyph_max > 0xFFFFu)
- format += 2;
+ u.format += 2;
+ if (unlikely (glyph_max > 0xFFFFFFu))
+#else
+ if (unlikely (glyph_max > 0xFFFFu))
#endif
+ {
+ c->check_success (false, HB_SERIALIZE_ERROR_INT_OVERFLOW);
+ return_trace (false);
+ }
u.format = format;
@@ -3547,8 +3565,9 @@ struct VariationDevice
{
c->layout_variation_indices->add (varIdx);
int delta = 0;
- if (c->font && c->var_store)
- delta = roundf (get_delta (c->font, *c->var_store, c->store_cache));
+ if (c->normalized_coords && c->var_store)
+ delta = roundf (c->var_store->get_delta (varIdx, c->normalized_coords->arrayZ,
+ c->normalized_coords->length, c->store_cache));
/* set new varidx to HB_OT_LAYOUT_NO_VARIATIONS_INDEX here, will remap
* varidx later*/