comparison mupdf-source/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookup.hh @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 #ifndef OT_LAYOUT_GPOS_POSLOOKUP_HH
2 #define OT_LAYOUT_GPOS_POSLOOKUP_HH
3
4 #include "PosLookupSubTable.hh"
5 #include "../../../hb-ot-layout-common.hh"
6
7 namespace OT {
8 namespace Layout {
9 namespace GPOS_impl {
10
11 struct PosLookup : Lookup
12 {
13 using SubTable = PosLookupSubTable;
14
15 const SubTable& get_subtable (unsigned int i) const
16 { return Lookup::get_subtable<SubTable> (i); }
17
18 bool is_reverse () const
19 {
20 return false;
21 }
22
23 bool apply (hb_ot_apply_context_t *c) const
24 {
25 TRACE_APPLY (this);
26 return_trace (dispatch (c));
27 }
28
29 bool intersects (const hb_set_t *glyphs) const
30 {
31 hb_intersects_context_t c (glyphs);
32 return dispatch (&c);
33 }
34
35 hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
36 { return dispatch (c); }
37
38 hb_closure_lookups_context_t::return_t closure_lookups (hb_closure_lookups_context_t *c, unsigned this_index) const
39 {
40 if (c->is_lookup_visited (this_index))
41 return hb_closure_lookups_context_t::default_return_value ();
42
43 c->set_lookup_visited (this_index);
44 if (!intersects (c->glyphs))
45 {
46 c->set_lookup_inactive (this_index);
47 return hb_closure_lookups_context_t::default_return_value ();
48 }
49
50 hb_closure_lookups_context_t::return_t ret = dispatch (c);
51 return ret;
52 }
53
54 template <typename set_t>
55 void collect_coverage (set_t *glyphs) const
56 {
57 hb_collect_coverage_context_t<set_t> c (glyphs);
58 dispatch (&c);
59 }
60
61 template <typename context_t>
62 static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
63
64 template <typename context_t, typename ...Ts>
65 typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
66 { return Lookup::dispatch<SubTable> (c, std::forward<Ts> (ds)...); }
67
68 bool subset (hb_subset_context_t *c) const
69 { return Lookup::subset<SubTable> (c); }
70
71 bool sanitize (hb_sanitize_context_t *c) const
72 { return Lookup::sanitize<SubTable> (c); }
73 };
74
75 }
76 }
77 }
78
79 #endif /* OT_LAYOUT_GPOS_POSLOOKUP_HH */