Coverage Report

Created: 2026-06-14 06:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
921
bool OpenTypeVHEA::Parse(const uint8_t *data, size_t length) {
16
921
  Buffer table(data, length);
17
18
921
  if (!table.ReadU32(&this->version)) {
19
35
    return Error("Failed to read version");
20
35
  }
21
886
  if (this->version != 0x00010000 &&
22
556
      this->version != 0x00011000) {
23
67
    return Error("Unsupported table version: 0x%x", this->version);
24
67
  }
25
26
819
  return OpenTypeMetricsHeader::Parse(data, length);
27
886
}
28
29
}  // namespace ots