xref: /aosp_15_r20/external/harfbuzz_ng/src/OT/Layout/GSUB/GSUB.hh (revision 2d1272b857b1f7575e6e246373e1cb218663db8a)
1 #ifndef OT_LAYOUT_GSUB_GSUB_HH
2 #define OT_LAYOUT_GSUB_GSUB_HH
3 
4 #include "../../../hb-ot-layout-gsubgpos.hh"
5 #include "Common.hh"
6 #include "SubstLookup.hh"
7 
8 namespace OT {
9 
10 using Layout::GSUB_impl::SubstLookup;
11 
12 namespace Layout {
13 
14 /*
15  * GSUB -- Glyph Substitution
16  * https://docs.microsoft.com/en-us/typography/opentype/spec/gsub
17  */
18 
19 struct GSUB : GSUBGPOS
20 {
21   using Lookup = SubstLookup;
22 
23   static constexpr hb_tag_t tableTag = HB_OT_TAG_GSUB;
24 
get_lookupOT::Layout::GSUB25   const SubstLookup& get_lookup (unsigned int i) const
26   { return static_cast<const SubstLookup &> (GSUBGPOS::get_lookup (i)); }
27 
subsetOT::Layout::GSUB28   bool subset (hb_subset_context_t *c) const
29   {
30     hb_subset_layout_context_t l (c, tableTag);
31     return GSUBGPOS::subset<SubstLookup> (&l);
32   }
33 
sanitizeOT::Layout::GSUB34   bool sanitize (hb_sanitize_context_t *c) const
35   {
36     TRACE_SANITIZE (this);
37     return_trace (GSUBGPOS::sanitize<SubstLookup> (c));
38   }
39 
40   HB_INTERNAL bool is_blocklisted (hb_blob_t *blob,
41                                    hb_face_t *face) const;
42 
closure_lookupsOT::Layout::GSUB43   void closure_lookups (hb_face_t      *face,
44                         const hb_set_t *glyphs,
45                         hb_set_t       *lookup_indexes /* IN/OUT */) const
46   { GSUBGPOS::closure_lookups<SubstLookup> (face, glyphs, lookup_indexes); }
47 
48   typedef GSUBGPOS::accelerator_t<GSUB> accelerator_t;
49 };
50 
51 
52 }
53 
54 struct GSUB_accelerator_t : Layout::GSUB::accelerator_t {
GSUB_accelerator_tOT::GSUB_accelerator_t55   GSUB_accelerator_t (hb_face_t *face) : Layout::GSUB::accelerator_t (face) {}
56 };
57 
58 
59 }
60 
61 #endif  /* OT_LAYOUT_GSUB_GSUB_HH */
62