Coverage Report

Created: 2025-08-03 06:45

/src/ots/src/vhea.cc
Line
Count
Source
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
193
bool OpenTypeVHEA::Parse(const uint8_t *data, size_t length) {
16
193
  Buffer table(data, length);
17
18
193
  if (!table.ReadU32(&this->version)) {
19
1
    return Error("Failed to read version");
20
1
  }
21
192
  if (this->version != 0x00010000 &&
22
192
      this->version != 0x00011000) {
23
34
    return Error("Unsupported table version: 0x%x", this->version);
24
34
  }
25
26
158
  return OpenTypeMetricsHeader::Parse(data, length);
27
192
}
28
29
}  // namespace ots