2 * Copyright 2012 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkOTTable_OS_2_V2_DEFINED
9 #define SkOTTable_OS_2_V2_DEFINED
11 #include "src/core/SkEndian.h"
12 #include "src/sfnt/SkIBMFamilyClass.h"
13 #include "src/sfnt/SkOTTableTypes.h"
14 #include "src/sfnt/SkPanose.h"
18 struct SkOTTableOS2_V2 {
20 static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(2);
22 SK_OT_SHORT xAvgCharWidth;
24 enum Value : SK_OT_USHORT {
25 Thin = SkTEndian_SwapBE16(100),
26 ExtraLight = SkTEndian_SwapBE16(200),
27 Light = SkTEndian_SwapBE16(300),
28 Normal = SkTEndian_SwapBE16(400),
29 Medium = SkTEndian_SwapBE16(500),
30 SemiBold = SkTEndian_SwapBE16(600),
31 Bold = SkTEndian_SwapBE16(700),
32 ExtraBold = SkTEndian_SwapBE16(800),
33 Black = SkTEndian_SwapBE16(900),
38 enum Value : SK_OT_USHORT {
39 UltraCondensed = SkTEndian_SwapBE16(1),
40 ExtraCondensed = SkTEndian_SwapBE16(2),
41 Condensed = SkTEndian_SwapBE16(3),
42 SemiCondensed = SkTEndian_SwapBE16(4),
43 Medium = SkTEndian_SwapBE16(5),
44 SemiExpanded = SkTEndian_SwapBE16(6),
45 Expanded = SkTEndian_SwapBE16(7),
46 ExtraExpanded = SkTEndian_SwapBE16(8),
47 UltraExpanded = SkTEndian_SwapBE16(9),
74 static const SK_OT_USHORT Installable = 0;
75 static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value;
76 static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value;
77 static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value;
78 static const SK_OT_USHORT NoSubsettingMask = SkOTSetUSHORTBit<8>::value;
79 static const SK_OT_USHORT BitmapMask = SkOTSetUSHORTBit<9>::value;
83 SK_OT_SHORT ySubscriptXSize;
84 SK_OT_SHORT ySubscriptYSize;
85 SK_OT_SHORT ySubscriptXOffset;
86 SK_OT_SHORT ySubscriptYOffset;
87 SK_OT_SHORT ySuperscriptXSize;
88 SK_OT_SHORT ySuperscriptYSize;
89 SK_OT_SHORT ySuperscriptXOffset;
90 SK_OT_SHORT ySuperscriptYOffset;
91 SK_OT_SHORT yStrikeoutSize;
92 SK_OT_SHORT yStrikeoutPosition;
93 SkIBMFamilyClass sFamilyClass;
104 LatinExtendedAdditional,
134 SpacingModifierLetters,
135 CombiningDiacriticalMarks,
143 CJKUnifiedIdeographs,
145 CJKCompatibilityIdeographs,
146 AlphabeticPresentationForms,
147 ArabicPresentationFormsA)
150 CJKSymbolsAndPunctuation,
154 HangulCompatibilityJamo,
156 EnclosedCJKLettersAndMonths,
161 OpticalCharacterRecognition,
162 EnclosedAlphanumerics,
166 MiscellaneousSymbols,
170 SuperscriptsAndSubscripts,
172 CombiningDiacriticalMarksForSymbols,
176 MathematicalOperators,
177 MiscellaneousTechnical)
206 UnifiedCanadianSyllabics,
212 CJKCompatibilityForms,
214 ArabicPresentationFormsB,
215 HalfwidthAndFullwidthForms,
263 static const SK_OT_ULONG BasicLatinMask = SkOTSetULONGBit<0>::value;
264 static const SK_OT_ULONG Latin1SupplementMask = SkOTSetULONGBit<1>::value;
265 static const SK_OT_ULONG LatinExtendedAMask = SkOTSetULONGBit<2>::value;
266 static const SK_OT_ULONG LatinExtendedBMask = SkOTSetULONGBit<3>::value;
267 static const SK_OT_ULONG IPAExtensionsMask = SkOTSetULONGBit<4>::value;
268 static const SK_OT_ULONG SpacingModifierLettersMask = SkOTSetULONGBit<5>::value;
269 static const SK_OT_ULONG CombiningDiacriticalMarksMask = SkOTSetULONGBit<6>::value;
270 static const SK_OT_ULONG GreekMask = SkOTSetULONGBit<7>::value;
272 static const SK_OT_ULONG CyrillicMask = SkOTSetULONGBit<9>::value;
273 static const SK_OT_ULONG ArmenianMask = SkOTSetULONGBit<10>::value;
274 static const SK_OT_ULONG HebrewMask = SkOTSetULONGBit<11>::value;
276 static const SK_OT_ULONG ArabicMask = SkOTSetULONGBit<13>::value;
278 static const SK_OT_ULONG DevanagariMask = SkOTSetULONGBit<15>::value;
279 static const SK_OT_ULONG BengaliMask = SkOTSetULONGBit<16>::value;
280 static const SK_OT_ULONG GurmukhiMask = SkOTSetULONGBit<17>::value;
281 static const SK_OT_ULONG GujaratiMask = SkOTSetULONGBit<18>::value;
282 static const SK_OT_ULONG OriyaMask = SkOTSetULONGBit<19>::value;
283 static const SK_OT_ULONG TamilMask = SkOTSetULONGBit<20>::value;
284 static const SK_OT_ULONG TeluguMask = SkOTSetULONGBit<21>::value;
285 static const SK_OT_ULONG KannadaMask = SkOTSetULONGBit<22>::value;
286 static const SK_OT_ULONG MalayalamMask = SkOTSetULONGBit<23>::value;
287 static const SK_OT_ULONG ThaiMask = SkOTSetULONGBit<24>::value;
288 static const SK_OT_ULONG LaoMask = SkOTSetULONGBit<25>::value;
289 static const SK_OT_ULONG GeorgianMask = SkOTSetULONGBit<26>::value;
291 static const SK_OT_ULONG HangulJamoMask = SkOTSetULONGBit<28>::value;
292 static const SK_OT_ULONG LatinExtendedAdditionalMask = SkOTSetULONGBit<29>::value;
293 static const SK_OT_ULONG GreekExtendedMask = SkOTSetULONGBit<30>::value;
294 static const SK_OT_ULONG GeneralPunctuationMask = SkOTSetULONGBit<31>::value;
297 static const SK_OT_ULONG SuperscriptsAndSubscriptsMask = SkOTSetULONGBit<32 - 32>::value;
298 static const SK_OT_ULONG CurrencySymbolsMask = SkOTSetULONGBit<33 - 32>::value;
299 static const SK_OT_ULONG CombiningDiacriticalMarksForSymbolsMask = SkOTSetULONGBit<34 - 32>::value;
300 static const SK_OT_ULONG LetterlikeSymbolsMask = SkOTSetULONGBit<35 - 32>::value;
301 static const SK_OT_ULONG NumberFormsMask = SkOTSetULONGBit<36 - 32>::value;
302 static const SK_OT_ULONG ArrowsMask = SkOTSetULONGBit<37 - 32>::value;
303 static const SK_OT_ULONG MathematicalOperatorsMask = SkOTSetULONGBit<38 - 32>::value;
304 static const SK_OT_ULONG MiscellaneousTechnicalMask = SkOTSetULONGBit<39 - 32>::value;
305 static const SK_OT_ULONG ControlPicturesMask = SkOTSetULONGBit<40 - 32>::value;
306 static const SK_OT_ULONG OpticalCharacterRecognitionMask = SkOTSetULONGBit<41 - 32>::value;
307 static const SK_OT_ULONG EnclosedAlphanumericsMask = SkOTSetULONGBit<42 - 32>::value;
308 static const SK_OT_ULONG BoxDrawingMask = SkOTSetULONGBit<43 - 32>::value;
309 static const SK_OT_ULONG BlockElementsMask = SkOTSetULONGBit<44 - 32>::value;
310 static const SK_OT_ULONG GeometricShapesMask = SkOTSetULONGBit<45 - 32>::value;
311 static const SK_OT_ULONG MiscellaneousSymbolsMask = SkOTSetULONGBit<46 - 32>::value;
312 static const SK_OT_ULONG DingbatsMask = SkOTSetULONGBit<47 - 32>::value;
313 static const SK_OT_ULONG CJKSymbolsAndPunctuationMask = SkOTSetULONGBit<48 - 32>::value;
314 static const SK_OT_ULONG HiraganaMask = SkOTSetULONGBit<49 - 32>::value;
315 static const SK_OT_ULONG KatakanaMask = SkOTSetULONGBit<50 - 32>::value;
316 static const SK_OT_ULONG BopomofoMask = SkOTSetULONGBit<51 - 32>::value;
317 static const SK_OT_ULONG HangulCompatibilityJamoMask = SkOTSetULONGBit<52 - 32>::value;
318 static const SK_OT_ULONG CJKMiscellaneousMask = SkOTSetULONGBit<53 - 32>::value;
319 static const SK_OT_ULONG EnclosedCJKLettersAndMonthsMask = SkOTSetULONGBit<54 - 32>::value;
320 static const SK_OT_ULONG CJKCompatibilityMask = SkOTSetULONGBit<55 - 32>::value;
321 static const SK_OT_ULONG HangulMask = SkOTSetULONGBit<56 - 32>::value;
322 static const SK_OT_ULONG SurrogatesMask = SkOTSetULONGBit<57 - 32>::value;
324 static const SK_OT_ULONG CJKUnifiedIdeographsMask = SkOTSetULONGBit<59 - 32>::value;
325 static const SK_OT_ULONG PrivateUseAreaMask = SkOTSetULONGBit<60 - 32>::value;
326 static const SK_OT_ULONG CJKCompatibilityIdeographsMask = SkOTSetULONGBit<61 - 32>::value;
327 static const SK_OT_ULONG AlphabeticPresentationFormsMask = SkOTSetULONGBit<62 - 32>::value;
328 static const SK_OT_ULONG ArabicPresentationFormsAMask = SkOTSetULONGBit<63 - 32>::value;
331 static const SK_OT_ULONG CombiningHalfMarksMask = SkOTSetULONGBit<64 - 64>::value;
332 static const SK_OT_ULONG CJKCompatibilityFormsMask = SkOTSetULONGBit<65 - 64>::value;
333 static const SK_OT_ULONG SmallFormVariantsMask = SkOTSetULONGBit<66 - 64>::value;
334 static const SK_OT_ULONG ArabicPresentationFormsBMask = SkOTSetULONGBit<67 - 64>::value;
335 static const SK_OT_ULONG HalfwidthAndFullwidthFormsMask = SkOTSetULONGBit<68 - 64>::value;
336 static const SK_OT_ULONG SpecialsMask = SkOTSetULONGBit<69 - 64>::value;
337 static const SK_OT_ULONG TibetanMask = SkOTSetULONGBit<70 - 64>::value;
338 static const SK_OT_ULONG SyriacMask = SkOTSetULONGBit<71 - 64>::value;
339 static const SK_OT_ULONG ThaanaMask = SkOTSetULONGBit<72 - 64>::value;
340 static const SK_OT_ULONG SinhalaMask = SkOTSetULONGBit<73 - 64>::value;
341 static const SK_OT_ULONG MyanmarMask = SkOTSetULONGBit<74 - 64>::value;
342 static const SK_OT_ULONG EthiopicMask = SkOTSetULONGBit<75 - 64>::value;
343 static const SK_OT_ULONG CherokeeMask = SkOTSetULONGBit<76 - 64>::value;
344 static const SK_OT_ULONG UnifiedCanadianSyllabicsMask = SkOTSetULONGBit<77 - 64>::value;
345 static const SK_OT_ULONG OghamMask = SkOTSetULONGBit<78 - 64>::value;
346 static const SK_OT_ULONG RunicMask = SkOTSetULONGBit<79 - 64>::value;
347 static const SK_OT_ULONG KhmerMask = SkOTSetULONGBit<80 - 64>::value;
348 static const SK_OT_ULONG MongolianMask = SkOTSetULONGBit<81 - 64>::value;
349 static const SK_OT_ULONG BrailleMask = SkOTSetULONGBit<82 - 64>::value;
350 static const SK_OT_ULONG YiMask = SkOTSetULONGBit<83 - 64>::value;
352 SK_OT_ULONG value[4];
355 SK_OT_CHAR achVendID[4];
380 static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value;
381 static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value;
382 static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value;
383 static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value;
384 static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value;
385 static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value;
386 static const SK_OT_USHORT RegularMask = SkOTSetUSHORTBit<6>::value;
390 SK_OT_USHORT usFirstCharIndex;
391 SK_OT_USHORT usLastCharIndex;
393 SK_OT_SHORT sTypoAscender;
394 SK_OT_SHORT sTypoDescender;
395 SK_OT_SHORT sTypoLineGap;
396 SK_OT_USHORT usWinAscent;
397 SK_OT_USHORT usWinDescent;
399 union CodePageRange {
408 MacintoshCharacterSet,
415 ChineseSimplified_936,
417 ChineseTraditional_950,
434 Latin2EasternEurope_1250,
458 MSDOSCanadianFrench_863,
485 static const SK_OT_ULONG Latin1_1252Mask = SkOTSetULONGBit<0>::value;
486 static const SK_OT_ULONG Latin2EasternEurope_1250Mask = SkOTSetULONGBit<1>::value;
487 static const SK_OT_ULONG Cyrillic_1251Mask = SkOTSetULONGBit<2>::value;
488 static const SK_OT_ULONG Greek_1253Mask = SkOTSetULONGBit<3>::value;
489 static const SK_OT_ULONG Turkish_1254Mask = SkOTSetULONGBit<4>::value;
490 static const SK_OT_ULONG Hebrew_1255Mask = SkOTSetULONGBit<5>::value;
491 static const SK_OT_ULONG Arabic_1256Mask = SkOTSetULONGBit<6>::value;
492 static const SK_OT_ULONG WindowsBaltic_1257Mask = SkOTSetULONGBit<7>::value;
493 static const SK_OT_ULONG Vietnamese_1258Mask = SkOTSetULONGBit<8>::value;
494 static const SK_OT_ULONG Thai_874Mask = SkOTSetULONGBit<16>::value;
495 static const SK_OT_ULONG JISJapan_932Mask = SkOTSetULONGBit<17>::value;
496 static const SK_OT_ULONG ChineseSimplified_936Mask = SkOTSetULONGBit<18>::value;
497 static const SK_OT_ULONG KoreanWansung_949Mask = SkOTSetULONGBit<19>::value;
498 static const SK_OT_ULONG ChineseTraditional_950Mask = SkOTSetULONGBit<20>::value;
499 static const SK_OT_ULONG KoreanJohab_1361Mask = SkOTSetULONGBit<21>::value;
500 static const SK_OT_ULONG MacintoshCharacterSetMask = SkOTSetULONGBit<29>::value;
501 static const SK_OT_ULONG OEMCharacterSetMask = SkOTSetULONGBit<30>::value;
502 static const SK_OT_ULONG SymbolCharacterSetMask = SkOTSetULONGBit<31>::value;
505 static const SK_OT_ULONG IBMGreek_869Mask = SkOTSetULONGBit<48 - 32>::value;
506 static const SK_OT_ULONG MSDOSRussian_866Mask = SkOTSetULONGBit<49 - 32>::value;
507 static const SK_OT_ULONG MSDOSNordic_865Mask = SkOTSetULONGBit<50 - 32>::value;
508 static const SK_OT_ULONG Arabic_864Mask = SkOTSetULONGBit<51 - 32>::value;
509 static const SK_OT_ULONG MSDOSCanadianFrench_863Mask = SkOTSetULONGBit<52 - 32>::value;
510 static const SK_OT_ULONG Hebrew_862Mask = SkOTSetULONGBit<53 - 32>::value;
511 static const SK_OT_ULONG MSDOSIcelandic_861Mask = SkOTSetULONGBit<54 - 32>::value;
512 static const SK_OT_ULONG MSDOSPortuguese_860Mask = SkOTSetULONGBit<55 - 32>::value;
513 static const SK_OT_ULONG IBMTurkish_857Mask = SkOTSetULONGBit<56 - 32>::value;
514 static const SK_OT_ULONG IBMCyrillic_855Mask = SkOTSetULONGBit<57 - 32>::value;
515 static const SK_OT_ULONG Latin2_852Mask = SkOTSetULONGBit<58 - 32>::value;
516 static const SK_OT_ULONG MSDOSBaltic_775Mask = SkOTSetULONGBit<59 - 32>::value;
517 static const SK_OT_ULONG Greek_737Mask = SkOTSetULONGBit<60 - 32>::value;
518 static const SK_OT_ULONG Arabic_708Mask = SkOTSetULONGBit<61 - 32>::value;
519 static const SK_OT_ULONG WELatin1_850Mask = SkOTSetULONGBit<62 - 32>::value;
520 static const SK_OT_ULONG US_437Mask = SkOTSetULONGBit<63 - 32>::value;
522 SK_OT_ULONG value[2];
526 SK_OT_SHORT sxHeight;
527 SK_OT_SHORT sCapHeight;
528 SK_OT_USHORT usDefaultChar;
529 SK_OT_USHORT usBreakChar;
530 SK_OT_USHORT usMaxContext;
536 static_assert(sizeof(SkOTTableOS2_V2) == 96, "sizeof_SkOTTableOS2_V2_not_96");