OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkOTTable_hhea_DEFINED | 8 #ifndef SkOTTable_hhea_DEFINED |
9 #define SkOTTable_hhea_DEFINED | 9 #define SkOTTable_hhea_DEFINED |
10 | 10 |
11 #include "SkEndian.h" | 11 #include "SkEndian.h" |
12 #include "SkOTTableTypes.h" | 12 #include "SkOTTableTypes.h" |
13 #include "SkTypedEnum.h" | |
14 | 13 |
15 #pragma pack(push, 1) | 14 #pragma pack(push, 1) |
16 | 15 |
17 struct SkOTTableHorizontalHeader { | 16 struct SkOTTableHorizontalHeader { |
18 static const SK_OT_CHAR TAG0 = 'h'; | 17 static const SK_OT_CHAR TAG0 = 'h'; |
19 static const SK_OT_CHAR TAG1 = 'h'; | 18 static const SK_OT_CHAR TAG1 = 'h'; |
20 static const SK_OT_CHAR TAG2 = 'e'; | 19 static const SK_OT_CHAR TAG2 = 'e'; |
21 static const SK_OT_CHAR TAG3 = 'a'; | 20 static const SK_OT_CHAR TAG3 = 'a'; |
22 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::valu
e; | 21 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::valu
e; |
23 | 22 |
24 SK_OT_Fixed version; | 23 SK_OT_Fixed version; |
25 static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000); | 24 static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000); |
26 SK_OT_FWORD Ascender; | 25 SK_OT_FWORD Ascender; |
27 SK_OT_FWORD Descender; | 26 SK_OT_FWORD Descender; |
28 SK_OT_FWORD LineGap; | 27 SK_OT_FWORD LineGap; |
29 SK_OT_UFWORD advanceWidthMax; | 28 SK_OT_UFWORD advanceWidthMax; |
30 SK_OT_FWORD minLeftSideBearing; | 29 SK_OT_FWORD minLeftSideBearing; |
31 SK_OT_FWORD minRightSideBearing; | 30 SK_OT_FWORD minRightSideBearing; |
32 SK_OT_FWORD xMaxExtent; | 31 SK_OT_FWORD xMaxExtent; |
33 SK_OT_SHORT caretSlopeRise; | 32 SK_OT_SHORT caretSlopeRise; |
34 SK_OT_SHORT caretSlopeRun; | 33 SK_OT_SHORT caretSlopeRun; |
35 SK_OT_SHORT caretOffset; | 34 SK_OT_SHORT caretOffset; |
36 SK_OT_SHORT Reserved24; | 35 SK_OT_SHORT Reserved24; |
37 SK_OT_SHORT Reserved26; | 36 SK_OT_SHORT Reserved26; |
38 SK_OT_SHORT Reserved28; | 37 SK_OT_SHORT Reserved28; |
39 SK_OT_SHORT Reserved30; | 38 SK_OT_SHORT Reserved30; |
40 struct MetricDataFormat { | 39 struct MetricDataFormat { |
41 SK_TYPED_ENUM(Value, SK_OT_SHORT, | 40 enum Value : SK_OT_SHORT { |
42 ((CurrentFormat, SkTEndian_SwapBE16(0))) | 41 CurrentFormat = SkTEndian_SwapBE16(0), |
43 SK_SEQ_END, | 42 } value; |
44 (value)SK_SEQ_END) | |
45 } metricDataFormat; | 43 } metricDataFormat; |
46 SK_OT_USHORT numberOfHMetrics; | 44 SK_OT_USHORT numberOfHMetrics; |
47 }; | 45 }; |
48 | 46 |
49 #pragma pack(pop) | 47 #pragma pack(pop) |
50 | 48 |
51 | 49 |
52 #include <stddef.h> | 50 #include <stddef.h> |
53 static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOT
TableHorizontalHeader_numberOfHMetrics_not_at_34"); | 51 static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOT
TableHorizontalHeader_numberOfHMetrics_not_at_34"); |
54 static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizont
alHeader_not_36"); | 52 static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizont
alHeader_not_36"); |
55 | 53 |
56 #endif | 54 #endif |
OLD | NEW |