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_AVAR_H_ |
6 | | #define OTS_AVAR_H_ |
7 | | |
8 | | #include "ots.h" |
9 | | |
10 | | #include <vector> |
11 | | |
12 | | namespace ots { |
13 | | |
14 | | // ----------------------------------------------------------------------------- |
15 | | // OpenTypeAVAR Interface |
16 | | // ----------------------------------------------------------------------------- |
17 | | |
18 | | class OpenTypeAVAR : public Table { |
19 | | public: |
20 | | explicit OpenTypeAVAR(Font* font, uint32_t tag) |
21 | 862 | : Table(font, tag, tag) { } |
22 | | |
23 | | bool Parse(const uint8_t* data, size_t length); |
24 | | bool Serialize(OTSStream* out); |
25 | | |
26 | | private: |
27 | | uint16_t majorVersion; |
28 | | uint16_t minorVersion; |
29 | | uint16_t reserved; |
30 | | uint16_t axisCount; |
31 | | |
32 | | struct AxisValueMap { |
33 | | int16_t fromCoordinate; |
34 | | int16_t toCoordinate; |
35 | | }; |
36 | | |
37 | | std::vector<std::vector<AxisValueMap>> axisSegmentMaps; |
38 | | |
39 | | // Only used for versions >= 2 |
40 | | const uint8_t *m_data; |
41 | | size_t m_length; |
42 | | }; |
43 | | |
44 | | } // namespace ots |
45 | | |
46 | | #endif // OTS_AVAR_H_ |