1 /*
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"
13 #include "SkTypedEnum.h"
14 
15 #pragma pack(push, 1)
16 
17 struct SkOTTableHorizontalHeader {
18     static const SK_OT_CHAR TAG0 = 'h';
19     static const SK_OT_CHAR TAG1 = 'h';
20     static const SK_OT_CHAR TAG2 = 'e';
21     static const SK_OT_CHAR TAG3 = 'a';
22     static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::value;
23 
24     SK_OT_Fixed version;
25     static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000);
26     SK_OT_FWORD Ascender;
27     SK_OT_FWORD Descender;
28     SK_OT_FWORD LineGap;
29     SK_OT_UFWORD advanceWidthMax;
30     SK_OT_FWORD minLeftSideBearing;
31     SK_OT_FWORD minRightSideBearing;
32     SK_OT_FWORD xMaxExtent;
33     SK_OT_SHORT caretSlopeRise;
34     SK_OT_SHORT caretSlopeRun;
35     SK_OT_SHORT caretOffset;
36     SK_OT_SHORT Reserved24;
37     SK_OT_SHORT Reserved26;
38     SK_OT_SHORT Reserved28;
39     SK_OT_SHORT Reserved30;
40     struct MetricDataFormat {
41         SK_TYPED_ENUM(Value, SK_OT_SHORT,
42             ((CurrentFormat, SkTEndian_SwapBE16(0)))
43             SK_SEQ_END,
44         (value)SK_SEQ_END)
45     } metricDataFormat;
46     SK_OT_USHORT numberOfHMetrics;
47 };
48 
49 #pragma pack(pop)
50 
51 
52 #include <stddef.h>
53 static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34");
54 static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36");
55 
56 #endif
57