1 #ifndef OT_LAYOUT_GPOS_LIGATUREARRAY_HH
2 #define OT_LAYOUT_GPOS_LIGATUREARRAY_HH
9 typedef AnchorMatrix LigatureAttach; /* component-major--
10 * in order of writing direction--,
12 * ordered by class--zero-based. */
14 /* Array of LigatureAttach tables ordered by LigatureCoverage Index */
15 struct LigatureArray : List16OfOffset16To<LigatureAttach>
17 template <typename Iterator,
18 hb_requires (hb_is_iterator (Iterator))>
19 bool subset (hb_subset_context_t *c,
22 const hb_map_t *klass_mapping) const
25 const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
27 auto *out = c->serializer->start_embed (this);
28 if (unlikely (!c->serializer->extend_min (out))) return_trace (false);
31 for (const auto _ : + hb_zip (coverage, *this)
32 | hb_filter (glyphset, hb_first))
34 auto *matrix = out->serialize_append (c->serializer);
35 if (unlikely (!matrix)) return_trace (false);
37 const LigatureAttach& src = (this + _.second);
39 + hb_range (src.rows * class_count)
40 | hb_filter ([=] (unsigned index) { return klass_mapping->has (index % class_count); })
42 ret |= matrix->serialize_subset (c,
57 #endif /* OT_LAYOUT_GPOS_LIGATUREARRAY_HH */