hb-ot-layout-gdef-table.hh 14.5 KB
Newer Older
B
Behdad Esfahbod 已提交
1
/*
B
Behdad Esfahbod 已提交
2
 * Copyright © 2007,2008,2009  Red Hat, Inc.
3
 * Copyright © 2010,2011,2012  Google, Inc.
B
Behdad Esfahbod 已提交
4
 *
B
Behdad Esfahbod 已提交
5
 *  This is part of HarfBuzz, a text shaping library.
B
Behdad Esfahbod 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
26
 * Google Author(s): Behdad Esfahbod
B
Behdad Esfahbod 已提交
27 28
 */

29 30
#ifndef HB_OT_LAYOUT_GDEF_TABLE_HH
#define HB_OT_LAYOUT_GDEF_TABLE_HH
B
Behdad Esfahbod 已提交
31

32
#include "hb-ot-layout-common.hh"
B
Behdad Esfahbod 已提交
33

34
#include "hb-font.hh"
35

B
Behdad Esfahbod 已提交
36

37 38
namespace OT {

39

40 41 42
/*
 * Attachment List Table
 */
B
Behdad Esfahbod 已提交
43

B
Behdad Esfahbod 已提交
44
typedef ArrayOf<HBUINT16> AttachPoint;	/* Array of contour point indices--in
45
					 * increasing numerical order */
B
Behdad Esfahbod 已提交
46

B
Behdad Esfahbod 已提交
47 48
struct AttachList
{
B
Behdad Esfahbod 已提交
49 50 51 52
  inline unsigned int get_attach_points (hb_codepoint_t glyph_id,
					 unsigned int start_offset,
					 unsigned int *point_count /* IN/OUT */,
					 unsigned int *point_array /* OUT */) const
B
Behdad Esfahbod 已提交
53
  {
54
    unsigned int index = (this+coverage).get_coverage (glyph_id);
B
Behdad Esfahbod 已提交
55 56
    if (index == NOT_COVERED)
    {
B
Behdad Esfahbod 已提交
57 58 59
      if (point_count)
	*point_count = 0;
      return 0;
B
Behdad Esfahbod 已提交
60
    }
B
Behdad Esfahbod 已提交
61

B
Behdad Esfahbod 已提交
62 63
    const AttachPoint &points = this+attachPoint[index];

B
Behdad Esfahbod 已提交
64
    if (point_count) {
B
Behdad Esfahbod 已提交
65
      const HBUINT16 *array = points.sub_array (start_offset, point_count);
B
Behdad Esfahbod 已提交
66
      unsigned int count = *point_count;
B
Behdad Esfahbod 已提交
67 68 69
      for (unsigned int i = 0; i < count; i++)
	point_array[i] = array[i];
    }
B
Behdad Esfahbod 已提交
70

B
Behdad Esfahbod 已提交
71
    return points.len;
B
Behdad Esfahbod 已提交
72
  }
B
Behdad Esfahbod 已提交
73

B
Behdad Esfahbod 已提交
74 75
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
76
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
77
    return_trace (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
B
Behdad Esfahbod 已提交
78 79
  }

80
  protected:
81 82
  OffsetTo<Coverage>
		coverage;		/* Offset to Coverage table -- from
B
Behdad Esfahbod 已提交
83
					 * beginning of AttachList table */
B
Behdad Esfahbod 已提交
84 85 86
  OffsetArrayOf<AttachPoint>
		attachPoint;		/* Array of AttachPoint tables
					 * in Coverage Index order */
87
  public:
88
  DEFINE_SIZE_ARRAY (4, attachPoint);
B
Behdad Esfahbod 已提交
89 90 91 92 93 94
};

/*
 * Ligature Caret Table
 */

B
Behdad Esfahbod 已提交
95 96
struct CaretValueFormat1
{
B
Minor  
Behdad Esfahbod 已提交
97 98 99
  friend struct CaretValue;

  private:
100
  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction) const
B
Behdad Esfahbod 已提交
101
  {
B
Minor  
Behdad Esfahbod 已提交
102
    return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate);
B
Behdad Esfahbod 已提交
103
  }
B
Behdad Esfahbod 已提交
104

B
Behdad Esfahbod 已提交
105 106
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
107
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
108
    return_trace (c->check_struct (this));
B
Behdad Esfahbod 已提交
109 110
  }

111
  protected:
B
Behdad Esfahbod 已提交
112
  HBUINT16	caretValueFormat;	/* Format identifier--format = 1 */
B
Minor  
Behdad Esfahbod 已提交
113
  FWORD		coordinate;		/* X or Y value, in design units */
114 115
  public:
  DEFINE_SIZE_STATIC (4);
B
Behdad Esfahbod 已提交
116 117
};

B
Behdad Esfahbod 已提交
118 119
struct CaretValueFormat2
{
B
Minor  
Behdad Esfahbod 已提交
120 121 122
  friend struct CaretValue;

  private:
123
  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const
B
Behdad Esfahbod 已提交
124
  {
B
Behdad Esfahbod 已提交
125
    hb_position_t x, y;
B
Behdad Esfahbod 已提交
126
    if (font->get_glyph_contour_point_for_origin (glyph_id, caretValuePoint, direction, &x, &y))
127
      return HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
B
Behdad Esfahbod 已提交
128 129
    else
      return 0;
B
Behdad Esfahbod 已提交
130
  }
B
Behdad Esfahbod 已提交
131

B
Behdad Esfahbod 已提交
132 133
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
134
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
135
    return_trace (c->check_struct (this));
B
Behdad Esfahbod 已提交
136 137
  }

138
  protected:
B
Behdad Esfahbod 已提交
139 140
  HBUINT16	caretValueFormat;	/* Format identifier--format = 2 */
  HBUINT16	caretValuePoint;	/* Contour point index on glyph */
141 142
  public:
  DEFINE_SIZE_STATIC (4);
B
Behdad Esfahbod 已提交
143 144
};

B
Behdad Esfahbod 已提交
145 146
struct CaretValueFormat3
{
B
Minor  
Behdad Esfahbod 已提交
147 148
  friend struct CaretValue;

149
  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, const VariationStore &var_store) const
B
Behdad Esfahbod 已提交
150
  {
151
    return HB_DIRECTION_IS_HORIZONTAL (direction) ?
152 153
           font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) :
           font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store);
B
Behdad Esfahbod 已提交
154 155
  }

B
Behdad Esfahbod 已提交
156 157
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
158
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
159
    return_trace (c->check_struct (this) && deviceTable.sanitize (c, this));
B
Behdad Esfahbod 已提交
160 161
  }

162
  protected:
B
Behdad Esfahbod 已提交
163
  HBUINT16	caretValueFormat;	/* Format identifier--format = 3 */
B
Minor  
Behdad Esfahbod 已提交
164
  FWORD		coordinate;		/* X or Y value, in design units */
B
Behdad Esfahbod 已提交
165 166
  OffsetTo<Device>
		deviceTable;		/* Offset to Device table for X or Y
B
Behdad Esfahbod 已提交
167 168
					 * value--from beginning of CaretValue
					 * table */
169 170
  public:
  DEFINE_SIZE_STATIC (6);
B
Behdad Esfahbod 已提交
171 172
};

B
Behdad Esfahbod 已提交
173 174
struct CaretValue
{
175 176 177
  inline hb_position_t get_caret_value (hb_font_t *font,
					hb_direction_t direction,
					hb_codepoint_t glyph_id,
178
					const VariationStore &var_store) const
B
Behdad Esfahbod 已提交
179
  {
B
Behdad Esfahbod 已提交
180
    switch (u.format) {
181
    case 1: return u.format1.get_caret_value (font, direction);
182
    case 2: return u.format2.get_caret_value (font, direction, glyph_id);
183
    case 3: return u.format3.get_caret_value (font, direction, var_store);
B
Behdad Esfahbod 已提交
184 185 186 187
    default:return 0;
    }
  }

B
Behdad Esfahbod 已提交
188 189
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
190
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
191
    if (!u.format.sanitize (c)) return_trace (false);
B
Behdad Esfahbod 已提交
192
    switch (u.format) {
B
Behdad Esfahbod 已提交
193 194 195 196
    case 1: return_trace (u.format1.sanitize (c));
    case 2: return_trace (u.format2.sanitize (c));
    case 3: return_trace (u.format3.sanitize (c));
    default:return_trace (true);
B
Behdad Esfahbod 已提交
197 198 199
    }
  }

200
  protected:
B
Behdad Esfahbod 已提交
201
  union {
B
Behdad Esfahbod 已提交
202
  HBUINT16		format;		/* Format identifier */
B
Behdad Esfahbod 已提交
203 204 205
  CaretValueFormat1	format1;
  CaretValueFormat2	format2;
  CaretValueFormat3	format3;
B
Behdad Esfahbod 已提交
206
  } u;
B
Behdad Esfahbod 已提交
207
  public:
B
Behdad Esfahbod 已提交
208
  DEFINE_SIZE_UNION (2, format);
B
Behdad Esfahbod 已提交
209
};
210

B
Behdad Esfahbod 已提交
211 212
struct LigGlyph
{
213
  inline unsigned int get_lig_carets (hb_font_t *font,
214
				      hb_direction_t direction,
B
Behdad Esfahbod 已提交
215
				      hb_codepoint_t glyph_id,
216
				      const VariationStore &var_store,
B
Behdad Esfahbod 已提交
217 218
				      unsigned int start_offset,
				      unsigned int *caret_count /* IN/OUT */,
219
				      hb_position_t *caret_array /* OUT */) const
B
Behdad Esfahbod 已提交
220
  {
B
Behdad Esfahbod 已提交
221
    if (caret_count) {
222
      const OffsetTo<CaretValue> *array = carets.sub_array (start_offset, caret_count);
B
Behdad Esfahbod 已提交
223
      unsigned int count = *caret_count;
B
Behdad Esfahbod 已提交
224
      for (unsigned int i = 0; i < count; i++)
225
	caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id, var_store);
B
Behdad Esfahbod 已提交
226
    }
B
Behdad Esfahbod 已提交
227

B
Behdad Esfahbod 已提交
228
    return carets.len;
B
Behdad Esfahbod 已提交
229
  }
B
Minor  
Behdad Esfahbod 已提交
230

B
Behdad Esfahbod 已提交
231 232
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
233
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
234
    return_trace (carets.sanitize (c, this));
B
Behdad Esfahbod 已提交
235 236
  }

237
  protected:
B
Behdad Esfahbod 已提交
238
  OffsetArrayOf<CaretValue>
239
		carets;			/* Offset array of CaretValue tables
240 241
					 * --from beginning of LigGlyph table
					 * --in increasing coordinate order */
242
  public:
243
  DEFINE_SIZE_ARRAY (2, carets);
244
};
B
Behdad Esfahbod 已提交
245

B
Behdad Esfahbod 已提交
246 247
struct LigCaretList
{
248
  inline unsigned int get_lig_carets (hb_font_t *font,
249
				      hb_direction_t direction,
B
Behdad Esfahbod 已提交
250
				      hb_codepoint_t glyph_id,
251
				      const VariationStore &var_store,
B
Behdad Esfahbod 已提交
252 253
				      unsigned int start_offset,
				      unsigned int *caret_count /* IN/OUT */,
254
				      hb_position_t *caret_array /* OUT */) const
B
Behdad Esfahbod 已提交
255
  {
256
    unsigned int index = (this+coverage).get_coverage (glyph_id);
B
Behdad Esfahbod 已提交
257 258
    if (index == NOT_COVERED)
    {
B
Behdad Esfahbod 已提交
259 260 261
      if (caret_count)
	*caret_count = 0;
      return 0;
B
Behdad Esfahbod 已提交
262 263
    }
    const LigGlyph &lig_glyph = this+ligGlyph[index];
264
    return lig_glyph.get_lig_carets (font, direction, glyph_id, var_store, start_offset, caret_count, caret_array);
B
Behdad Esfahbod 已提交
265
  }
266

B
Behdad Esfahbod 已提交
267 268
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
269
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
270
    return_trace (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
B
Behdad Esfahbod 已提交
271 272
  }

273
  protected:
274 275
  OffsetTo<Coverage>
		coverage;		/* Offset to Coverage table--from
276
					 * beginning of LigCaretList table */
B
Behdad Esfahbod 已提交
277 278 279
  OffsetArrayOf<LigGlyph>
		ligGlyph;		/* Array of LigGlyph tables
					 * in Coverage Index order */
280
  public:
281
  DEFINE_SIZE_ARRAY (4, ligGlyph);
282 283
};

284 285 286 287 288 289

struct MarkGlyphSetsFormat1
{
  inline bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const
  { return (this+coverage[set_index]).get_coverage (glyph_id) != NOT_COVERED; }

B
Behdad Esfahbod 已提交
290 291
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
292
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
293
    return_trace (coverage.sanitize (c, this));
B
Behdad Esfahbod 已提交
294 295
  }

296
  protected:
B
Behdad Esfahbod 已提交
297
  HBUINT16	format;			/* Format identifier--format = 1 */
B
Behdad Esfahbod 已提交
298
  ArrayOf<LOffsetTo<Coverage> >
299 300
		coverage;		/* Array of long offsets to mark set
					 * coverage tables */
301
  public:
302
  DEFINE_SIZE_ARRAY (4, coverage);
303 304 305 306 307 308 309
};

struct MarkGlyphSets
{
  inline bool covers (unsigned int set_index, hb_codepoint_t glyph_id) const
  {
    switch (u.format) {
B
Behdad Esfahbod 已提交
310
    case 1: return u.format1.covers (set_index, glyph_id);
311 312 313 314
    default:return false;
    }
  }

B
Behdad Esfahbod 已提交
315 316
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
317
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
318
    if (!u.format.sanitize (c)) return_trace (false);
B
Behdad Esfahbod 已提交
319
    switch (u.format) {
B
Behdad Esfahbod 已提交
320 321
    case 1: return_trace (u.format1.sanitize (c));
    default:return_trace (true);
B
Behdad Esfahbod 已提交
322 323 324
    }
  }

325
  protected:
326
  union {
B
Behdad Esfahbod 已提交
327
  HBUINT16		format;		/* Format identifier */
B
Behdad Esfahbod 已提交
328
  MarkGlyphSetsFormat1	format1;
329
  } u;
B
Behdad Esfahbod 已提交
330
  public:
B
Behdad Esfahbod 已提交
331
  DEFINE_SIZE_UNION (2, format);
332 333 334
};


335
/*
336 337
 * GDEF -- Glyph Definition
 * https://docs.microsoft.com/en-us/typography/opentype/spec/gdef
338
 */
B
Behdad Esfahbod 已提交
339

340

B
Behdad Esfahbod 已提交
341 342
struct GDEF
{
343
  static const hb_tag_t tableTag	= HB_OT_TAG_GDEF;
344

B
Behdad Esfahbod 已提交
345
  enum GlyphClasses {
B
Behdad Esfahbod 已提交
346 347 348 349
    UnclassifiedGlyph	= 0,
    BaseGlyph		= 1,
    LigatureGlyph	= 2,
    MarkGlyph		= 3,
350
    ComponentGlyph	= 4
B
Behdad Esfahbod 已提交
351
  };
B
Behdad Esfahbod 已提交
352

353
  inline bool has_data (void) const { return version.to_int () != 0; }
B
Behdad Esfahbod 已提交
354
  inline bool has_glyph_classes (void) const { return glyphClassDef != 0; }
355
  inline unsigned int get_glyph_class (hb_codepoint_t glyph) const
B
Behdad Esfahbod 已提交
356
  { return (this+glyphClassDef).get_class (glyph); }
357
  inline void get_glyphs_in_class (unsigned int klass, hb_set_t *glyphs) const
358
  { (this+glyphClassDef).add_class (glyphs, klass); }
B
Behdad Esfahbod 已提交
359

B
Behdad Esfahbod 已提交
360
  inline bool has_mark_attachment_types (void) const { return markAttachClassDef != 0; }
361
  inline unsigned int get_mark_attachment_type (hb_codepoint_t glyph) const
B
Behdad Esfahbod 已提交
362 363
  { return (this+markAttachClassDef).get_class (glyph); }

B
Behdad Esfahbod 已提交
364
  inline bool has_attach_points (void) const { return attachList != 0; }
B
Behdad Esfahbod 已提交
365 366 367 368 369
  inline unsigned int get_attach_points (hb_codepoint_t glyph_id,
					 unsigned int start_offset,
					 unsigned int *point_count /* IN/OUT */,
					 unsigned int *point_array /* OUT */) const
  { return (this+attachList).get_attach_points (glyph_id, start_offset, point_count, point_array); }
B
Behdad Esfahbod 已提交
370

B
Behdad Esfahbod 已提交
371
  inline bool has_lig_carets (void) const { return ligCaretList != 0; }
372
  inline unsigned int get_lig_carets (hb_font_t *font,
373
				      hb_direction_t direction,
B
Behdad Esfahbod 已提交
374 375 376
				      hb_codepoint_t glyph_id,
				      unsigned int start_offset,
				      unsigned int *caret_count /* IN/OUT */,
377
				      hb_position_t *caret_array /* OUT */) const
378 379 380
  { return (this+ligCaretList).get_lig_carets (font,
					       direction, glyph_id, get_var_store(),
					       start_offset, caret_count, caret_array); }
B
Behdad Esfahbod 已提交
381

382
  inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; }
383
  inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const
384
  { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef).covers (set_index, glyph_id); }
385

B
Behdad Esfahbod 已提交
386
  inline bool has_var_store (void) const { return version.to_int () >= 0x00010003u && varStore != 0; }
387 388
  inline const VariationStore &get_var_store (void) const
  { return version.to_int () >= 0x00010003u ? this+varStore : Null(VariationStore); }
B
Behdad Esfahbod 已提交
389

B
Behdad Esfahbod 已提交
390
  /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing
B
Bruce Mitchener 已提交
391
   * glyph class and other bits, and high 8-bit the mark attachment type (if any).
B
Behdad Esfahbod 已提交
392 393 394 395 396
   * Not to be confused with lookup_props which is very similar. */
  inline unsigned int get_glyph_props (hb_codepoint_t glyph) const
  {
    unsigned int klass = get_glyph_class (glyph);

397 398 399
    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH == (unsigned int) LookupFlag::IgnoreBaseGlyphs), "");
    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE == (unsigned int) LookupFlag::IgnoreLigatures), "");
    static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks), "");
400

B
Behdad Esfahbod 已提交
401
    switch (klass) {
402
    default:			return 0;
403 404
    case BaseGlyph:		return HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH;
    case LigatureGlyph:		return HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE;
B
Behdad Esfahbod 已提交
405 406
    case MarkGlyph:
	  klass = get_mark_attachment_type (glyph);
407
	  return HB_OT_LAYOUT_GLYPH_PROPS_MARK | (klass << 8);
B
Behdad Esfahbod 已提交
408 409 410
    }
  }

411 412
  struct accelerator_t
  {
B
Behdad Esfahbod 已提交
413
    HB_INTERNAL inline void init (hb_face_t *face);
414 415 416 417 418 419 420

    inline void fini (void)
    {
      hb_blob_destroy (this->blob);
    }

    hb_blob_t *blob;
B
Behdad Esfahbod 已提交
421
    hb_nonnull_ptr_t<const GDEF> table;
422
  };
B
Behdad Esfahbod 已提交
423

424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
  inline unsigned int get_size (void) const
  {
    return min_size +
	   (version.to_int () >= 0x00010002u ? markGlyphSetsDef.static_size : 0) +
	   (version.to_int () >= 0x00010003u ? varStore.static_size : 0);
  }

  inline bool sanitize (hb_sanitize_context_t *c) const
  {
    TRACE_SANITIZE (this);
    return_trace (version.sanitize (c) &&
		  likely (version.major == 1) &&
		  glyphClassDef.sanitize (c, this) &&
		  attachList.sanitize (c, this) &&
		  ligCaretList.sanitize (c, this) &&
		  markAttachClassDef.sanitize (c, this) &&
		  (version.to_int () < 0x00010002u || markGlyphSetsDef.sanitize (c, this)) &&
		  (version.to_int () < 0x00010003u || varStore.sanitize (c, this)));
  }

444
  protected:
B
Behdad Esfahbod 已提交
445
  FixedVersion<>version;		/* Version of the GDEF table--currently
B
Behdad Esfahbod 已提交
446
					 * 0x00010003u */
B
Behdad Esfahbod 已提交
447 448
  OffsetTo<ClassDef>
		glyphClassDef;		/* Offset to class definition table
B
Behdad Esfahbod 已提交
449
					 * for glyph type--from beginning of
450
					 * GDEF header (may be Null) */
B
Behdad Esfahbod 已提交
451 452
  OffsetTo<AttachList>
		attachList;		/* Offset to list of glyphs with
B
Behdad Esfahbod 已提交
453
					 * attachment points--from beginning
454
					 * of GDEF header (may be Null) */
B
Behdad Esfahbod 已提交
455 456
  OffsetTo<LigCaretList>
		ligCaretList;		/* Offset to list of positioning points
B
Behdad Esfahbod 已提交
457
					 * for ligature carets--from beginning
458
					 * of GDEF header (may be Null) */
B
Behdad Esfahbod 已提交
459 460
  OffsetTo<ClassDef>
		markAttachClassDef;	/* Offset to class definition table for
B
Behdad Esfahbod 已提交
461
					 * mark attachment type--from beginning
462
					 * of GDEF header (may be Null) */
463
  OffsetTo<MarkGlyphSets>
464
		markGlyphSetsDef;	/* Offset to the table of mark set
465 466
					 * definitions--from beginning of GDEF
					 * header (may be NULL).  Introduced
B
Behdad Esfahbod 已提交
467
					 * in version 0x00010002. */
B
Behdad Esfahbod 已提交
468
  LOffsetTo<VariationStore>
B
Behdad Esfahbod 已提交
469 470 471 472
		varStore;		/* Offset to the table of Item Variation
					 * Store--from beginning of GDEF
					 * header (may be NULL).  Introduced
					 * in version 0x00010003. */
B
Behdad Esfahbod 已提交
473
  public:
474
  DEFINE_SIZE_MIN (12);
B
Behdad Esfahbod 已提交
475 476
};

477
struct GDEF_accelerator_t : GDEF::accelerator_t {};
478

B
Behdad Esfahbod 已提交
479
} /* namespace OT */
480

B
Behdad Esfahbod 已提交
481

482
#endif /* HB_OT_LAYOUT_GDEF_TABLE_HH */