SkOTTable_OS_2_V4.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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. #ifndef SkOTTable_OS_2_V4_DEFINED
  8. #define SkOTTable_OS_2_V4_DEFINED
  9. #include "src/core/SkEndian.h"
  10. #include "src/sfnt/SkIBMFamilyClass.h"
  11. #include "src/sfnt/SkOTTableTypes.h"
  12. #include "src/sfnt/SkPanose.h"
  13. #pragma pack(push, 1)
  14. struct SkOTTableOS2_V4 {
  15. SK_OT_USHORT version;
  16. static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(4);
  17. SK_OT_SHORT xAvgCharWidth;
  18. struct WeightClass {
  19. enum Value : SK_OT_USHORT {
  20. Thin = SkTEndian_SwapBE16(100),
  21. ExtraLight = SkTEndian_SwapBE16(200),
  22. Light = SkTEndian_SwapBE16(300),
  23. Normal = SkTEndian_SwapBE16(400),
  24. Medium = SkTEndian_SwapBE16(500),
  25. SemiBold = SkTEndian_SwapBE16(600),
  26. Bold = SkTEndian_SwapBE16(700),
  27. ExtraBold = SkTEndian_SwapBE16(800),
  28. Black = SkTEndian_SwapBE16(900),
  29. };
  30. SK_OT_USHORT value;
  31. } usWeightClass;
  32. struct WidthClass {
  33. enum Value : SK_OT_USHORT {
  34. UltraCondensed = SkTEndian_SwapBE16(1),
  35. ExtraCondensed = SkTEndian_SwapBE16(2),
  36. Condensed = SkTEndian_SwapBE16(3),
  37. SemiCondensed = SkTEndian_SwapBE16(4),
  38. Medium = SkTEndian_SwapBE16(5),
  39. SemiExpanded = SkTEndian_SwapBE16(6),
  40. Expanded = SkTEndian_SwapBE16(7),
  41. ExtraExpanded = SkTEndian_SwapBE16(8),
  42. UltraExpanded = SkTEndian_SwapBE16(9),
  43. } value;
  44. } usWidthClass;
  45. union Type {
  46. struct Field {
  47. //8-15
  48. SK_OT_BYTE_BITFIELD(
  49. NoSubsetting,
  50. Bitmap,
  51. Reserved10,
  52. Reserved11,
  53. Reserved12,
  54. Reserved13,
  55. Reserved14,
  56. Reserved15)
  57. //0-7
  58. SK_OT_BYTE_BITFIELD(
  59. Reserved00,
  60. Restricted,
  61. PreviewPrint,
  62. Editable,
  63. Reserved04,
  64. Reserved05,
  65. Reserved06,
  66. Reserved07)
  67. } field;
  68. struct Raw {
  69. static const SK_OT_USHORT Installable = 0;
  70. static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value;
  71. static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value;
  72. static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value;
  73. static const SK_OT_USHORT NoSubsettingMask = SkOTSetUSHORTBit<8>::value;
  74. static const SK_OT_USHORT BitmapMask = SkOTSetUSHORTBit<9>::value;
  75. SK_OT_USHORT value;
  76. } raw;
  77. } fsType;
  78. SK_OT_SHORT ySubscriptXSize;
  79. SK_OT_SHORT ySubscriptYSize;
  80. SK_OT_SHORT ySubscriptXOffset;
  81. SK_OT_SHORT ySubscriptYOffset;
  82. SK_OT_SHORT ySuperscriptXSize;
  83. SK_OT_SHORT ySuperscriptYSize;
  84. SK_OT_SHORT ySuperscriptXOffset;
  85. SK_OT_SHORT ySuperscriptYOffset;
  86. SK_OT_SHORT yStrikeoutSize;
  87. SK_OT_SHORT yStrikeoutPosition;
  88. SkIBMFamilyClass sFamilyClass;
  89. SkPanose panose;
  90. union UnicodeRange {
  91. struct Field {
  92. //l0 24-31
  93. SK_OT_BYTE_BITFIELD(
  94. Thai,
  95. Lao,
  96. Georgian,
  97. Balinese,
  98. HangulJamo,
  99. LatinExtendedAdditional,
  100. GreekExtended,
  101. GeneralPunctuation)
  102. //l0 16-23
  103. SK_OT_BYTE_BITFIELD(
  104. Bengali,
  105. Gurmukhi,
  106. Gujarati,
  107. Oriya,
  108. Tamil,
  109. Telugu,
  110. Kannada,
  111. Malayalam)
  112. //l0 8-15
  113. SK_OT_BYTE_BITFIELD(
  114. Coptic,
  115. Cyrillic,
  116. Armenian,
  117. Hebrew,
  118. Vai,
  119. Arabic,
  120. NKo,
  121. Devanagari)
  122. //l0 0-7
  123. SK_OT_BYTE_BITFIELD(
  124. BasicLatin,
  125. Latin1Supplement,
  126. LatinExtendedA,
  127. LatinExtendedB,
  128. IPAExtensions,
  129. SpacingModifierLetters,
  130. CombiningDiacriticalMarks,
  131. GreekAndCoptic)
  132. //l1 24-31
  133. SK_OT_BYTE_BITFIELD(
  134. Hangul,
  135. NonPlane0,
  136. Phoenician,
  137. CJKUnifiedIdeographs,
  138. PrivateUseArea,
  139. CJKCompatibilityIdeographs,
  140. AlphabeticPresentationForms,
  141. ArabicPresentationFormsA)
  142. //l1 16-23
  143. SK_OT_BYTE_BITFIELD(
  144. CJKSymbolsAndPunctuation,
  145. Hiragana,
  146. Katakana,
  147. Bopomofo,
  148. HangulCompatibilityJamo,
  149. PhagsPa,
  150. EnclosedCJKLettersAndMonths,
  151. CJKCompatibility)
  152. //l1 8-15
  153. SK_OT_BYTE_BITFIELD(
  154. ControlPictures,
  155. OpticalCharacterRecognition,
  156. EnclosedAlphanumerics,
  157. BoxDrawing,
  158. BlockElements,
  159. GeometricShapes,
  160. MiscellaneousSymbols,
  161. Dingbats)
  162. //l1 0-7
  163. SK_OT_BYTE_BITFIELD(
  164. SuperscriptsAndSubscripts,
  165. CurrencySymbols,
  166. CombiningDiacriticalMarksForSymbols,
  167. LetterlikeSymbols,
  168. NumberForms,
  169. Arrows,
  170. MathematicalOperators,
  171. MiscellaneousTechnical)
  172. //l2 24-31
  173. SK_OT_BYTE_BITFIELD(
  174. MusicalSymbols,
  175. MathematicalAlphanumericSymbols,
  176. PrivateUse,
  177. VariationSelectors,
  178. Tags,
  179. Limbu,
  180. TaiLe,
  181. NewTaiLue)
  182. //l2 16-23
  183. SK_OT_BYTE_BITFIELD(
  184. Khmer,
  185. Mongolian,
  186. Braille,
  187. Yi,
  188. Tagalog_Hanunoo_Buhid_Tagbanwa,
  189. OldItalic,
  190. Gothic,
  191. Deseret)
  192. //l2 8-15
  193. SK_OT_BYTE_BITFIELD(
  194. Thaana,
  195. Sinhala,
  196. Myanmar,
  197. Ethiopic,
  198. Cherokee,
  199. UnifiedCanadianSyllabics,
  200. Ogham,
  201. Runic)
  202. //l2 0-7
  203. SK_OT_BYTE_BITFIELD(
  204. CombiningHalfMarks,
  205. CJKCompatibilityForms,
  206. SmallFormVariants,
  207. ArabicPresentationFormsB,
  208. HalfwidthAndFullwidthForms,
  209. Specials,
  210. Tibetan,
  211. Syriac)
  212. //l3 24-31
  213. SK_OT_BYTE_BITFIELD(
  214. PhaistosDisc,
  215. Carian_Lycian_Lydian,
  216. DominoTiles_MahjongTiles,
  217. Reserved123,
  218. Reserved124,
  219. Reserved125,
  220. Reserved126,
  221. Reserved127)
  222. //l3 16-23
  223. SK_OT_BYTE_BITFIELD(
  224. Sundanese,
  225. Lepcha,
  226. OlChiki,
  227. Saurashtra,
  228. KayahLi,
  229. Rejang,
  230. Cham,
  231. AncientSymbols)
  232. //l3 8-15
  233. SK_OT_BYTE_BITFIELD(
  234. OldPersian,
  235. Shavian,
  236. Osmanya,
  237. CypriotSyllabary,
  238. Kharoshthi,
  239. TaiXuanJingSymbols,
  240. Cuneiform,
  241. CountingRodNumerals)
  242. //l3 0-7
  243. SK_OT_BYTE_BITFIELD(
  244. Buginese,
  245. Glagolitic,
  246. Tifinagh,
  247. YijingHexagramSymbols,
  248. SylotiNagri,
  249. LinearB_AegeanNumbers,
  250. AncientGreekNumbers,
  251. Ugaritic)
  252. } field;
  253. struct Raw {
  254. struct l0 {
  255. static const SK_OT_ULONG BasicLatinMask = SkOTSetULONGBit<0>::value;
  256. static const SK_OT_ULONG Latin1SupplementMask = SkOTSetULONGBit<1>::value;
  257. static const SK_OT_ULONG LatinExtendedAMask = SkOTSetULONGBit<2>::value;
  258. static const SK_OT_ULONG LatinExtendedBMask = SkOTSetULONGBit<3>::value;
  259. static const SK_OT_ULONG IPAExtensionsMask = SkOTSetULONGBit<4>::value;
  260. static const SK_OT_ULONG SpacingModifierLettersMask = SkOTSetULONGBit<5>::value;
  261. static const SK_OT_ULONG CombiningDiacriticalMarksMask = SkOTSetULONGBit<6>::value;
  262. static const SK_OT_ULONG GreekAndCopticMask = SkOTSetULONGBit<7>::value;
  263. static const SK_OT_ULONG CopticMask = SkOTSetULONGBit<8>::value;
  264. static const SK_OT_ULONG CyrillicMask = SkOTSetULONGBit<9>::value;
  265. static const SK_OT_ULONG ArmenianMask = SkOTSetULONGBit<10>::value;
  266. static const SK_OT_ULONG HebrewMask = SkOTSetULONGBit<11>::value;
  267. static const SK_OT_ULONG VaiMask = SkOTSetULONGBit<12>::value;
  268. static const SK_OT_ULONG ArabicMask = SkOTSetULONGBit<13>::value;
  269. static const SK_OT_ULONG NKoMask = SkOTSetULONGBit<14>::value;
  270. static const SK_OT_ULONG DevanagariMask = SkOTSetULONGBit<15>::value;
  271. static const SK_OT_ULONG BengaliMask = SkOTSetULONGBit<16>::value;
  272. static const SK_OT_ULONG GurmukhiMask = SkOTSetULONGBit<17>::value;
  273. static const SK_OT_ULONG GujaratiMask = SkOTSetULONGBit<18>::value;
  274. static const SK_OT_ULONG OriyaMask = SkOTSetULONGBit<19>::value;
  275. static const SK_OT_ULONG TamilMask = SkOTSetULONGBit<20>::value;
  276. static const SK_OT_ULONG TeluguMask = SkOTSetULONGBit<21>::value;
  277. static const SK_OT_ULONG KannadaMask = SkOTSetULONGBit<22>::value;
  278. static const SK_OT_ULONG MalayalamMask = SkOTSetULONGBit<23>::value;
  279. static const SK_OT_ULONG ThaiMask = SkOTSetULONGBit<24>::value;
  280. static const SK_OT_ULONG LaoMask = SkOTSetULONGBit<25>::value;
  281. static const SK_OT_ULONG GeorgianMask = SkOTSetULONGBit<26>::value;
  282. static const SK_OT_ULONG BalineseMask = SkOTSetULONGBit<27>::value;
  283. static const SK_OT_ULONG HangulJamoMask = SkOTSetULONGBit<28>::value;
  284. static const SK_OT_ULONG LatinExtendedAdditionalMask = SkOTSetULONGBit<29>::value;
  285. static const SK_OT_ULONG GreekExtendedMask = SkOTSetULONGBit<30>::value;
  286. static const SK_OT_ULONG GeneralPunctuationMask = SkOTSetULONGBit<31>::value;
  287. };
  288. struct l1 {
  289. static const SK_OT_ULONG SuperscriptsAndSubscriptsMask = SkOTSetULONGBit<32 - 32>::value;
  290. static const SK_OT_ULONG CurrencySymbolsMask = SkOTSetULONGBit<33 - 32>::value;
  291. static const SK_OT_ULONG CombiningDiacriticalMarksForSymbolsMask = SkOTSetULONGBit<34 - 32>::value;
  292. static const SK_OT_ULONG LetterlikeSymbolsMask = SkOTSetULONGBit<35 - 32>::value;
  293. static const SK_OT_ULONG NumberFormsMask = SkOTSetULONGBit<36 - 32>::value;
  294. static const SK_OT_ULONG ArrowsMask = SkOTSetULONGBit<37 - 32>::value;
  295. static const SK_OT_ULONG MathematicalOperatorsMask = SkOTSetULONGBit<38 - 32>::value;
  296. static const SK_OT_ULONG MiscellaneousTechnicalMask = SkOTSetULONGBit<39 - 32>::value;
  297. static const SK_OT_ULONG ControlPicturesMask = SkOTSetULONGBit<40 - 32>::value;
  298. static const SK_OT_ULONG OpticalCharacterRecognitionMask = SkOTSetULONGBit<41 - 32>::value;
  299. static const SK_OT_ULONG EnclosedAlphanumericsMask = SkOTSetULONGBit<42 - 32>::value;
  300. static const SK_OT_ULONG BoxDrawingMask = SkOTSetULONGBit<43 - 32>::value;
  301. static const SK_OT_ULONG BlockElementsMask = SkOTSetULONGBit<44 - 32>::value;
  302. static const SK_OT_ULONG GeometricShapesMask = SkOTSetULONGBit<45 - 32>::value;
  303. static const SK_OT_ULONG MiscellaneousSymbolsMask = SkOTSetULONGBit<46 - 32>::value;
  304. static const SK_OT_ULONG DingbatsMask = SkOTSetULONGBit<47 - 32>::value;
  305. static const SK_OT_ULONG CJKSymbolsAndPunctuationMask = SkOTSetULONGBit<48 - 32>::value;
  306. static const SK_OT_ULONG HiraganaMask = SkOTSetULONGBit<49 - 32>::value;
  307. static const SK_OT_ULONG KatakanaMask = SkOTSetULONGBit<50 - 32>::value;
  308. static const SK_OT_ULONG BopomofoMask = SkOTSetULONGBit<51 - 32>::value;
  309. static const SK_OT_ULONG HangulCompatibilityJamoMask = SkOTSetULONGBit<52 - 32>::value;
  310. static const SK_OT_ULONG PhagsPaMask = SkOTSetULONGBit<53 - 32>::value;
  311. static const SK_OT_ULONG EnclosedCJKLettersAndMonthsMask = SkOTSetULONGBit<54 - 32>::value;
  312. static const SK_OT_ULONG CJKCompatibilityMask = SkOTSetULONGBit<55 - 32>::value;
  313. static const SK_OT_ULONG HangulMask = SkOTSetULONGBit<56 - 32>::value;
  314. static const SK_OT_ULONG NonPlane0Mask = SkOTSetULONGBit<57 - 32>::value;
  315. static const SK_OT_ULONG PhoenicianMask = SkOTSetULONGBit<58 - 32>::value;
  316. static const SK_OT_ULONG CJKUnifiedIdeographsMask = SkOTSetULONGBit<59 - 32>::value;
  317. static const SK_OT_ULONG PrivateUseAreaMask = SkOTSetULONGBit<60 - 32>::value;
  318. static const SK_OT_ULONG CJKCompatibilityIdeographsMask = SkOTSetULONGBit<61 - 32>::value;
  319. static const SK_OT_ULONG AlphabeticPresentationFormsMask = SkOTSetULONGBit<62 - 32>::value;
  320. static const SK_OT_ULONG ArabicPresentationFormsAMask = SkOTSetULONGBit<63 - 32>::value;
  321. };
  322. struct l2 {
  323. static const SK_OT_ULONG CombiningHalfMarksMask = SkOTSetULONGBit<64 - 64>::value;
  324. static const SK_OT_ULONG CJKCompatibilityFormsMask = SkOTSetULONGBit<65 - 64>::value;
  325. static const SK_OT_ULONG SmallFormVariantsMask = SkOTSetULONGBit<66 - 64>::value;
  326. static const SK_OT_ULONG ArabicPresentationFormsBMask = SkOTSetULONGBit<67 - 64>::value;
  327. static const SK_OT_ULONG HalfwidthAndFullwidthFormsMask = SkOTSetULONGBit<68 - 64>::value;
  328. static const SK_OT_ULONG SpecialsMask = SkOTSetULONGBit<69 - 64>::value;
  329. static const SK_OT_ULONG TibetanMask = SkOTSetULONGBit<70 - 64>::value;
  330. static const SK_OT_ULONG SyriacMask = SkOTSetULONGBit<71 - 64>::value;
  331. static const SK_OT_ULONG ThaanaMask = SkOTSetULONGBit<72 - 64>::value;
  332. static const SK_OT_ULONG SinhalaMask = SkOTSetULONGBit<73 - 64>::value;
  333. static const SK_OT_ULONG MyanmarMask = SkOTSetULONGBit<74 - 64>::value;
  334. static const SK_OT_ULONG EthiopicMask = SkOTSetULONGBit<75 - 64>::value;
  335. static const SK_OT_ULONG CherokeeMask = SkOTSetULONGBit<76 - 64>::value;
  336. static const SK_OT_ULONG UnifiedCanadianSyllabicsMask = SkOTSetULONGBit<77 - 64>::value;
  337. static const SK_OT_ULONG OghamMask = SkOTSetULONGBit<78 - 64>::value;
  338. static const SK_OT_ULONG RunicMask = SkOTSetULONGBit<79 - 64>::value;
  339. static const SK_OT_ULONG KhmerMask = SkOTSetULONGBit<80 - 64>::value;
  340. static const SK_OT_ULONG MongolianMask = SkOTSetULONGBit<81 - 64>::value;
  341. static const SK_OT_ULONG BrailleMask = SkOTSetULONGBit<82 - 64>::value;
  342. static const SK_OT_ULONG YiMask = SkOTSetULONGBit<83 - 64>::value;
  343. static const SK_OT_ULONG Tagalog_Hanunoo_Buhid_TagbanwaMask = SkOTSetULONGBit<84 - 64>::value;
  344. static const SK_OT_ULONG OldItalicMask = SkOTSetULONGBit<85 - 64>::value;
  345. static const SK_OT_ULONG GothicMask = SkOTSetULONGBit<86 - 64>::value;
  346. static const SK_OT_ULONG DeseretMask = SkOTSetULONGBit<87 - 64>::value;
  347. static const SK_OT_ULONG MusicalSymbolsMask = SkOTSetULONGBit<88 - 64>::value;
  348. static const SK_OT_ULONG MathematicalAlphanumericSymbolsMask = SkOTSetULONGBit<89 - 64>::value;
  349. static const SK_OT_ULONG PrivateUseMask = SkOTSetULONGBit<90 - 64>::value;
  350. static const SK_OT_ULONG VariationSelectorsMask = SkOTSetULONGBit<91 - 64>::value;
  351. static const SK_OT_ULONG TagsMask = SkOTSetULONGBit<92 - 64>::value;
  352. static const SK_OT_ULONG LimbuMask = SkOTSetULONGBit<93 - 64>::value;
  353. static const SK_OT_ULONG TaiLeMask = SkOTSetULONGBit<94 - 64>::value;
  354. static const SK_OT_ULONG NewTaiLueMask = SkOTSetULONGBit<95 - 64>::value;
  355. };
  356. struct l3 {
  357. static const SK_OT_ULONG BugineseMask = SkOTSetULONGBit<96 - 96>::value;
  358. static const SK_OT_ULONG GlagoliticMask = SkOTSetULONGBit<97 - 96>::value;
  359. static const SK_OT_ULONG TifinaghMask = SkOTSetULONGBit<98 - 96>::value;
  360. static const SK_OT_ULONG YijingHexagramSymbolsMask = SkOTSetULONGBit<99 - 96>::value;
  361. static const SK_OT_ULONG SylotiNagriMask = SkOTSetULONGBit<100 - 96>::value;
  362. static const SK_OT_ULONG LinearB_AegeanNumbersMask = SkOTSetULONGBit<101 - 96>::value;
  363. static const SK_OT_ULONG AncientGreekNumbersMask = SkOTSetULONGBit<102 - 96>::value;
  364. static const SK_OT_ULONG UgariticMask = SkOTSetULONGBit<103 - 96>::value;
  365. static const SK_OT_ULONG OldPersianMask = SkOTSetULONGBit<104 - 96>::value;
  366. static const SK_OT_ULONG ShavianMask = SkOTSetULONGBit<105 - 96>::value;
  367. static const SK_OT_ULONG OsmanyaMask = SkOTSetULONGBit<106 - 96>::value;
  368. static const SK_OT_ULONG CypriotSyllabaryMask = SkOTSetULONGBit<107 - 96>::value;
  369. static const SK_OT_ULONG KharoshthiMask = SkOTSetULONGBit<108 - 96>::value;
  370. static const SK_OT_ULONG TaiXuanJingSymbolsMask = SkOTSetULONGBit<109 - 96>::value;
  371. static const SK_OT_ULONG CuneiformMask = SkOTSetULONGBit<110 - 96>::value;
  372. static const SK_OT_ULONG CountingRodNumeralsMask = SkOTSetULONGBit<111 - 96>::value;
  373. static const SK_OT_ULONG SundaneseMask = SkOTSetULONGBit<112 - 96>::value;
  374. static const SK_OT_ULONG LepchaMask = SkOTSetULONGBit<113 - 96>::value;
  375. static const SK_OT_ULONG OlChikiMask = SkOTSetULONGBit<114 - 96>::value;
  376. static const SK_OT_ULONG SaurashtraMask = SkOTSetULONGBit<115 - 96>::value;
  377. static const SK_OT_ULONG KayahLiMask = SkOTSetULONGBit<116 - 96>::value;
  378. static const SK_OT_ULONG RejangMask = SkOTSetULONGBit<117 - 96>::value;
  379. static const SK_OT_ULONG ChamMask = SkOTSetULONGBit<118 - 96>::value;
  380. static const SK_OT_ULONG AncientSymbolsMask = SkOTSetULONGBit<119 - 96>::value;
  381. static const SK_OT_ULONG PhaistosDiscMask = SkOTSetULONGBit<120 - 96>::value;
  382. static const SK_OT_ULONG Carian_Lycian_LydianMask = SkOTSetULONGBit<121 - 96>::value;
  383. static const SK_OT_ULONG DominoTiles_MahjongTilesMask = SkOTSetULONGBit<122 - 96>::value;
  384. };
  385. SK_OT_ULONG value[4];
  386. } raw;
  387. } ulUnicodeRange;
  388. SK_OT_CHAR achVendID[4];
  389. union Selection {
  390. struct Field {
  391. //8-15
  392. SK_OT_BYTE_BITFIELD(
  393. WWS,
  394. Oblique,
  395. Reserved10,
  396. Reserved11,
  397. Reserved12,
  398. Reserved13,
  399. Reserved14,
  400. Reserved15)
  401. //0-7
  402. SK_OT_BYTE_BITFIELD(
  403. Italic,
  404. Underscore,
  405. Negative,
  406. Outlined,
  407. Strikeout,
  408. Bold,
  409. Regular,
  410. UseTypoMetrics)
  411. } field;
  412. struct Raw {
  413. static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value;
  414. static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value;
  415. static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value;
  416. static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value;
  417. static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value;
  418. static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value;
  419. static const SK_OT_USHORT RegularMask = SkOTSetUSHORTBit<6>::value;
  420. static const SK_OT_USHORT UseTypoMetricsMask = SkOTSetUSHORTBit<7>::value;
  421. static const SK_OT_USHORT WWSMask = SkOTSetUSHORTBit<8>::value;
  422. static const SK_OT_USHORT ObliqueMask = SkOTSetUSHORTBit<9>::value;
  423. SK_OT_USHORT value;
  424. } raw;
  425. } fsSelection;
  426. SK_OT_USHORT usFirstCharIndex;
  427. SK_OT_USHORT usLastCharIndex;
  428. //version0
  429. SK_OT_SHORT sTypoAscender;
  430. SK_OT_SHORT sTypoDescender;
  431. SK_OT_SHORT sTypoLineGap;
  432. SK_OT_USHORT usWinAscent;
  433. SK_OT_USHORT usWinDescent;
  434. //version1
  435. union CodePageRange {
  436. struct Field {
  437. //l0 24-31
  438. SK_OT_BYTE_BITFIELD(
  439. Reserved24,
  440. Reserved25,
  441. Reserved26,
  442. Reserved27,
  443. Reserved28,
  444. MacintoshCharacterSet,
  445. OEMCharacterSet,
  446. SymbolCharacterSet)
  447. //l0 16-23
  448. SK_OT_BYTE_BITFIELD(
  449. Thai_874,
  450. JISJapan_932,
  451. ChineseSimplified_936,
  452. KoreanWansung_949,
  453. ChineseTraditional_950,
  454. KoreanJohab_1361,
  455. Reserved22,
  456. Reserved23)
  457. //l0 8-15
  458. SK_OT_BYTE_BITFIELD(
  459. Vietnamese,
  460. Reserved09,
  461. Reserved10,
  462. Reserved11,
  463. Reserved12,
  464. Reserved13,
  465. Reserved14,
  466. Reserved15)
  467. //l0 0-7
  468. SK_OT_BYTE_BITFIELD(
  469. Latin1_1252,
  470. Latin2EasternEurope_1250,
  471. Cyrillic_1251,
  472. Greek_1253,
  473. Turkish_1254,
  474. Hebrew_1255,
  475. Arabic_1256,
  476. WindowsBaltic_1257)
  477. //l1 24-31
  478. SK_OT_BYTE_BITFIELD(
  479. IBMTurkish_857,
  480. IBMCyrillic_855,
  481. Latin2_852,
  482. MSDOSBaltic_775,
  483. Greek_737,
  484. Arabic_708,
  485. WELatin1_850,
  486. US_437)
  487. //l1 16-23
  488. SK_OT_BYTE_BITFIELD(
  489. IBMGreek_869,
  490. MSDOSRussian_866,
  491. MSDOSNordic_865,
  492. Arabic_864,
  493. MSDOSCanadianFrench_863,
  494. Hebrew_862,
  495. MSDOSIcelandic_861,
  496. MSDOSPortuguese_860)
  497. //l1 8-15
  498. SK_OT_BYTE_BITFIELD(
  499. Reserved40,
  500. Reserved41,
  501. Reserved42,
  502. Reserved43,
  503. Reserved44,
  504. Reserved45,
  505. Reserved46,
  506. Reserved47)
  507. //l1 0-7
  508. SK_OT_BYTE_BITFIELD(
  509. Reserved32,
  510. Reserved33,
  511. Reserved34,
  512. Reserved35,
  513. Reserved36,
  514. Reserved37,
  515. Reserved38,
  516. Reserved39)
  517. } field;
  518. struct Raw {
  519. struct l0 {
  520. static const SK_OT_ULONG Latin1_1252Mask = SkOTSetULONGBit<0>::value;
  521. static const SK_OT_ULONG Latin2EasternEurope_1250Mask = SkOTSetULONGBit<1>::value;
  522. static const SK_OT_ULONG Cyrillic_1251Mask = SkOTSetULONGBit<2>::value;
  523. static const SK_OT_ULONG Greek_1253Mask = SkOTSetULONGBit<3>::value;
  524. static const SK_OT_ULONG Turkish_1254Mask = SkOTSetULONGBit<4>::value;
  525. static const SK_OT_ULONG Hebrew_1255Mask = SkOTSetULONGBit<5>::value;
  526. static const SK_OT_ULONG Arabic_1256Mask = SkOTSetULONGBit<6>::value;
  527. static const SK_OT_ULONG WindowsBaltic_1257Mask = SkOTSetULONGBit<7>::value;
  528. static const SK_OT_ULONG Vietnamese_1258Mask = SkOTSetULONGBit<8>::value;
  529. static const SK_OT_ULONG Thai_874Mask = SkOTSetULONGBit<16>::value;
  530. static const SK_OT_ULONG JISJapan_932Mask = SkOTSetULONGBit<17>::value;
  531. static const SK_OT_ULONG ChineseSimplified_936Mask = SkOTSetULONGBit<18>::value;
  532. static const SK_OT_ULONG KoreanWansung_949Mask = SkOTSetULONGBit<19>::value;
  533. static const SK_OT_ULONG ChineseTraditional_950Mask = SkOTSetULONGBit<20>::value;
  534. static const SK_OT_ULONG KoreanJohab_1361Mask = SkOTSetULONGBit<21>::value;
  535. static const SK_OT_ULONG MacintoshCharacterSetMask = SkOTSetULONGBit<29>::value;
  536. static const SK_OT_ULONG OEMCharacterSetMask = SkOTSetULONGBit<30>::value;
  537. static const SK_OT_ULONG SymbolCharacterSetMask = SkOTSetULONGBit<31>::value;
  538. };
  539. struct l1 {
  540. static const SK_OT_ULONG IBMGreek_869Mask = SkOTSetULONGBit<48 - 32>::value;
  541. static const SK_OT_ULONG MSDOSRussian_866Mask = SkOTSetULONGBit<49 - 32>::value;
  542. static const SK_OT_ULONG MSDOSNordic_865Mask = SkOTSetULONGBit<50 - 32>::value;
  543. static const SK_OT_ULONG Arabic_864Mask = SkOTSetULONGBit<51 - 32>::value;
  544. static const SK_OT_ULONG MSDOSCanadianFrench_863Mask = SkOTSetULONGBit<52 - 32>::value;
  545. static const SK_OT_ULONG Hebrew_862Mask = SkOTSetULONGBit<53 - 32>::value;
  546. static const SK_OT_ULONG MSDOSIcelandic_861Mask = SkOTSetULONGBit<54 - 32>::value;
  547. static const SK_OT_ULONG MSDOSPortuguese_860Mask = SkOTSetULONGBit<55 - 32>::value;
  548. static const SK_OT_ULONG IBMTurkish_857Mask = SkOTSetULONGBit<56 - 32>::value;
  549. static const SK_OT_ULONG IBMCyrillic_855Mask = SkOTSetULONGBit<57 - 32>::value;
  550. static const SK_OT_ULONG Latin2_852Mask = SkOTSetULONGBit<58 - 32>::value;
  551. static const SK_OT_ULONG MSDOSBaltic_775Mask = SkOTSetULONGBit<59 - 32>::value;
  552. static const SK_OT_ULONG Greek_737Mask = SkOTSetULONGBit<60 - 32>::value;
  553. static const SK_OT_ULONG Arabic_708Mask = SkOTSetULONGBit<61 - 32>::value;
  554. static const SK_OT_ULONG WELatin1_850Mask = SkOTSetULONGBit<62 - 32>::value;
  555. static const SK_OT_ULONG US_437Mask = SkOTSetULONGBit<63 - 32>::value;
  556. };
  557. SK_OT_ULONG value[2];
  558. } raw;
  559. } ulCodePageRange;
  560. //version2
  561. SK_OT_SHORT sxHeight;
  562. SK_OT_SHORT sCapHeight;
  563. SK_OT_USHORT usDefaultChar;
  564. SK_OT_USHORT usBreakChar;
  565. SK_OT_USHORT usMaxContext;
  566. };
  567. #pragma pack(pop)
  568. static_assert(sizeof(SkOTTableOS2_V4) == 96, "sizeof_SkOTTableOS2_V4_not_96");
  569. #endif