diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-19 09:58:31 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-23 19:25:46 +0000 |
commit | d88da0b2b0a8abaaa521bef864378fe1dbf86709 (patch) | |
tree | 4795f260c1ceaaeeb2cbe64f8314d604e0a7cbe7 /src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh | |
parent | 0d97723ee2778203af0cfd13599572110fb69dd5 (diff) |
Update Harfbuzz to version 4.2.1
[ChangeLog][QtGui][Text] Updated the Harfbuzz code included with
Qt to version 4.2.1.
Pick-to: 6.2 6.3
Fixes: QTBUG-103603
Change-Id: I45fdde8fd0772e4470304c5f6f5a876666356d04
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh new file mode 100644 index 0000000000..e5d999261f --- /dev/null +++ b/src/3rdparty/harfbuzz-ng/src/OT/Layout/GSUB/AlternateSubst.hh @@ -0,0 +1,51 @@ +#ifndef OT_LAYOUT_GSUB_ALTERNATESUBST_HH +#define OT_LAYOUT_GSUB_ALTERNATESUBST_HH + +#include "AlternateSubstFormat1.hh" +#include "Common.hh" + +namespace OT { +namespace Layout { +namespace GSUB { + +struct AlternateSubst +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + AlternateSubstFormat1 format1; + } u; + public: + + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + 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)...)); + default:return_trace (c->default_return_value ()); + } + } + + bool serialize (hb_serialize_context_t *c, + hb_sorted_array_t<const HBGlyphID16> glyphs, + hb_array_t<const unsigned int> alternate_len_list, + hb_array_t<const HBGlyphID16> alternate_glyphs_list) + { + TRACE_SERIALIZE (this); + if (unlikely (!c->extend_min (u.format))) return_trace (false); + unsigned int format = 1; + u.format = format; + switch (u.format) { + case 1: return_trace (u.format1.serialize (c, glyphs, alternate_len_list, alternate_glyphs_list)); + default:return_trace (false); + } + } +}; + +} +} +} + +#endif /* OT_LAYOUT_GSUB_ALTERNATESUBST_HH */ |