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_OS_2_V0_DEFINED | 8 #ifndef SkOTTable_OS_2_V0_DEFINED |
9 #define SkOTTable_OS_2_V0_DEFINED | 9 #define SkOTTable_OS_2_V0_DEFINED |
10 | 10 |
11 #include "SkEndian.h" | 11 #include "SkEndian.h" |
12 #include "SkIBMFamilyClass.h" | 12 #include "SkIBMFamilyClass.h" |
13 #include "SkOTTableTypes.h" | 13 #include "SkOTTableTypes.h" |
14 #include "SkPanose.h" | 14 #include "SkPanose.h" |
15 #include "SkTypedEnum.h" | |
16 | 15 |
17 #pragma pack(push, 1) | 16 #pragma pack(push, 1) |
18 | 17 |
19 struct SkOTTableOS2_V0 { | 18 struct SkOTTableOS2_V0 { |
20 SK_OT_USHORT version; | 19 SK_OT_USHORT version; |
21 //SkOTTableOS2_VA::VERSION and SkOTTableOS2_V0::VERSION are both 0. | 20 //SkOTTableOS2_VA::VERSION and SkOTTableOS2_V0::VERSION are both 0. |
22 //The only way to differentiate these two versions is by the size of the tab
le. | 21 //The only way to differentiate these two versions is by the size of the tab
le. |
23 static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(0); | 22 static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(0); |
24 | 23 |
25 SK_OT_SHORT xAvgCharWidth; | 24 SK_OT_SHORT xAvgCharWidth; |
26 struct WeightClass { | 25 struct WeightClass { |
27 SK_TYPED_ENUM(Value, SK_OT_USHORT, | 26 enum Value : SK_OT_USHORT { |
28 ((Thin, SkTEndian_SwapBE16(100))) | 27 Thin = SkTEndian_SwapBE16(100), |
29 ((ExtraLight, SkTEndian_SwapBE16(200))) | 28 ExtraLight = SkTEndian_SwapBE16(200), |
30 ((Light, SkTEndian_SwapBE16(300))) | 29 Light = SkTEndian_SwapBE16(300), |
31 ((Normal, SkTEndian_SwapBE16(400))) | 30 Normal = SkTEndian_SwapBE16(400), |
32 ((Medium, SkTEndian_SwapBE16(500))) | 31 Medium = SkTEndian_SwapBE16(500), |
33 ((SemiBold, SkTEndian_SwapBE16(600))) | 32 SemiBold = SkTEndian_SwapBE16(600), |
34 ((Bold, SkTEndian_SwapBE16(700))) | 33 Bold = SkTEndian_SwapBE16(700), |
35 ((ExtraBold, SkTEndian_SwapBE16(800))) | 34 ExtraBold = SkTEndian_SwapBE16(800), |
36 ((Black, SkTEndian_SwapBE16(900))) | 35 Black = SkTEndian_SwapBE16(900), |
37 SK_SEQ_END, | 36 }; |
38 SK_SEQ_END) | |
39 SK_OT_USHORT value; | 37 SK_OT_USHORT value; |
40 } usWeightClass; | 38 } usWeightClass; |
41 struct WidthClass { | 39 struct WidthClass { |
42 SK_TYPED_ENUM(Value, SK_OT_USHORT, | 40 enum Value : SK_OT_USHORT { |
43 ((UltraCondensed, SkTEndian_SwapBE16(1))) | 41 UltraCondensed = SkTEndian_SwapBE16(1), |
44 ((ExtraCondensed, SkTEndian_SwapBE16(2))) | 42 ExtraCondensed = SkTEndian_SwapBE16(2), |
45 ((Condensed, SkTEndian_SwapBE16(3))) | 43 Condensed = SkTEndian_SwapBE16(3), |
46 ((SemiCondensed, SkTEndian_SwapBE16(4))) | 44 SemiCondensed = SkTEndian_SwapBE16(4), |
47 ((Medium, SkTEndian_SwapBE16(5))) | 45 Medium = SkTEndian_SwapBE16(5), |
48 ((SemiExpanded, SkTEndian_SwapBE16(6))) | 46 SemiExpanded = SkTEndian_SwapBE16(6), |
49 ((Expanded, SkTEndian_SwapBE16(7))) | 47 Expanded = SkTEndian_SwapBE16(7), |
50 ((ExtraExpanded, SkTEndian_SwapBE16(8))) | 48 ExtraExpanded = SkTEndian_SwapBE16(8), |
51 ((UltraExpanded, SkTEndian_SwapBE16(9))) | 49 UltraExpanded = SkTEndian_SwapBE16(9), |
52 SK_SEQ_END, | 50 } value; |
53 (value)SK_SEQ_END) | |
54 } usWidthClass; | 51 } usWidthClass; |
55 union Type { | 52 union Type { |
56 struct Field { | 53 struct Field { |
57 //8-15 | 54 //8-15 |
58 SK_OT_BYTE_BITFIELD( | 55 SK_OT_BYTE_BITFIELD( |
59 Reserved08, | 56 Reserved08, |
60 Reserved09, | 57 Reserved09, |
61 Reserved10, | 58 Reserved10, |
62 Reserved11, | 59 Reserved11, |
63 Reserved12, | 60 Reserved12, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 SK_OT_USHORT usWinAscent; | 137 SK_OT_USHORT usWinAscent; |
141 SK_OT_USHORT usWinDescent; | 138 SK_OT_USHORT usWinDescent; |
142 }; | 139 }; |
143 | 140 |
144 #pragma pack(pop) | 141 #pragma pack(pop) |
145 | 142 |
146 | 143 |
147 static_assert(sizeof(SkOTTableOS2_V0) == 78, "sizeof_SkOTTableOS2_V0_not_78"); | 144 static_assert(sizeof(SkOTTableOS2_V0) == 78, "sizeof_SkOTTableOS2_V0_not_78"); |
148 | 145 |
149 #endif | 146 #endif |
OLD | NEW |