summaryrefslogtreecommitdiff
path: root/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-02-27 12:11:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-02 05:21:49 +0000
commit7f8020f1f7177d8f3a626e0b746f07dd7727b7e6 (patch)
tree8cdf4986c75789e01b7538a16d47e5452d439732 /src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh
parent474e2c9208a9cc7398b1882dd73b4034da6d44b6 (diff)
downloadqtbase-7f8020f1f7177d8f3a626e0b746f07dd7727b7e6.tar.gz
Update Harfbuzz to 7.0.1
This is the 6.4-specific update of Harfbuzz, since Harfbuzz was currently on an older version in 6.4 compared to other branches. This also backports the change to the qtextlayout test that was done on other branches for the 6.0.0 update. Fixes: QTBUG-111535 Change-Id: Ie8217f1541a02d3800142b88cf0007be0ed0d1e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 13549fa7c2d27ba588471f97a640f4dbcf86b10c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh
index 786428fe45..4529927ba6 100644
--- a/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh
+++ b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/SingleSubst.hh
@@ -7,15 +7,19 @@
namespace OT {
namespace Layout {
-namespace GSUB {
+namespace GSUB_impl {
struct SingleSubst
{
protected:
union {
- HBUINT16 format; /* Format identifier */
- SingleSubstFormat1 format1;
- SingleSubstFormat2 format2;
+ HBUINT16 format; /* Format identifier */
+ SingleSubstFormat1_3<SmallTypes> format1;
+ SingleSubstFormat2_4<SmallTypes> format2;
+#ifndef HB_NO_BEYOND_64K
+ SingleSubstFormat1_3<MediumTypes> format3;
+ SingleSubstFormat2_4<MediumTypes> format4;
+#endif
} u;
public:
@@ -23,11 +27,15 @@ struct SingleSubst
template <typename context_t, typename ...Ts>
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
+ if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
- if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
+#ifndef HB_NO_BEYOND_64K
+ case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
+ case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
+#endif
default:return_trace (c->default_return_value ());
}
}
@@ -45,11 +53,24 @@ struct SingleSubst
if (glyphs)
{
format = 1;
+ hb_codepoint_t mask = 0xFFFFu;
+
+#ifndef HB_NO_BEYOND_64K
+ if (+ glyphs
+ | hb_map_retains_sorting (hb_first)
+ | hb_filter ([] (hb_codepoint_t gid) { return gid > 0xFFFFu; }))
+ {
+ format += 2;
+ mask = 0xFFFFFFu;
+ }
+#endif
+
auto get_delta = [=] (hb_codepoint_pair_t _)
- { return (unsigned) (_.second - _.first) & 0xFFFF; };
+ { return (unsigned) (_.second - _.first) & mask; };
delta = get_delta (*glyphs);
- if (!hb_all (++(+glyphs), delta, get_delta)) format = 2;
+ if (!hb_all (++(+glyphs), delta, get_delta)) format += 1;
}
+
u.format = format;
switch (u.format) {
case 1: return_trace (u.format1.serialize (c,
@@ -57,6 +78,13 @@ struct SingleSubst
| hb_map_retains_sorting (hb_first),
delta));
case 2: return_trace (u.format2.serialize (c, glyphs));
+#ifndef HB_NO_BEYOND_64K
+ case 3: return_trace (u.format3.serialize (c,
+ + glyphs
+ | hb_map_retains_sorting (hb_first),
+ delta));
+ case 4: return_trace (u.format4.serialize (c, glyphs));
+#endif
default:return_trace (false);
}
}