1 // Copyright (c) 2011-2017 The OTS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef OTS_GDEF_H_
6 #define OTS_GDEF_H_
7 
8 #include "ots.h"
9 
10 namespace ots {
11 
12 class OpenTypeGDEF : public Table {
13  public:
OpenTypeGDEF(Font * font,uint32_t tag)14   explicit OpenTypeGDEF(Font *font, uint32_t tag)
15       : Table(font, tag, tag),
16         version_2(false),
17         has_glyph_class_def(false),
18         has_mark_attachment_class_def(false),
19         has_mark_glyph_sets_def(false),
20         num_mark_glyph_sets(0),
21         m_data(NULL),
22         m_length(0),
23         m_num_glyphs(0) {
24   }
25 
26   bool Parse(const uint8_t *data, size_t length);
27   bool Serialize(OTSStream *out);
28 
29   bool version_2;
30   bool has_glyph_class_def;
31   bool has_mark_attachment_class_def;
32   bool has_mark_glyph_sets_def;
33   uint16_t num_mark_glyph_sets;
34 
35  private:
36   bool ParseAttachListTable(const uint8_t *data, size_t length);
37   bool ParseLigCaretListTable(const uint8_t *data, size_t length);
38   bool ParseMarkGlyphSetsDefTable(const uint8_t *data, size_t length);
39 
40   const uint8_t *m_data;
41   size_t m_length;
42   uint16_t m_num_glyphs;
43 };
44 
45 }  // namespace ots
46 
47 #endif
48 
49