summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-07-24 23:05:03 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-07-24 23:05:03 +0300
commit5f5a9f256cad866172c18939e31162ba038ac02e (patch)
treec0d398d0ae345b40fd7b847057267f4ad1852554 /thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh
parentb3df27526a0374f2fd5f44eab99da4b4bfd9f9ec (diff)
HarfBuzz: Update to version 5.0.1
Diffstat (limited to 'thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh')
-rw-r--r--thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh23
1 files changed, 12 insertions, 11 deletions
diff --git a/thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh
index 19dfe98469..32b642c38a 100644
--- a/thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh
+++ b/thirdparty/harfbuzz/src/OT/Layout/GSUB/LigatureSubstFormat1.hh
@@ -6,20 +6,21 @@
namespace OT {
namespace Layout {
-namespace GSUB {
+namespace GSUB_impl {
-struct LigatureSubstFormat1
+template <typename Types>
+struct LigatureSubstFormat1_2
{
protected:
HBUINT16 format; /* Format identifier--format = 1 */
- Offset16To<Coverage>
+ typename Types::template OffsetTo<Coverage>
coverage; /* Offset to Coverage table--from
* beginning of Substitution table */
- Array16OfOffset16To<LigatureSet>
+ Array16Of<typename Types::template OffsetTo<LigatureSet<Types>>>
ligatureSet; /* Array LigatureSet tables
* ordered by Coverage Index */
public:
- DEFINE_SIZE_ARRAY (6, ligatureSet);
+ DEFINE_SIZE_ARRAY (4 + Types::size, ligatureSet);
bool sanitize (hb_sanitize_context_t *c) const
{
@@ -33,7 +34,7 @@ struct LigatureSubstFormat1
+ hb_zip (this+coverage, ligatureSet)
| hb_filter (*glyphs, hb_first)
| hb_map (hb_second)
- | hb_map ([this, glyphs] (const Offset16To<LigatureSet> &_)
+ | hb_map ([this, glyphs] (const typename Types::template OffsetTo<LigatureSet<Types>> &_)
{ return (this+_).intersects (glyphs); })
| hb_any
;
@@ -48,7 +49,7 @@ struct LigatureSubstFormat1
| hb_filter (c->parent_active_glyphs (), hb_first)
| hb_map (hb_second)
| hb_map (hb_add (this))
- | hb_apply ([c] (const LigatureSet &_) { _.closure (c); })
+ | hb_apply ([c] (const LigatureSet<Types> &_) { _.closure (c); })
;
}
@@ -62,7 +63,7 @@ struct LigatureSubstFormat1
+ hb_zip (this+coverage, ligatureSet)
| hb_map (hb_second)
| hb_map (hb_add (this))
- | hb_apply ([c] (const LigatureSet &_) { _.collect_glyphs (c); })
+ | hb_apply ([c] (const LigatureSet<Types> &_) { _.collect_glyphs (c); })
;
}
@@ -73,7 +74,7 @@ struct LigatureSubstFormat1
unsigned int index = (this+coverage).get_coverage (c->glyphs[0]);
if (likely (index == NOT_COVERED)) return false;
- const LigatureSet &lig_set = this+ligatureSet[index];
+ const auto &lig_set = this+ligatureSet[index];
return lig_set.would_apply (c);
}
@@ -84,7 +85,7 @@ struct LigatureSubstFormat1
unsigned int index = (this+coverage).get_coverage (c->buffer->cur ().codepoint);
if (likely (index == NOT_COVERED)) return_trace (false);
- const LigatureSet &lig_set = this+ligatureSet[index];
+ const auto &lig_set = this+ligatureSet[index];
return_trace (lig_set.apply (c));
}
@@ -128,7 +129,7 @@ struct LigatureSubstFormat1
hb_set_t new_coverage;
+ hb_zip (this+coverage, hb_iter (ligatureSet) | hb_map (hb_add (this)))
| hb_filter (glyphset, hb_first)
- | hb_filter ([&] (const LigatureSet& _) {
+ | hb_filter ([&] (const LigatureSet<Types>& _) {
return _.intersects (&glyphset);
}, hb_second)
| hb_map (hb_first)