tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

hhea.cc (701B)


      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 bool OpenTypeHHEA::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 table version");
     20  }
     21  if (this->version >> 16 != 1) {
     22    return Error("Unsupported majorVersion: %d", this->version >> 16);
     23  }
     24 
     25  return OpenTypeMetricsHeader::Parse(data, length);
     26 }
     27 
     28 }  // namespace ots