vhea.cc (736B)
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 #include "vhea.h" 6 7 #include "head.h" 8 #include "maxp.h" 9 10 // vhea - Vertical Header Table 11 // http://www.microsoft.com/typography/otspec/vhea.htm 12 13 namespace ots { 14 15 bool OpenTypeVHEA::Parse(const uint8_t *data, size_t length) { 16 Buffer table(data, length); 17 18 if (!table.ReadU32(&this->version)) { 19 return Error("Failed to read version"); 20 } 21 if (this->version != 0x00010000 && 22 this->version != 0x00011000) { 23 return Error("Unsupported table version: 0x%x", this->version); 24 } 25 26 return OpenTypeMetricsHeader::Parse(data, length); 27 } 28 29 } // namespace ots