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_head_DEFINED | 8 #ifndef SkOTTable_head_DEFINED |
9 #define SkOTTable_head_DEFINED | 9 #define SkOTTable_head_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 SkOTTableHead { | 16 struct SkOTTableHead { |
18 static const SK_OT_CHAR TAG0 = 'h'; | 17 static const SK_OT_CHAR TAG0 = 'h'; |
19 static const SK_OT_CHAR TAG1 = 'e'; | 18 static const SK_OT_CHAR TAG1 = 'e'; |
20 static const SK_OT_CHAR TAG2 = 'a'; | 19 static const SK_OT_CHAR TAG2 = 'a'; |
21 static const SK_OT_CHAR TAG3 = 'd'; | 20 static const SK_OT_CHAR TAG3 = 'd'; |
22 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHead>::value; | 21 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHead>::value; |
23 | 22 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 static const SK_OT_USHORT OutlineMask = SkTEndian_SwapBE16(1 << 3); | 108 static const SK_OT_USHORT OutlineMask = SkTEndian_SwapBE16(1 << 3); |
110 static const SK_OT_USHORT ShadowMask = SkTEndian_SwapBE16(1 << 4); | 109 static const SK_OT_USHORT ShadowMask = SkTEndian_SwapBE16(1 << 4); |
111 static const SK_OT_USHORT CondensedMask = SkTEndian_SwapBE16(1 << 5)
; | 110 static const SK_OT_USHORT CondensedMask = SkTEndian_SwapBE16(1 << 5)
; |
112 static const SK_OT_USHORT ExtendedMask = SkTEndian_SwapBE16(1 << 6); | 111 static const SK_OT_USHORT ExtendedMask = SkTEndian_SwapBE16(1 << 6); |
113 | 112 |
114 SK_OT_USHORT value; | 113 SK_OT_USHORT value; |
115 } raw; | 114 } raw; |
116 } macStyle; | 115 } macStyle; |
117 SK_OT_USHORT lowestRecPPEM; | 116 SK_OT_USHORT lowestRecPPEM; |
118 struct FontDirectionHint { | 117 struct FontDirectionHint { |
119 SK_TYPED_ENUM(Value, SK_OT_SHORT, | 118 enum Value : SK_OT_SHORT { |
120 ((FullyMixedDirectionalGlyphs, SkTEndian_SwapBE16(0))) | 119 FullyMixedDirectionalGlyphs = SkTEndian_SwapBE16(0), |
121 ((OnlyStronglyLTR, SkTEndian_SwapBE16(1))) | 120 OnlyStronglyLTR = SkTEndian_SwapBE16(1), |
122 ((StronglyLTR, SkTEndian_SwapBE16(2))) | 121 StronglyLTR = SkTEndian_SwapBE16(2), |
123 ((OnlyStronglyRTL, static_cast<SK_OT_SHORT>(SkTEndian_SwapBE16((uint
16_t)-1)))) | 122 OnlyStronglyRTL = static_cast<SK_OT_SHORT>(SkTEndian_SwapBE16((uint1
6_t)-1)), |
124 ((StronglyRTL, static_cast<SK_OT_SHORT>(SkTEndian_SwapBE16((uint16_t
)-2)))) | 123 StronglyRTL = static_cast<SK_OT_SHORT>(SkTEndian_SwapBE16((uint16_t)
-2)), |
125 SK_SEQ_END, | 124 } value; |
126 (value)SK_SEQ_END) | |
127 } fontDirectionHint; | 125 } fontDirectionHint; |
128 struct IndexToLocFormat { | 126 struct IndexToLocFormat { |
129 SK_TYPED_ENUM(Value, SK_OT_SHORT, | 127 enum Value : SK_OT_SHORT { |
130 ((ShortOffsets, SkTEndian_SwapBE16(0))) | 128 ShortOffsets = SkTEndian_SwapBE16(0), |
131 ((LongOffsets, SkTEndian_SwapBE16(1))) | 129 LongOffsets = SkTEndian_SwapBE16(1), |
132 SK_SEQ_END, | 130 } value; |
133 (value)SK_SEQ_END) | |
134 } indexToLocFormat; | 131 } indexToLocFormat; |
135 struct GlyphDataFormat { | 132 struct GlyphDataFormat { |
136 SK_TYPED_ENUM(Value, SK_OT_SHORT, | 133 enum Value : SK_OT_SHORT { |
137 ((CurrentFormat, SkTEndian_SwapBE16(0))) | 134 CurrentFormat = SkTEndian_SwapBE16(0), |
138 SK_SEQ_END, | 135 } value; |
139 (value)SK_SEQ_END) | |
140 } glyphDataFormat; | 136 } glyphDataFormat; |
141 }; | 137 }; |
142 | 138 |
143 #pragma pack(pop) | 139 #pragma pack(pop) |
144 | 140 |
145 | 141 |
146 #include <stddef.h> | 142 #include <stddef.h> |
147 static_assert(offsetof(SkOTTableHead, glyphDataFormat) == 52, "SkOTTableHead_gly
phDataFormat_not_at_52"); | 143 static_assert(offsetof(SkOTTableHead, glyphDataFormat) == 52, "SkOTTableHead_gly
phDataFormat_not_at_52"); |
148 static_assert(sizeof(SkOTTableHead) == 54, "sizeof_SkOTTableHead_not_54"); | 144 static_assert(sizeof(SkOTTableHead) == 54, "sizeof_SkOTTableHead_not_54"); |
149 | 145 |
150 #endif | 146 #endif |
OLD | NEW |