Line | Count | Source |
1 | | // Copyright (c) 2009-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 | | #include "hhea.h" |
6 | | |
7 | | #include "head.h" |
8 | | #include "maxp.h" |
9 | | |
10 | | // hhea - Horizontal Header |
11 | | // http://www.microsoft.com/typography/otspec/hhea.htm |
12 | | |
13 | | namespace ots { |
14 | | |
15 | 22.1k | bool OpenTypeHHEA::Parse(const uint8_t *data, size_t length) { |
16 | 22.1k | Buffer table(data, length); |
17 | | |
18 | 22.1k | if (!table.ReadU32(&this->version)) { |
19 | 11 | return Error("Failed to read table version"); |
20 | 11 | } |
21 | 22.1k | if (this->version >> 16 != 1) { |
22 | 81 | return Error("Unsupported majorVersion: %d", this->version >> 16); |
23 | 81 | } |
24 | | |
25 | 22.0k | return OpenTypeMetricsHeader::Parse(data, length); |
26 | 22.1k | } |
27 | | |
28 | | } // namespace ots |