1 #ifndef OT_LAYOUT_GSUB_LIGATURESUBST_HH
2 #define OT_LAYOUT_GSUB_LIGATURESUBST_HH
5 #include "LigatureSubstFormat1.hh"
15 HBUINT16 format; /* Format identifier */
16 LigatureSubstFormat1_2<SmallTypes> format1;
17 #ifndef HB_NO_BEYOND_64K
18 LigatureSubstFormat1_2<MediumTypes> format2;
23 template <typename context_t, typename ...Ts>
24 typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
26 if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
27 TRACE_DISPATCH (this, u.format);
29 case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
30 #ifndef HB_NO_BEYOND_64K
31 case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
33 default:return_trace (c->default_return_value ());
37 /* TODO This function is only used by small GIDs, and not updated to 24bit GIDs. Should
38 * be done by using iterators. While at it perhaps using iterator of arrays of hb_codepoint_t
40 bool serialize (hb_serialize_context_t *c,
41 hb_sorted_array_t<const HBGlyphID16> first_glyphs,
42 hb_array_t<const unsigned int> ligature_per_first_glyph_count_list,
43 hb_array_t<const HBGlyphID16> ligatures_list,
44 hb_array_t<const unsigned int> component_count_list,
45 hb_array_t<const HBGlyphID16> component_list /* Starting from second for each ligature */)
47 TRACE_SERIALIZE (this);
48 if (unlikely (!c->extend_min (u.format))) return_trace (false);
49 unsigned int format = 1;
52 case 1: return_trace (u.format1.serialize (c,
54 ligature_per_first_glyph_count_list,
58 default:return_trace (false);
62 /* TODO subset() should choose format. */
71 #endif /* OT_LAYOUT_GSUB_LIGATURESUBST_HH */