blob: 76b15e276d02e4aa74b046bde5f2e8298314bcf6 [file] [log] [blame]
bungeman@google.comf8d1aee2012-02-02 19:15:21 +00001/*
2 * Copyright 2012 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkOTTable_hhea_DEFINED
9#define SkOTTable_hhea_DEFINED
10
11#include "SkEndian.h"
12#include "SkOTTableTypes.h"
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000013
14#pragma pack(push, 1)
15
16struct SkOTTableHorizontalHeader {
bungeman@google.comec95a4a2012-06-25 14:26:48 +000017 static const SK_OT_CHAR TAG0 = 'h';
18 static const SK_OT_CHAR TAG1 = 'h';
19 static const SK_OT_CHAR TAG2 = 'e';
20 static const SK_OT_CHAR TAG3 = 'a';
21 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::value;
22
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000023 SK_OT_Fixed version;
24 static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000);
25 SK_OT_FWORD Ascender;
26 SK_OT_FWORD Descender;
27 SK_OT_FWORD LineGap;
28 SK_OT_UFWORD advanceWidthMax;
29 SK_OT_FWORD minLeftSideBearing;
30 SK_OT_FWORD minRightSideBearing;
31 SK_OT_FWORD xMaxExtent;
32 SK_OT_SHORT caretSlopeRise;
33 SK_OT_SHORT caretSlopeRun;
34 SK_OT_SHORT caretOffset;
35 SK_OT_SHORT Reserved24;
36 SK_OT_SHORT Reserved26;
37 SK_OT_SHORT Reserved28;
38 SK_OT_SHORT Reserved30;
39 struct MetricDataFormat {
bungeman8fd23a82016-08-16 12:27:49 -070040 enum Value : SK_OT_SHORT {
41 CurrentFormat = SkTEndian_SwapBE16(0),
42 } value;
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000043 } metricDataFormat;
44 SK_OT_USHORT numberOfHMetrics;
45};
46
47#pragma pack(pop)
48
49
50#include <stddef.h>
bungeman99fe8222015-08-20 07:57:51 -070051static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34");
52static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36");
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000053
54#endif