Coverage Report

Created: 2026-03-31 07:17

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/mupdf/thirdparty/harfbuzz/src/hb-aat-layout-common.hh
Line
Count
Source
1
/*
2
 * Copyright © 2017  Google, Inc.
3
 *
4
 *  This is part of HarfBuzz, a text shaping library.
5
 *
6
 * Permission is hereby granted, without written agreement and without
7
 * license or royalty fees, to use, copy, modify, and distribute this
8
 * software and its documentation for any purpose, provided that the
9
 * above copyright notice and the following two paragraphs appear in
10
 * all copies of this software.
11
 *
12
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16
 * DAMAGE.
17
 *
18
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
21
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23
 *
24
 * Google Author(s): Behdad Esfahbod
25
 */
26
27
#ifndef HB_AAT_LAYOUT_COMMON_HH
28
#define HB_AAT_LAYOUT_COMMON_HH
29
30
#include "hb-aat-layout.hh"
31
#include "hb-open-type.hh"
32
33
namespace OT {
34
struct GDEF;
35
};
36
37
namespace AAT {
38
39
using namespace OT;
40
41
42
/*
43
 * Lookup Table
44
 */
45
46
template <typename T> struct Lookup;
47
48
template <typename T>
49
struct LookupFormat0
50
{
51
  friend struct Lookup<T>;
52
53
  private:
54
  const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
55
0
  {
56
0
    if (unlikely (glyph_id >= num_glyphs)) return nullptr;
57
0
    return &arrayZ[glyph_id];
58
0
  }
Unexecuted instantiation: AAT::LookupFormat0<OT::IntType<unsigned short, 2u> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::LookupFormat0<OT::HBGlyphID16>::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::LookupFormat0<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::LookupFormat0<OT::IntType<unsigned int, 4u> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::LookupFormat0<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int, unsigned int) const
59
60
  bool sanitize (hb_sanitize_context_t *c) const
61
0
  {
62
0
    TRACE_SANITIZE (this);
63
0
    return_trace (arrayZ.sanitize (c, c->get_num_glyphs ()));
64
0
  }
Unexecuted instantiation: AAT::LookupFormat0<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat0<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat0<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
65
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
66
0
  {
67
0
    TRACE_SANITIZE (this);
68
0
    return_trace (arrayZ.sanitize (c, c->get_num_glyphs (), base));
69
0
  }
Unexecuted instantiation: AAT::LookupFormat0<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat0<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat0<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
70
71
  protected:
72
  HBUINT16  format;   /* Format identifier--format = 0 */
73
  UnsizedArrayOf<T>
74
    arrayZ;   /* Array of lookup values, indexed by glyph index. */
75
  public:
76
  DEFINE_SIZE_UNBOUNDED (2);
77
};
78
79
80
template <typename T>
81
struct LookupSegmentSingle
82
{
83
  static constexpr unsigned TerminationWordCount = 2u;
84
85
  int cmp (hb_codepoint_t g) const
86
0
  { return g < first ? -1 : g <= last ? 0 : +1 ; }
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::IntType<unsigned short, 2u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::HBGlyphID16>::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::IntType<unsigned int, 4u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::cmp(unsigned int) const
87
88
  bool sanitize (hb_sanitize_context_t *c) const
89
0
  {
90
0
    TRACE_SANITIZE (this);
91
0
    return_trace (c->check_struct (this) && value.sanitize (c));
92
0
  }
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
93
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
94
0
  {
95
0
    TRACE_SANITIZE (this);
96
0
    return_trace (c->check_struct (this) && value.sanitize (c, base));
97
0
  }
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSegmentSingle<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
98
99
  HBGlyphID16 last;   /* Last GlyphID in this segment */
100
  HBGlyphID16 first;    /* First GlyphID in this segment */
101
  T   value;    /* The lookup value (only one) */
102
  public:
103
  DEFINE_SIZE_STATIC (4 + T::static_size);
104
};
105
106
template <typename T>
107
struct LookupFormat2
108
{
109
  friend struct Lookup<T>;
110
111
  private:
112
  const T* get_value (hb_codepoint_t glyph_id) const
113
0
  {
114
0
    const LookupSegmentSingle<T> *v = segments.bsearch (glyph_id);
115
0
    return v ? &v->value : nullptr;
116
0
  }
Unexecuted instantiation: AAT::LookupFormat2<OT::IntType<unsigned short, 2u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat2<OT::HBGlyphID16>::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat2<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat2<OT::IntType<unsigned int, 4u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat2<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int) const
117
118
  bool sanitize (hb_sanitize_context_t *c) const
119
0
  {
120
0
    TRACE_SANITIZE (this);
121
0
    return_trace (segments.sanitize (c));
122
0
  }
Unexecuted instantiation: AAT::LookupFormat2<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat2<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat2<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
123
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
124
0
  {
125
0
    TRACE_SANITIZE (this);
126
0
    return_trace (segments.sanitize (c, base));
127
0
  }
Unexecuted instantiation: AAT::LookupFormat2<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat2<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat2<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
128
129
  protected:
130
  HBUINT16  format;   /* Format identifier--format = 2 */
131
  VarSizedBinSearchArrayOf<LookupSegmentSingle<T>>
132
    segments; /* The actual segments. These must already be sorted,
133
         * according to the first word in each one (the last
134
         * glyph in each segment). */
135
  public:
136
  DEFINE_SIZE_ARRAY (8, segments);
137
};
138
139
template <typename T>
140
struct LookupSegmentArray
141
{
142
  static constexpr unsigned TerminationWordCount = 2u;
143
144
  const T* get_value (hb_codepoint_t glyph_id, const void *base) const
145
0
  {
146
0
    return first <= glyph_id && glyph_id <= last ? &(base+valuesZ)[glyph_id - first] : nullptr;
147
0
  }
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned short, 2u> >::get_value(unsigned int, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::HBGlyphID16>::get_value(unsigned int, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned int, 4u> >::get_value(unsigned int, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int, void const*) const
148
149
  int cmp (hb_codepoint_t g) const
150
0
  { return g < first ? -1 : g <= last ? 0 : +1; }
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned short, 2u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::HBGlyphID16>::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned int, 4u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::cmp(unsigned int) const
151
152
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
153
0
  {
154
0
    TRACE_SANITIZE (this);
155
0
    return_trace (c->check_struct (this) &&
156
0
      first <= last &&
157
0
      valuesZ.sanitize (c, base, last - first + 1));
158
0
  }
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSegmentArray<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*, void const*) const
159
  template <typename ...Ts>
160
  bool sanitize (hb_sanitize_context_t *c, const void *base, Ts&&... ds) const
161
0
  {
162
0
    TRACE_SANITIZE (this);
163
0
    return_trace (c->check_struct (this) &&
164
0
      first <= last &&
165
0
      valuesZ.sanitize (c, base, last - first + 1, std::forward<Ts> (ds)...));
166
0
  }
Unexecuted instantiation: bool AAT::LookupSegmentArray<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize<void const*&>(hb_sanitize_context_t*, void const*, void const*&) const
Unexecuted instantiation: bool AAT::LookupSegmentArray<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize<void const*&>(hb_sanitize_context_t*, void const*, void const*&) const
Unexecuted instantiation: bool AAT::LookupSegmentArray<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize<void const*&>(hb_sanitize_context_t*, void const*, void const*&) const
167
168
  HBGlyphID16 last;   /* Last GlyphID in this segment */
169
  HBGlyphID16 first;    /* First GlyphID in this segment */
170
  NNOffset16To<UnsizedArrayOf<T>>
171
    valuesZ;  /* A 16-bit offset from the start of
172
         * the table to the data. */
173
  public:
174
  DEFINE_SIZE_STATIC (6);
175
};
176
177
template <typename T>
178
struct LookupFormat4
179
{
180
  friend struct Lookup<T>;
181
182
  private:
183
  const T* get_value (hb_codepoint_t glyph_id) const
184
0
  {
185
0
    const LookupSegmentArray<T> *v = segments.bsearch (glyph_id);
186
0
    return v ? v->get_value (glyph_id, this) : nullptr;
187
0
  }
Unexecuted instantiation: AAT::LookupFormat4<OT::IntType<unsigned short, 2u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat4<OT::HBGlyphID16>::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat4<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat4<OT::IntType<unsigned int, 4u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat4<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int) const
188
189
  bool sanitize (hb_sanitize_context_t *c) const
190
0
  {
191
0
    TRACE_SANITIZE (this);
192
0
    return_trace (segments.sanitize (c, this));
193
0
  }
Unexecuted instantiation: AAT::LookupFormat4<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat4<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat4<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
194
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
195
0
  {
196
0
    TRACE_SANITIZE (this);
197
0
    return_trace (segments.sanitize (c, this, base));
198
0
  }
Unexecuted instantiation: AAT::LookupFormat4<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat4<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat4<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
199
200
  protected:
201
  HBUINT16  format;   /* Format identifier--format = 4 */
202
  VarSizedBinSearchArrayOf<LookupSegmentArray<T>>
203
    segments; /* The actual segments. These must already be sorted,
204
         * according to the first word in each one (the last
205
         * glyph in each segment). */
206
  public:
207
  DEFINE_SIZE_ARRAY (8, segments);
208
};
209
210
template <typename T>
211
struct LookupSingle
212
{
213
  static constexpr unsigned TerminationWordCount = 1u;
214
215
0
  int cmp (hb_codepoint_t g) const { return glyph.cmp (g); }
Unexecuted instantiation: AAT::LookupSingle<OT::IntType<unsigned short, 2u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSingle<OT::HBGlyphID16>::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSingle<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSingle<OT::IntType<unsigned int, 4u> >::cmp(unsigned int) const
Unexecuted instantiation: AAT::LookupSingle<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::cmp(unsigned int) const
216
217
  bool sanitize (hb_sanitize_context_t *c) const
218
0
  {
219
0
    TRACE_SANITIZE (this);
220
0
    return_trace (c->check_struct (this) && value.sanitize (c));
221
0
  }
Unexecuted instantiation: AAT::LookupSingle<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupSingle<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupSingle<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
222
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
223
0
  {
224
0
    TRACE_SANITIZE (this);
225
0
    return_trace (c->check_struct (this) && value.sanitize (c, base));
226
0
  }
Unexecuted instantiation: AAT::LookupSingle<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSingle<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupSingle<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
227
228
  HBGlyphID16 glyph;    /* Last GlyphID */
229
  T   value;    /* The lookup value (only one) */
230
  public:
231
  DEFINE_SIZE_STATIC (2 + T::static_size);
232
};
233
234
template <typename T>
235
struct LookupFormat6
236
{
237
  friend struct Lookup<T>;
238
239
  private:
240
  const T* get_value (hb_codepoint_t glyph_id) const
241
0
  {
242
0
    const LookupSingle<T> *v = entries.bsearch (glyph_id);
243
0
    return v ? &v->value : nullptr;
244
0
  }
Unexecuted instantiation: AAT::LookupFormat6<OT::IntType<unsigned short, 2u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat6<OT::HBGlyphID16>::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat6<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat6<OT::IntType<unsigned int, 4u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat6<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int) const
245
246
  bool sanitize (hb_sanitize_context_t *c) const
247
0
  {
248
0
    TRACE_SANITIZE (this);
249
0
    return_trace (entries.sanitize (c));
250
0
  }
Unexecuted instantiation: AAT::LookupFormat6<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat6<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat6<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
251
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
252
0
  {
253
0
    TRACE_SANITIZE (this);
254
0
    return_trace (entries.sanitize (c, base));
255
0
  }
Unexecuted instantiation: AAT::LookupFormat6<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat6<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat6<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
256
257
  protected:
258
  HBUINT16  format;   /* Format identifier--format = 6 */
259
  VarSizedBinSearchArrayOf<LookupSingle<T>>
260
    entries;  /* The actual entries, sorted by glyph index. */
261
  public:
262
  DEFINE_SIZE_ARRAY (8, entries);
263
};
264
265
template <typename T>
266
struct LookupFormat8
267
{
268
  friend struct Lookup<T>;
269
270
  private:
271
  const T* get_value (hb_codepoint_t glyph_id) const
272
0
  {
273
0
    return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ?
274
0
     &valueArrayZ[glyph_id - firstGlyph] : nullptr;
275
0
  }
Unexecuted instantiation: AAT::LookupFormat8<OT::IntType<unsigned short, 2u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat8<OT::HBGlyphID16>::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat8<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat8<OT::IntType<unsigned int, 4u> >::get_value(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat8<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int) const
276
277
  bool sanitize (hb_sanitize_context_t *c) const
278
0
  {
279
0
    TRACE_SANITIZE (this);
280
0
    return_trace (c->check_struct (this) && valueArrayZ.sanitize (c, glyphCount));
281
0
  }
Unexecuted instantiation: AAT::LookupFormat8<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat8<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat8<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
282
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
283
0
  {
284
0
    TRACE_SANITIZE (this);
285
0
    return_trace (c->check_struct (this) && valueArrayZ.sanitize (c, glyphCount, base));
286
0
  }
Unexecuted instantiation: AAT::LookupFormat8<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat8<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::LookupFormat8<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
287
288
  protected:
289
  HBUINT16  format;   /* Format identifier--format = 8 */
290
  HBGlyphID16 firstGlyph; /* First glyph index included in the trimmed array. */
291
  HBUINT16  glyphCount; /* Total number of glyphs (equivalent to the last
292
         * glyph minus the value of firstGlyph plus 1). */
293
  UnsizedArrayOf<T>
294
    valueArrayZ;  /* The lookup values (indexed by the glyph index
295
         * minus the value of firstGlyph). */
296
  public:
297
  DEFINE_SIZE_ARRAY (6, valueArrayZ);
298
};
299
300
template <typename T>
301
struct LookupFormat10
302
{
303
  friend struct Lookup<T>;
304
305
  private:
306
  const typename T::type get_value_or_null (hb_codepoint_t glyph_id) const
307
0
  {
308
0
    if (!(firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount))
309
0
      return Null (T);
310
311
0
    const HBUINT8 *p = &valueArrayZ[(glyph_id - firstGlyph) * valueSize];
312
313
0
    unsigned int v = 0;
314
0
    unsigned int count = valueSize;
315
0
    for (unsigned int i = 0; i < count; i++)
316
0
      v = (v << 8) | *p++;
317
318
0
    return v;
319
0
  }
Unexecuted instantiation: AAT::LookupFormat10<OT::IntType<unsigned int, 4u> >::get_value_or_null(unsigned int) const
Unexecuted instantiation: AAT::LookupFormat10<OT::IntType<unsigned short, 2u> >::get_value_or_null(unsigned int) const
320
321
  bool sanitize (hb_sanitize_context_t *c) const
322
0
  {
323
0
    TRACE_SANITIZE (this);
324
0
    return_trace (c->check_struct (this) &&
325
0
      valueSize <= 4 &&
326
0
      valueArrayZ.sanitize (c, glyphCount * valueSize));
327
0
  }
Unexecuted instantiation: AAT::LookupFormat10<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat10<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::LookupFormat10<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
328
329
  protected:
330
  HBUINT16  format;   /* Format identifier--format = 8 */
331
  HBUINT16  valueSize;  /* Byte size of each value. */
332
  HBGlyphID16 firstGlyph; /* First glyph index included in the trimmed array. */
333
  HBUINT16  glyphCount; /* Total number of glyphs (equivalent to the last
334
         * glyph minus the value of firstGlyph plus 1). */
335
  UnsizedArrayOf<HBUINT8>
336
    valueArrayZ;  /* The lookup values (indexed by the glyph index
337
         * minus the value of firstGlyph). */
338
  public:
339
  DEFINE_SIZE_ARRAY (8, valueArrayZ);
340
};
341
342
template <typename T>
343
struct Lookup
344
{
345
  const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
346
0
  {
347
0
    switch (u.format) {
348
0
    case 0: return u.format0.get_value (glyph_id, num_glyphs);
349
0
    case 2: return u.format2.get_value (glyph_id);
350
0
    case 4: return u.format4.get_value (glyph_id);
351
0
    case 6: return u.format6.get_value (glyph_id);
352
0
    case 8: return u.format8.get_value (glyph_id);
353
0
    default:return nullptr;
354
0
    }
355
0
  }
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned short, 2u> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::Lookup<OT::HBGlyphID16>::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::Lookup<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned int, 4u> >::get_value(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::Lookup<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::get_value(unsigned int, unsigned int) const
356
357
  const typename T::type get_value_or_null (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
358
0
  {
359
0
    switch (u.format) {
360
      /* Format 10 cannot return a pointer. */
361
0
      case 10: return u.format10.get_value_or_null (glyph_id);
362
0
      default:
363
0
      const T *v = get_value (glyph_id, num_glyphs);
364
0
      return v ? *v : Null (T);
365
0
    }
366
0
  }
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned int, 4u> >::get_value_or_null(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned short, 2u> >::get_value_or_null(unsigned int, unsigned int) const
367
368
  typename T::type get_class (hb_codepoint_t glyph_id,
369
            unsigned int num_glyphs,
370
            unsigned int outOfRange) const
371
0
  {
372
0
    const T *v = get_value (glyph_id, num_glyphs);
373
0
    return v ? *v : outOfRange;
374
0
  }
375
376
  bool sanitize (hb_sanitize_context_t *c) const
377
0
  {
378
0
    TRACE_SANITIZE (this);
379
0
    if (!u.format.sanitize (c)) return_trace (false);
380
0
    switch (u.format) {
381
0
    case 0: return_trace (u.format0.sanitize (c));
382
0
    case 2: return_trace (u.format2.sanitize (c));
383
0
    case 4: return_trace (u.format4.sanitize (c));
384
0
    case 6: return_trace (u.format6.sanitize (c));
385
0
    case 8: return_trace (u.format8.sanitize (c));
386
0
    case 10: return_trace (u.format10.sanitize (c));
387
0
    default:return_trace (true);
388
0
    }
389
0
  }
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::Lookup<OT::HBGlyphID16>::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::Lookup<OT::IntType<unsigned int, 4u> >::sanitize(hb_sanitize_context_t*) const
390
  bool sanitize (hb_sanitize_context_t *c, const void *base) const
391
0
  {
392
0
    TRACE_SANITIZE (this);
393
0
    if (!u.format.sanitize (c)) return_trace (false);
394
0
    switch (u.format) {
395
0
    case 0: return_trace (u.format0.sanitize (c, base));
396
0
    case 2: return_trace (u.format2.sanitize (c, base));
397
0
    case 4: return_trace (u.format4.sanitize (c, base));
398
0
    case 6: return_trace (u.format6.sanitize (c, base));
399
0
    case 8: return_trace (u.format8.sanitize (c, base));
400
0
    case 10: return_trace (false); /* We don't support format10 here currently. */
401
0
    default:return_trace (true);
402
0
    }
403
0
  }
Unexecuted instantiation: AAT::Lookup<OT::OffsetTo<OT::ArrayOf<AAT::Anchor, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, false> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::Lookup<OT::OffsetTo<OT::ArrayOf<AAT::WidthDeltaPair, OT::IntType<unsigned int, 4u> >, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
Unexecuted instantiation: AAT::Lookup<OT::OffsetTo<AAT::OpticalBounds, OT::IntType<unsigned short, 2u>, true> >::sanitize(hb_sanitize_context_t*, void const*) const
404
405
  protected:
406
  union {
407
  HBUINT16    format;   /* Format identifier */
408
  LookupFormat0<T>  format0;
409
  LookupFormat2<T>  format2;
410
  LookupFormat4<T>  format4;
411
  LookupFormat6<T>  format6;
412
  LookupFormat8<T>  format8;
413
  LookupFormat10<T> format10;
414
  } u;
415
  public:
416
  DEFINE_SIZE_UNION (2, format);
417
};
418
DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1 (AAT, Lookup, 2);
419
420
enum { DELETED_GLYPH = 0xFFFF };
421
422
/*
423
 * (Extended) State Table
424
 */
425
426
template <typename T>
427
struct Entry
428
{
429
  bool sanitize (hb_sanitize_context_t *c, unsigned int count) const
430
  {
431
    TRACE_SANITIZE (this);
432
    /* Note, we don't recurse-sanitize data because we don't access it.
433
     * That said, in our DEFINE_SIZE_STATIC we access T::static_size,
434
     * which ensures that data has a simple sanitize(). To be determined
435
     * if I need to remove that as well.
436
     *
437
     * HOWEVER! Because we are a template, our DEFINE_SIZE_STATIC
438
     * assertion wouldn't be checked, hence the line below. */
439
    static_assert (T::static_size, "");
440
441
    return_trace (c->check_struct (this));
442
  }
443
444
  public:
445
  HBUINT16  newState; /* Byte offset from beginning of state table
446
         * to the new state. Really?!?! Or just state
447
         * number?  The latter in morx for sure. */
448
  HBUINT16  flags;    /* Table specific. */
449
  T   data;   /* Optional offsets to per-glyph tables. */
450
  public:
451
  DEFINE_SIZE_STATIC (4 + T::static_size);
452
};
453
454
template <>
455
struct Entry<void>
456
{
457
  bool sanitize (hb_sanitize_context_t *c, unsigned int count /*XXX Unused?*/) const
458
0
  {
459
0
    TRACE_SANITIZE (this);
460
0
    return_trace (c->check_struct (this));
461
0
  }
462
463
  public:
464
  HBUINT16  newState; /* Byte offset from beginning of state table to the new state. */
465
  HBUINT16  flags;    /* Table specific. */
466
  public:
467
  DEFINE_SIZE_STATIC (4);
468
};
469
470
template <typename Types, typename Extra>
471
struct StateTable
472
{
473
  typedef typename Types::HBUINT HBUINT;
474
  typedef typename Types::HBUSHORT HBUSHORT;
475
  typedef typename Types::ClassTypeNarrow ClassType;
476
477
  enum State
478
  {
479
    STATE_START_OF_TEXT = 0,
480
    STATE_START_OF_LINE = 1,
481
  };
482
  enum Class
483
  {
484
    CLASS_END_OF_TEXT = 0,
485
    CLASS_OUT_OF_BOUNDS = 1,
486
    CLASS_DELETED_GLYPH = 2,
487
    CLASS_END_OF_LINE = 3,
488
  };
489
490
  int new_state (unsigned int newState) const
491
0
  { return Types::extended ? newState : ((int) newState - (int) stateArrayTable) / (int) nClasses; }
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, void>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, void>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::new_state(unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::new_state(unsigned int) const
492
493
  unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
494
0
  {
495
0
    if (unlikely (glyph_id == DELETED_GLYPH)) return CLASS_DELETED_GLYPH;
496
0
    return (this+classTable).get_class (glyph_id, num_glyphs, 1);
497
0
  }
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, void>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, void>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::get_class(unsigned int, unsigned int) const
498
499
  const Entry<Extra> *get_entries () const
500
0
  { return (this+entryTable).arrayZ; }
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::get_entries() const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::get_entries() const
501
502
  const Entry<Extra> &get_entry (int state, unsigned int klass) const
503
0
  {
504
0
    if (unlikely (klass >= nClasses))
505
0
      klass = StateTable::CLASS_OUT_OF_BOUNDS;
506
507
0
    const HBUSHORT *states = (this+stateArrayTable).arrayZ;
508
0
    const Entry<Extra> *entries = (this+entryTable).arrayZ;
509
510
0
    unsigned int entry = states[state * nClasses + klass];
511
0
    DEBUG_MSG (APPLY, nullptr, "e%u", entry);
512
513
0
    return entries[entry];
514
0
  }
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, void>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, void>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::get_entry(int, unsigned int) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::get_entry(int, unsigned int) const
515
516
  bool sanitize (hb_sanitize_context_t *c,
517
     unsigned int *num_entries_out = nullptr) const
518
0
  {
519
0
    TRACE_SANITIZE (this);
520
0
    if (unlikely (!(c->check_struct (this) &&
521
0
        nClasses >= 4 /* Ensure pre-defined classes fit.  */ &&
522
0
        classTable.sanitize (c, this)))) return_trace (false);
523
524
0
    const HBUSHORT *states = (this+stateArrayTable).arrayZ;
525
0
    const Entry<Extra> *entries = (this+entryTable).arrayZ;
526
527
0
    unsigned int num_classes = nClasses;
528
0
    if (unlikely (hb_unsigned_mul_overflows (num_classes, states[0].static_size)))
529
0
      return_trace (false);
530
0
    unsigned int row_stride = num_classes * states[0].static_size;
531
532
    /* Apple 'kern' table has this peculiarity:
533
     *
534
     * "Because the stateTableOffset in the state table header is (strictly
535
     * speaking) redundant, some 'kern' tables use it to record an initial
536
     * state where that should not be StartOfText. To determine if this is
537
     * done, calculate what the stateTableOffset should be. If it's different
538
     * from the actual stateTableOffset, use it as the initial state."
539
     *
540
     * We implement this by calling the initial state zero, but allow *negative*
541
     * states if the start state indeed was not the first state.  Since the code
542
     * is shared, this will also apply to 'mort' table.  The 'kerx' / 'morx'
543
     * tables are not affected since those address states by index, not offset.
544
     */
545
546
0
    int min_state = 0;
547
0
    int max_state = 0;
548
0
    unsigned int num_entries = 0;
549
550
0
    int state_pos = 0;
551
0
    int state_neg = 0;
552
0
    unsigned int entry = 0;
553
0
    while (min_state < state_neg || state_pos <= max_state)
554
0
    {
555
0
      if (min_state < state_neg)
556
0
      {
557
  /* Negative states. */
558
0
  if (unlikely (hb_unsigned_mul_overflows (min_state, num_classes)))
559
0
    return_trace (false);
560
0
  if (unlikely (!c->check_range (&states[min_state * num_classes],
561
0
               -min_state,
562
0
               row_stride)))
563
0
    return_trace (false);
564
0
  if ((c->max_ops -= state_neg - min_state) <= 0)
565
0
    return_trace (false);
566
0
  { /* Sweep new states. */
567
0
    const HBUSHORT *stop = &states[min_state * num_classes];
568
0
    if (unlikely (stop > states))
569
0
      return_trace (false);
570
0
    for (const HBUSHORT *p = states; stop < p; p--)
571
0
      num_entries = hb_max (num_entries, *(p - 1) + 1u);
572
0
    state_neg = min_state;
573
0
  }
574
0
      }
575
576
0
      if (state_pos <= max_state)
577
0
      {
578
  /* Positive states. */
579
0
  if (unlikely (!c->check_range (states,
580
0
               max_state + 1,
581
0
               row_stride)))
582
0
    return_trace (false);
583
0
  if ((c->max_ops -= max_state - state_pos + 1) <= 0)
584
0
    return_trace (false);
585
0
  { /* Sweep new states. */
586
0
    if (unlikely (hb_unsigned_mul_overflows ((max_state + 1), num_classes)))
587
0
      return_trace (false);
588
0
    const HBUSHORT *stop = &states[(max_state + 1) * num_classes];
589
0
    if (unlikely (stop < states))
590
0
      return_trace (false);
591
0
    for (const HBUSHORT *p = &states[state_pos * num_classes]; p < stop; p++)
592
0
      num_entries = hb_max (num_entries, *p + 1u);
593
0
    state_pos = max_state + 1;
594
0
  }
595
0
      }
596
597
0
      if (unlikely (!c->check_array (entries, num_entries)))
598
0
  return_trace (false);
599
0
      if ((c->max_ops -= num_entries - entry) <= 0)
600
0
  return_trace (false);
601
0
      { /* Sweep new entries. */
602
0
  const Entry<Extra> *stop = &entries[num_entries];
603
0
  for (const Entry<Extra> *p = &entries[entry]; p < stop; p++)
604
0
  {
605
0
    int newState = new_state (p->newState);
606
0
    min_state = hb_min (min_state, newState);
607
0
    max_state = hb_max (max_state, newState);
608
0
  }
609
0
  entry = num_entries;
610
0
      }
611
0
    }
612
613
0
    if (num_entries_out)
614
0
      *num_entries_out = num_entries;
615
616
0
    return_trace (true);
617
0
  }
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, void>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, void>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
Unexecuted instantiation: AAT::StateTable<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::sanitize(hb_sanitize_context_t*, unsigned int*) const
618
619
  protected:
620
  HBUINT  nClasses; /* Number of classes, which is the number of indices
621
         * in a single line in the state array. */
622
  NNOffsetTo<ClassType, HBUINT>
623
    classTable; /* Offset to the class table. */
624
  NNOffsetTo<UnsizedArrayOf<HBUSHORT>, HBUINT>
625
    stateArrayTable;/* Offset to the state array. */
626
  NNOffsetTo<UnsizedArrayOf<Entry<Extra>>, HBUINT>
627
    entryTable; /* Offset to the entry array. */
628
629
  public:
630
  DEFINE_SIZE_STATIC (4 * sizeof (HBUINT));
631
};
632
633
template <typename HBUCHAR>
634
struct ClassTable
635
{
636
  unsigned int get_class (hb_codepoint_t glyph_id, unsigned int outOfRange) const
637
0
  {
638
0
    unsigned int i = glyph_id - firstGlyph;
639
0
    return i >= classArray.len ? outOfRange : classArray.arrayZ[i];
640
0
  }
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned char, 1u> >::get_class(unsigned int, unsigned int) const
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned short, 2u> >::get_class(unsigned int, unsigned int) const
641
  unsigned int get_class (hb_codepoint_t glyph_id,
642
        unsigned int num_glyphs HB_UNUSED,
643
        unsigned int outOfRange) const
644
0
  {
645
0
    return get_class (glyph_id, outOfRange);
646
0
  }
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned char, 1u> >::get_class(unsigned int, unsigned int, unsigned int) const
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned short, 2u> >::get_class(unsigned int, unsigned int, unsigned int) const
647
  bool sanitize (hb_sanitize_context_t *c) const
648
0
  {
649
0
    TRACE_SANITIZE (this);
650
0
    return_trace (c->check_struct (this) && classArray.sanitize (c));
651
0
  }
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned char, 1u> >::sanitize(hb_sanitize_context_t*) const
Unexecuted instantiation: AAT::ClassTable<OT::IntType<unsigned short, 2u> >::sanitize(hb_sanitize_context_t*) const
652
  protected:
653
  HBGlyphID16   firstGlyph; /* First glyph index included in the trimmed array. */
654
  Array16Of<HBUCHAR>  classArray; /* The class codes (indexed by glyph index minus
655
           * firstGlyph). */
656
  public:
657
  DEFINE_SIZE_ARRAY (4, classArray);
658
};
659
660
struct ObsoleteTypes
661
{
662
  static constexpr bool extended = false;
663
  typedef HBUINT16 HBUINT;
664
  typedef HBUINT8 HBUSHORT;
665
  typedef ClassTable<HBUINT8> ClassTypeNarrow;
666
  typedef ClassTable<HBUINT16> ClassTypeWide;
667
668
  template <typename T>
669
  static unsigned int offsetToIndex (unsigned int offset,
670
             const void *base,
671
             const T *array)
672
0
  {
673
    /* https://github.com/harfbuzz/harfbuzz/issues/3483 */
674
    /* If offset is less than base, return an offset that would
675
     * result in an address half a 32bit address-space away,
676
     * to make sure sanitize fails even on 32bit builds. */
677
0
    if (unlikely (offset < unsigned ((const char *) array - (const char *) base)))
678
0
      return INT_MAX / T::static_size;
679
680
    /* https://github.com/harfbuzz/harfbuzz/issues/2816 */
681
0
    return (offset - unsigned ((const char *) array - (const char *) base)) / T::static_size;
682
0
  }
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::offsetToIndex<OT::HBGlyphID16>(unsigned int, void const*, OT::HBGlyphID16 const*)
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::offsetToIndex<OT::IntType<unsigned int, 4u> >(unsigned int, void const*, OT::IntType<unsigned int, 4u> const*)
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::offsetToIndex<OT::IntType<unsigned short, 2u> >(unsigned int, void const*, OT::IntType<unsigned short, 2u> const*)
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::offsetToIndex<OT::IntType<short, 2u> >(unsigned int, void const*, OT::IntType<short, 2u> const*)
683
  template <typename T>
684
  static unsigned int byteOffsetToIndex (unsigned int offset,
685
           const void *base,
686
           const T *array)
687
0
  {
688
0
    return offsetToIndex (offset, base, array);
689
0
  }
690
  template <typename T>
691
  static unsigned int wordOffsetToIndex (unsigned int offset,
692
           const void *base,
693
           const T *array)
694
0
  {
695
0
    return offsetToIndex (2 * offset, base, array);
696
0
  }
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::wordOffsetToIndex<OT::HBGlyphID16>(unsigned int, void const*, OT::HBGlyphID16 const*)
Unexecuted instantiation: unsigned int AAT::ObsoleteTypes::wordOffsetToIndex<OT::IntType<unsigned short, 2u> >(unsigned int, void const*, OT::IntType<unsigned short, 2u> const*)
697
};
698
struct ExtendedTypes
699
{
700
  static constexpr bool extended = true;
701
  typedef HBUINT32 HBUINT;
702
  typedef HBUINT16 HBUSHORT;
703
  typedef Lookup<HBUINT16> ClassTypeNarrow;
704
  typedef Lookup<HBUINT16> ClassTypeWide;
705
706
  template <typename T>
707
  static unsigned int offsetToIndex (unsigned int offset,
708
             const void *base HB_UNUSED,
709
             const T *array HB_UNUSED)
710
0
  {
711
0
    return offset;
712
0
  }
Unexecuted instantiation: unsigned int AAT::ExtendedTypes::offsetToIndex<OT::IntType<unsigned int, 4u> >(unsigned int, void const*, OT::IntType<unsigned int, 4u> const*)
Unexecuted instantiation: unsigned int AAT::ExtendedTypes::offsetToIndex<OT::HBGlyphID16>(unsigned int, void const*, OT::HBGlyphID16 const*)
Unexecuted instantiation: unsigned int AAT::ExtendedTypes::offsetToIndex<OT::IntType<short, 2u> >(unsigned int, void const*, OT::IntType<short, 2u> const*)
713
  template <typename T>
714
  static unsigned int byteOffsetToIndex (unsigned int offset,
715
           const void *base HB_UNUSED,
716
           const T *array HB_UNUSED)
717
0
  {
718
0
    return offset / 2;
719
0
  }
720
  template <typename T>
721
  static unsigned int wordOffsetToIndex (unsigned int offset,
722
           const void *base HB_UNUSED,
723
           const T *array HB_UNUSED)
724
0
  {
725
0
    return offset;
726
0
  }
Unexecuted instantiation: unsigned int AAT::ExtendedTypes::wordOffsetToIndex<OT::IntType<unsigned short, 2u> >(unsigned int, void const*, OT::IntType<unsigned short, 2u> const*)
Unexecuted instantiation: unsigned int AAT::ExtendedTypes::wordOffsetToIndex<OT::HBGlyphID16>(unsigned int, void const*, OT::HBGlyphID16 const*)
727
};
728
729
template <typename Types, typename EntryData>
730
struct StateTableDriver
731
{
732
  using StateTableT = StateTable<Types, EntryData>;
733
  using EntryT = Entry<EntryData>;
734
735
  StateTableDriver (const StateTableT &machine_,
736
        hb_buffer_t *buffer_,
737
        hb_face_t *face_) :
738
0
        machine (machine_),
739
0
        buffer (buffer_),
740
0
        num_glyphs (face_->get_num_glyphs ()) {}
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, void>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, void> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ObsoleteTypes, void>::StateTableDriver(AAT::StateTable<AAT::ObsoleteTypes, void> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData> const&, hb_buffer_t*, hb_face_t*)
Unexecuted instantiation: AAT::StateTableDriver<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::StateTableDriver(AAT::StateTable<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData> const&, hb_buffer_t*, hb_face_t*)
741
742
  template <typename context_t>
743
  void drive (context_t *c)
744
0
  {
745
0
    if (!c->in_place)
746
0
      buffer->clear_output ();
747
748
0
    int state = StateTableT::STATE_START_OF_TEXT;
749
0
    for (buffer->idx = 0; buffer->successful;)
750
0
    {
751
0
      unsigned int klass = buffer->idx < buffer->len ?
752
0
         machine.get_class (buffer->info[buffer->idx].codepoint, num_glyphs) :
753
0
         (unsigned) StateTableT::CLASS_END_OF_TEXT;
754
0
      DEBUG_MSG (APPLY, nullptr, "c%u at %u", klass, buffer->idx);
755
0
      const EntryT &entry = machine.get_entry (state, klass);
756
0
      const int next_state = machine.new_state (entry.newState);
757
758
      /* Conditions under which it's guaranteed safe-to-break before current glyph:
759
       *
760
       * 1. There was no action in this transition; and
761
       *
762
       * 2. If we break before current glyph, the results will be the same. That
763
       *    is guaranteed if:
764
       *
765
       *    2a. We were already in start-of-text state; or
766
       *
767
       *    2b. We are epsilon-transitioning to start-of-text state; or
768
       *
769
       *    2c. Starting from start-of-text state seeing current glyph:
770
       *
771
       *        2c'. There won't be any actions; and
772
       *
773
       *        2c". We would end up in the same state that we were going to end up
774
       *             in now, including whether epsilon-transitioning.
775
       *
776
       *    and
777
       *
778
       * 3. If we break before current glyph, there won't be any end-of-text action
779
       *    after previous glyph.
780
       *
781
       * This triples the transitions we need to look up, but is worth returning
782
       * granular unsafe-to-break results. See eg.:
783
       *
784
       *   https://github.com/harfbuzz/harfbuzz/issues/2860
785
       */
786
0
      const EntryT *wouldbe_entry;
787
0
      bool safe_to_break =
788
  /* 1. */
789
0
  !c->is_actionable (this, entry)
790
0
      &&
791
  /* 2. */
792
0
  (
793
    /* 2a. */
794
0
    state == StateTableT::STATE_START_OF_TEXT
795
0
  ||
796
    /* 2b. */
797
0
    (
798
0
      (entry.flags & context_t::DontAdvance) &&
799
0
      next_state == StateTableT::STATE_START_OF_TEXT
800
0
    )
801
0
  ||
802
    /* 2c. */
803
0
    (
804
0
      wouldbe_entry = &machine.get_entry (StateTableT::STATE_START_OF_TEXT, klass)
805
0
    ,
806
      /* 2c'. */
807
0
      !c->is_actionable (this, *wouldbe_entry)
808
0
    &&
809
      /* 2c". */
810
0
      (
811
0
        next_state == machine.new_state (wouldbe_entry->newState)
812
0
      &&
813
0
        (entry.flags & context_t::DontAdvance) == (wouldbe_entry->flags & context_t::DontAdvance)
814
0
      )
815
0
    )
816
0
  )
817
0
      &&
818
  /* 3. */
819
0
  !c->is_actionable (this, machine.get_entry (state, StateTableT::CLASS_END_OF_TEXT))
820
0
      ;
821
822
0
      if (!safe_to_break && buffer->backtrack_len () && buffer->idx < buffer->len)
823
0
  buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1);
824
825
0
      c->transition (this, entry);
826
827
0
      state = next_state;
828
0
      DEBUG_MSG (APPLY, nullptr, "s%d", state);
829
830
0
      if (buffer->idx == buffer->len || unlikely (!buffer->successful))
831
0
  break;
832
833
0
      if (!(entry.flags & context_t::DontAdvance) || buffer->max_ops-- <= 0)
834
0
  (void) buffer->next_glyph ();
835
0
    }
836
837
0
    if (!c->in_place)
838
0
      buffer->sync ();
839
0
  }
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, void>::drive<AAT::RearrangementSubtable<AAT::ExtendedTypes>::driver_context_t>(AAT::RearrangementSubtable<AAT::ExtendedTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, AAT::ContextualSubtable<AAT::ExtendedTypes>::EntryData>::drive<AAT::ContextualSubtable<AAT::ExtendedTypes>::driver_context_t>(AAT::ContextualSubtable<AAT::ExtendedTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, AAT::LigatureEntry<true>::EntryData>::drive<AAT::LigatureSubtable<AAT::ExtendedTypes>::driver_context_t>(AAT::LigatureSubtable<AAT::ExtendedTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, AAT::InsertionSubtable<AAT::ExtendedTypes>::EntryData>::drive<AAT::InsertionSubtable<AAT::ExtendedTypes>::driver_context_t>(AAT::InsertionSubtable<AAT::ExtendedTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, void>::drive<AAT::RearrangementSubtable<AAT::ObsoleteTypes>::driver_context_t>(AAT::RearrangementSubtable<AAT::ObsoleteTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, AAT::ContextualSubtable<AAT::ObsoleteTypes>::EntryData>::drive<AAT::ContextualSubtable<AAT::ObsoleteTypes>::driver_context_t>(AAT::ContextualSubtable<AAT::ObsoleteTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, void>::drive<AAT::LigatureSubtable<AAT::ObsoleteTypes>::driver_context_t>(AAT::LigatureSubtable<AAT::ObsoleteTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, AAT::InsertionSubtable<AAT::ObsoleteTypes>::EntryData>::drive<AAT::InsertionSubtable<AAT::ObsoleteTypes>::driver_context_t>(AAT::InsertionSubtable<AAT::ObsoleteTypes>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, AAT::Format1Entry<true>::EntryData>::drive<AAT::KerxSubTableFormat1<AAT::KerxSubTableHeader>::driver_context_t>(AAT::KerxSubTableFormat1<AAT::KerxSubTableHeader>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ExtendedTypes, AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::EntryData>::drive<AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::driver_context_t>(AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, void>::drive<AAT::KerxSubTableFormat1<OT::KernOTSubTableHeader>::driver_context_t>(AAT::KerxSubTableFormat1<OT::KernOTSubTableHeader>::driver_context_t*)
Unexecuted instantiation: void AAT::StateTableDriver<AAT::ObsoleteTypes, void>::drive<AAT::KerxSubTableFormat1<OT::KernAATSubTableHeader>::driver_context_t>(AAT::KerxSubTableFormat1<OT::KernAATSubTableHeader>::driver_context_t*)
840
841
  public:
842
  const StateTableT &machine;
843
  hb_buffer_t *buffer;
844
  unsigned int num_glyphs;
845
};
846
847
848
struct ankr;
849
850
struct hb_aat_apply_context_t :
851
       hb_dispatch_context_t<hb_aat_apply_context_t, bool, HB_DEBUG_APPLY>
852
{
853
0
  const char *get_name () { return "APPLY"; }
854
  template <typename T>
855
0
  return_t dispatch (const T &obj) { return obj.apply (this); }
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::RearrangementSubtable<AAT::ExtendedTypes> >(AAT::RearrangementSubtable<AAT::ExtendedTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::ContextualSubtable<AAT::ExtendedTypes> >(AAT::ContextualSubtable<AAT::ExtendedTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::LigatureSubtable<AAT::ExtendedTypes> >(AAT::LigatureSubtable<AAT::ExtendedTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::NoncontextualSubtable<AAT::ExtendedTypes> >(AAT::NoncontextualSubtable<AAT::ExtendedTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::InsertionSubtable<AAT::ExtendedTypes> >(AAT::InsertionSubtable<AAT::ExtendedTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::RearrangementSubtable<AAT::ObsoleteTypes> >(AAT::RearrangementSubtable<AAT::ObsoleteTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::ContextualSubtable<AAT::ObsoleteTypes> >(AAT::ContextualSubtable<AAT::ObsoleteTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::LigatureSubtable<AAT::ObsoleteTypes> >(AAT::LigatureSubtable<AAT::ObsoleteTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::NoncontextualSubtable<AAT::ObsoleteTypes> >(AAT::NoncontextualSubtable<AAT::ObsoleteTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::InsertionSubtable<AAT::ObsoleteTypes> >(AAT::InsertionSubtable<AAT::ObsoleteTypes> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat0<AAT::KerxSubTableHeader> >(AAT::KerxSubTableFormat0<AAT::KerxSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat1<AAT::KerxSubTableHeader> >(AAT::KerxSubTableFormat1<AAT::KerxSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat2<AAT::KerxSubTableHeader> >(AAT::KerxSubTableFormat2<AAT::KerxSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader> >(AAT::KerxSubTableFormat4<AAT::KerxSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat6<AAT::KerxSubTableHeader> >(AAT::KerxSubTableFormat6<AAT::KerxSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<OT::KernOT>(OT::KernOT const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat0<OT::KernOTSubTableHeader> >(AAT::KerxSubTableFormat0<OT::KernOTSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat1<OT::KernOTSubTableHeader> >(AAT::KerxSubTableFormat1<OT::KernOTSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat2<OT::KernOTSubTableHeader> >(AAT::KerxSubTableFormat2<OT::KernOTSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<OT::KernSubTableFormat3<OT::KernOTSubTableHeader> >(OT::KernSubTableFormat3<OT::KernOTSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<OT::KernAAT>(OT::KernAAT const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat0<OT::KernAATSubTableHeader> >(AAT::KerxSubTableFormat0<OT::KernAATSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat1<OT::KernAATSubTableHeader> >(AAT::KerxSubTableFormat1<OT::KernAATSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<AAT::KerxSubTableFormat2<OT::KernAATSubTableHeader> >(AAT::KerxSubTableFormat2<OT::KernAATSubTableHeader> const&)
Unexecuted instantiation: bool AAT::fzhb_aat_apply_context_t::dispatch<OT::KernSubTableFormat3<OT::KernAATSubTableHeader> >(OT::KernSubTableFormat3<OT::KernAATSubTableHeader> const&)
856
0
  static return_t default_return_value () { return false; }
857
0
  bool stop_sublookup_iteration (return_t r) const { return r; }
858
859
  const hb_ot_shape_plan_t *plan;
860
  hb_font_t *font;
861
  hb_face_t *face;
862
  hb_buffer_t *buffer;
863
  hb_sanitize_context_t sanitizer;
864
  const ankr *ankr_table;
865
  const OT::GDEF *gdef_table;
866
867
  /* Unused. For debug tracing only. */
868
  unsigned int lookup_index;
869
870
  HB_INTERNAL hb_aat_apply_context_t (const hb_ot_shape_plan_t *plan_,
871
              hb_font_t *font_,
872
              hb_buffer_t *buffer_,
873
              hb_blob_t *blob = const_cast<hb_blob_t *> (&Null (hb_blob_t)));
874
875
  HB_INTERNAL ~hb_aat_apply_context_t ();
876
877
  HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_);
878
879
0
  void set_lookup_index (unsigned int i) { lookup_index = i; }
880
};
881
882
883
} /* namespace AAT */
884
885
886
#endif /* HB_AAT_LAYOUT_COMMON_HH */