hb-ot-layout-gdef-table.hh 14.4 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;
126 127
    font->get_glyph_contour_point_for_origin (glyph_id, caretValuePoint, direction, &x, &y);
    return HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
B
Behdad Esfahbod 已提交
128
  }
B
Behdad Esfahbod 已提交
129

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

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

B
Behdad Esfahbod 已提交
143 144
struct CaretValueFormat3
{
B
Minor  
Behdad Esfahbod 已提交
145 146
  friend struct CaretValue;

147
  inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, const VariationStore &var_store) const
B
Behdad Esfahbod 已提交
148
  {
149
    return HB_DIRECTION_IS_HORIZONTAL (direction) ?
150 151
           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 已提交
152 153
  }

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

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

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

B
Behdad Esfahbod 已提交
186 187
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
188
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
189
    if (!u.format.sanitize (c)) return_trace (false);
B
Behdad Esfahbod 已提交
190
    switch (u.format) {
B
Behdad Esfahbod 已提交
191 192 193 194
    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 已提交
195 196 197
    }
  }

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

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

B
Behdad Esfahbod 已提交
226
    return carets.len;
B
Behdad Esfahbod 已提交
227
  }
B
Minor  
Behdad Esfahbod 已提交
228

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

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

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

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

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

282 283 284 285 286 287

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 已提交
288 289
  inline bool sanitize (hb_sanitize_context_t *c) const
  {
B
Behdad Esfahbod 已提交
290
    TRACE_SANITIZE (this);
B
Behdad Esfahbod 已提交
291
    return_trace (coverage.sanitize (c, this));
B
Behdad Esfahbod 已提交
292 293
  }

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

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

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

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


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

338

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

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

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

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

B
Behdad Esfahbod 已提交
362
  inline bool has_attach_points (void) const { return attachList != 0; }
B
Behdad Esfahbod 已提交
363 364 365 366 367
  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 已提交
368

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

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

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

B
Behdad Esfahbod 已提交
388
  /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing
B
Bruce Mitchener 已提交
389
   * glyph class and other bits, and high 8-bit the mark attachment type (if any).
B
Behdad Esfahbod 已提交
390 391 392 393 394
   * 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);

395 396 397
    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), "");
398

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

409 410
  struct accelerator_t
  {
B
Behdad Esfahbod 已提交
411
    HB_INTERNAL void init (hb_face_t *face);
412 413 414

    inline void fini (void)
    {
B
Behdad Esfahbod 已提交
415
      this->table.destroy ();
416 417
    }

B
Behdad Esfahbod 已提交
418
    hb_blob_ptr_t<GDEF> table;
419
  };
B
Behdad Esfahbod 已提交
420

421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
  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)));
  }

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

474
struct GDEF_accelerator_t : GDEF::accelerator_t {};
475

B
Behdad Esfahbod 已提交
476
} /* namespace OT */
477

B
Behdad Esfahbod 已提交
478

479
#endif /* HB_OT_LAYOUT_GDEF_TABLE_HH */