michael@0: /* michael@0: * Copyright 2012 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkOTTable_OS_2_VA_DEFINED michael@0: #define SkOTTable_OS_2_VA_DEFINED michael@0: michael@0: #include "SkEndian.h" michael@0: #include "SkIBMFamilyClass.h" michael@0: #include "SkOTTableTypes.h" michael@0: #include "SkPanose.h" michael@0: #include "SkTypedEnum.h" michael@0: michael@0: #pragma pack(push, 1) michael@0: michael@0: //Original V0 TT michael@0: struct SkOTTableOS2_VA { michael@0: SK_OT_USHORT version; michael@0: //SkOTTableOS2_VA::VERSION and SkOTTableOS2_V0::VERSION are both 0. michael@0: //The only way to differentiate these two versions is by the size of the table. michael@0: static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(0); michael@0: michael@0: SK_OT_SHORT xAvgCharWidth; michael@0: struct WeightClass { michael@0: SK_TYPED_ENUM(Value, SK_OT_USHORT, michael@0: ((UltraLight, SkTEndian_SwapBE16(1))) michael@0: ((ExtraLight, SkTEndian_SwapBE16(2))) michael@0: ((Light, SkTEndian_SwapBE16(3))) michael@0: ((SemiLight, SkTEndian_SwapBE16(4))) michael@0: ((Medium, SkTEndian_SwapBE16(5))) michael@0: ((SemiBold, SkTEndian_SwapBE16(6))) michael@0: ((Bold, SkTEndian_SwapBE16(7))) michael@0: ((ExtraBold, SkTEndian_SwapBE16(8))) michael@0: ((UltraBold, SkTEndian_SwapBE16(9))) michael@0: SK_SEQ_END, michael@0: (value)SK_SEQ_END) michael@0: } usWeightClass; michael@0: struct WidthClass { michael@0: SK_TYPED_ENUM(Value, SK_OT_USHORT, michael@0: ((UltraCondensed, SkTEndian_SwapBE16(1))) michael@0: ((ExtraCondensed, SkTEndian_SwapBE16(2))) michael@0: ((Condensed, SkTEndian_SwapBE16(3))) michael@0: ((SemiCondensed, SkTEndian_SwapBE16(4))) michael@0: ((Medium, SkTEndian_SwapBE16(5))) michael@0: ((SemiExpanded, SkTEndian_SwapBE16(6))) michael@0: ((Expanded, SkTEndian_SwapBE16(7))) michael@0: ((ExtraExpanded, SkTEndian_SwapBE16(8))) michael@0: ((UltraExpanded, SkTEndian_SwapBE16(9))) michael@0: SK_SEQ_END, michael@0: (value)SK_SEQ_END) michael@0: } usWidthClass; michael@0: union Type { michael@0: struct Field { michael@0: //8-15 michael@0: SK_OT_BYTE_BITFIELD( michael@0: Reserved08, michael@0: Reserved09, michael@0: Reserved10, michael@0: Reserved11, michael@0: Reserved12, michael@0: Reserved13, michael@0: Reserved14, michael@0: Reserved15) michael@0: //0-7 michael@0: SK_OT_BYTE_BITFIELD( michael@0: Reserved00, michael@0: Restricted, michael@0: PreviewPrint, michael@0: Editable, michael@0: Reserved04, michael@0: Reserved05, michael@0: Reserved06, michael@0: Reserved07) michael@0: } field; michael@0: struct Raw { michael@0: static const SK_OT_USHORT Installable = 0; michael@0: static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value; michael@0: static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value; michael@0: static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value; michael@0: SK_OT_USHORT value; michael@0: } raw; michael@0: } fsType; michael@0: SK_OT_SHORT ySubscriptXSize; michael@0: SK_OT_SHORT ySubscriptYSize; michael@0: SK_OT_SHORT ySubscriptXOffset; michael@0: SK_OT_SHORT ySubscriptYOffset; michael@0: SK_OT_SHORT ySuperscriptXSize; michael@0: SK_OT_SHORT ySuperscriptYSize; michael@0: SK_OT_SHORT ySuperscriptXOffset; michael@0: SK_OT_SHORT ySuperscriptYOffset; michael@0: SK_OT_SHORT yStrikeoutSize; michael@0: SK_OT_SHORT yStrikeoutPosition; michael@0: SkIBMFamilyClass sFamilyClass; michael@0: SkPanose panose; michael@0: SK_OT_ULONG ulCharRange[4]; michael@0: SK_OT_CHAR achVendID[4]; michael@0: union Selection { michael@0: struct Field { michael@0: //8-15 michael@0: SK_OT_BYTE_BITFIELD( michael@0: Reserved08, michael@0: Reserved09, michael@0: Reserved10, michael@0: Reserved11, michael@0: Reserved12, michael@0: Reserved13, michael@0: Reserved14, michael@0: Reserved15) michael@0: //0-7 michael@0: SK_OT_BYTE_BITFIELD( michael@0: Italic, michael@0: Underscore, michael@0: Negative, michael@0: Outlined, michael@0: Strikeout, michael@0: Bold, michael@0: Reserved06, michael@0: Reserved07) michael@0: } field; michael@0: struct Raw { michael@0: static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value; michael@0: static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value; michael@0: static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value; michael@0: static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value; michael@0: static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value; michael@0: static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value; michael@0: SK_OT_USHORT value; michael@0: } raw; michael@0: } fsSelection; michael@0: SK_OT_USHORT usFirstCharIndex; michael@0: SK_OT_USHORT usLastCharIndex; michael@0: }; michael@0: michael@0: #pragma pack(pop) michael@0: michael@0: michael@0: SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_VA) == 68, sizeof_SkOTTableOS2_VA_not_68); michael@0: michael@0: #endif