QtBase  v6.3.1
hb-ot-layout-gsub-table.hh
Go to the documentation of this file.
1 /*
2  * Copyright © 2007,2008,2009,2010 Red Hat, Inc.
3  * Copyright © 2010,2012,2013 Google, Inc.
4  *
5  * This is part of HarfBuzz, a text shaping library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  *
25  * Red Hat Author(s): Behdad Esfahbod
26  * Google Author(s): Behdad Esfahbod
27  */
28 
29 #ifndef HB_OT_LAYOUT_GSUB_TABLE_HH
30 #define HB_OT_LAYOUT_GSUB_TABLE_HH
31 
32 #include "OT/Layout/GSUB/GSUB.hh"
33 
34 namespace OT {
35 
36 using Layout::GSUB::SubstLookup;
37 using Layout::GSUB::ExtensionSubst;
38 
39 // TODO(garretrieger): Move into the new layout directory.
40 /* Out-of-class implementation for methods recursing */
41 
42 #ifndef HB_NO_OT_LAYOUT
43 /*static*/ inline bool ExtensionSubst::is_reverse () const
44 {
46 }
47 template <typename context_t>
48 /*static*/ typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
49 {
50  const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index);
51  return l.dispatch (c);
52 }
53 
54 /*static*/ typename hb_closure_context_t::return_t SubstLookup::closure_glyphs_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index)
55 {
56  const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index);
57  if (l.may_have_non_1to1 ())
58  hb_set_add_range (covered_seq_indices, seq_index, end_index);
59  return l.dispatch (c);
60 }
61 
63 {
64  const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (this_index);
65  return l.closure_lookups (c, this_index);
66 }
67 
68 /*static*/ bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index)
69 {
70  const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index);
71  unsigned int saved_lookup_props = c->lookup_props;
72  unsigned int saved_lookup_index = c->lookup_index;
73  c->set_lookup_index (lookup_index);
74  c->set_lookup_props (l.get_props ());
75  bool ret = l.dispatch (c);
76  c->set_lookup_index (saved_lookup_index);
77  c->set_lookup_props (saved_lookup_props);
78  return ret;
79 }
80 #endif
81 
82 
83 } /* namespace OT */
84 
85 
86 #endif /* HB_OT_LAYOUT_GSUB_TABLE_HH */
void hb_set_add_range(hb_set_t *set, hb_codepoint_t first, hb_codepoint_t last)
Definition: hb-set.cc:294
const GLubyte * c
Definition: qopenglext.h:12701
static hb_closure_context_t::return_t closure_glyphs_recurse_func(hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index)
static context_t::return_t dispatch_recurse_func(context_t *c, unsigned int lookup_index)
static bool lookup_type_is_reverse(unsigned int lookup_type)
Definition: SubstLookup.hh:21
static HB_INTERNAL hb_closure_lookups_context_t::return_t dispatch_closure_lookups_recurse_func(hb_closure_lookups_context_t *c, unsigned lookup_index)
static bool apply_recurse_func(hb_ot_apply_context_t *c, unsigned int lookup_index)