2 * Copyright 2012 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkOTTable_hhea_DEFINED
9 #define SkOTTable_hhea_DEFINED
11 #include "src/core/SkEndian.h"
12 #include "src/sfnt/SkOTTableTypes.h"
16 struct SkOTTableHorizontalHeader {
17 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;
24 static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000);
26 SK_OT_FWORD Descender;
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 {
40 enum Value : SK_OT_SHORT {
41 CurrentFormat = SkTEndian_SwapBE16(0),
44 SK_OT_USHORT numberOfHMetrics;
51 static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34");
52 static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36");