Line | Count | Source |
1 | | // Copyright (c) 2018 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_GVAR_H_ |
6 | | #define OTS_GVAR_H_ |
7 | | |
8 | | #include "ots.h" |
9 | | |
10 | | namespace ots { |
11 | | |
12 | | // ----------------------------------------------------------------------------- |
13 | | // OpenTypeGVAR Interface |
14 | | // ----------------------------------------------------------------------------- |
15 | | |
16 | | class OpenTypeGVAR : public Table { |
17 | | public: |
18 | | explicit OpenTypeGVAR(Font* font, uint32_t tag) |
19 | 941 | : Table(font, tag, tag), m_ownsData(false) { } |
20 | | |
21 | 941 | virtual ~OpenTypeGVAR() { |
22 | 941 | if (m_ownsData) { |
23 | 218 | delete[] m_data; |
24 | 218 | } |
25 | 941 | } |
26 | | |
27 | | bool Parse(const uint8_t* data, size_t length); |
28 | | bool Serialize(OTSStream* out); |
29 | | |
30 | | #ifdef OTS_SYNTHESIZE_MISSING_GVAR |
31 | | bool InitEmpty(); |
32 | | #endif |
33 | | |
34 | | private: |
35 | | const uint8_t *m_data; |
36 | | size_t m_length; |
37 | | |
38 | | bool m_ownsData; |
39 | | }; |
40 | | |
41 | | } // namespace ots |
42 | | |
43 | | #endif // OTS_GVAR_H_ |