gfx/skia/trunk/src/sfnt/SkOTTable_OS_2_VA.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/sfnt/SkOTTable_OS_2_VA.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,142 @@
     1.4 +/*
     1.5 + * Copyright 2012 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef SkOTTable_OS_2_VA_DEFINED
    1.12 +#define SkOTTable_OS_2_VA_DEFINED
    1.13 +
    1.14 +#include "SkEndian.h"
    1.15 +#include "SkIBMFamilyClass.h"
    1.16 +#include "SkOTTableTypes.h"
    1.17 +#include "SkPanose.h"
    1.18 +#include "SkTypedEnum.h"
    1.19 +
    1.20 +#pragma pack(push, 1)
    1.21 +
    1.22 +//Original V0 TT
    1.23 +struct SkOTTableOS2_VA {
    1.24 +    SK_OT_USHORT version;
    1.25 +    //SkOTTableOS2_VA::VERSION and SkOTTableOS2_V0::VERSION are both 0.
    1.26 +    //The only way to differentiate these two versions is by the size of the table.
    1.27 +    static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(0);
    1.28 +
    1.29 +    SK_OT_SHORT xAvgCharWidth;
    1.30 +    struct WeightClass {
    1.31 +        SK_TYPED_ENUM(Value, SK_OT_USHORT,
    1.32 +            ((UltraLight, SkTEndian_SwapBE16(1)))
    1.33 +            ((ExtraLight, SkTEndian_SwapBE16(2)))
    1.34 +            ((Light, SkTEndian_SwapBE16(3)))
    1.35 +            ((SemiLight, SkTEndian_SwapBE16(4)))
    1.36 +            ((Medium, SkTEndian_SwapBE16(5)))
    1.37 +            ((SemiBold, SkTEndian_SwapBE16(6)))
    1.38 +            ((Bold, SkTEndian_SwapBE16(7)))
    1.39 +            ((ExtraBold, SkTEndian_SwapBE16(8)))
    1.40 +            ((UltraBold, SkTEndian_SwapBE16(9)))
    1.41 +            SK_SEQ_END,
    1.42 +        (value)SK_SEQ_END)
    1.43 +    } usWeightClass;
    1.44 +    struct WidthClass {
    1.45 +        SK_TYPED_ENUM(Value, SK_OT_USHORT,
    1.46 +            ((UltraCondensed, SkTEndian_SwapBE16(1)))
    1.47 +            ((ExtraCondensed, SkTEndian_SwapBE16(2)))
    1.48 +            ((Condensed, SkTEndian_SwapBE16(3)))
    1.49 +            ((SemiCondensed, SkTEndian_SwapBE16(4)))
    1.50 +            ((Medium, SkTEndian_SwapBE16(5)))
    1.51 +            ((SemiExpanded, SkTEndian_SwapBE16(6)))
    1.52 +            ((Expanded, SkTEndian_SwapBE16(7)))
    1.53 +            ((ExtraExpanded, SkTEndian_SwapBE16(8)))
    1.54 +            ((UltraExpanded, SkTEndian_SwapBE16(9)))
    1.55 +            SK_SEQ_END,
    1.56 +        (value)SK_SEQ_END)
    1.57 +    } usWidthClass;
    1.58 +    union Type {
    1.59 +        struct Field {
    1.60 +            //8-15
    1.61 +            SK_OT_BYTE_BITFIELD(
    1.62 +                Reserved08,
    1.63 +                Reserved09,
    1.64 +                Reserved10,
    1.65 +                Reserved11,
    1.66 +                Reserved12,
    1.67 +                Reserved13,
    1.68 +                Reserved14,
    1.69 +                Reserved15)
    1.70 +            //0-7
    1.71 +            SK_OT_BYTE_BITFIELD(
    1.72 +                Reserved00,
    1.73 +                Restricted,
    1.74 +                PreviewPrint,
    1.75 +                Editable,
    1.76 +                Reserved04,
    1.77 +                Reserved05,
    1.78 +                Reserved06,
    1.79 +                Reserved07)
    1.80 +        } field;
    1.81 +        struct Raw {
    1.82 +            static const SK_OT_USHORT Installable = 0;
    1.83 +            static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value;
    1.84 +            static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value;
    1.85 +            static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value;
    1.86 +            SK_OT_USHORT value;
    1.87 +        } raw;
    1.88 +    } fsType;
    1.89 +    SK_OT_SHORT ySubscriptXSize;
    1.90 +    SK_OT_SHORT ySubscriptYSize;
    1.91 +    SK_OT_SHORT ySubscriptXOffset;
    1.92 +    SK_OT_SHORT ySubscriptYOffset;
    1.93 +    SK_OT_SHORT ySuperscriptXSize;
    1.94 +    SK_OT_SHORT ySuperscriptYSize;
    1.95 +    SK_OT_SHORT ySuperscriptXOffset;
    1.96 +    SK_OT_SHORT ySuperscriptYOffset;
    1.97 +    SK_OT_SHORT yStrikeoutSize;
    1.98 +    SK_OT_SHORT yStrikeoutPosition;
    1.99 +    SkIBMFamilyClass sFamilyClass;
   1.100 +    SkPanose panose;
   1.101 +    SK_OT_ULONG ulCharRange[4];
   1.102 +    SK_OT_CHAR achVendID[4];
   1.103 +    union Selection {
   1.104 +        struct Field {
   1.105 +            //8-15
   1.106 +            SK_OT_BYTE_BITFIELD(
   1.107 +                Reserved08,
   1.108 +                Reserved09,
   1.109 +                Reserved10,
   1.110 +                Reserved11,
   1.111 +                Reserved12,
   1.112 +                Reserved13,
   1.113 +                Reserved14,
   1.114 +                Reserved15)
   1.115 +            //0-7
   1.116 +            SK_OT_BYTE_BITFIELD(
   1.117 +                Italic,
   1.118 +                Underscore,
   1.119 +                Negative,
   1.120 +                Outlined,
   1.121 +                Strikeout,
   1.122 +                Bold,
   1.123 +                Reserved06,
   1.124 +                Reserved07)
   1.125 +        } field;
   1.126 +        struct Raw {
   1.127 +            static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value;
   1.128 +            static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value;
   1.129 +            static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value;
   1.130 +            static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value;
   1.131 +            static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value;
   1.132 +            static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value;
   1.133 +            SK_OT_USHORT value;
   1.134 +        } raw;
   1.135 +    } fsSelection;
   1.136 +    SK_OT_USHORT usFirstCharIndex;
   1.137 +    SK_OT_USHORT usLastCharIndex;
   1.138 +};
   1.139 +
   1.140 +#pragma pack(pop)
   1.141 +
   1.142 +
   1.143 +SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_VA) == 68, sizeof_SkOTTableOS2_VA_not_68);
   1.144 +
   1.145 +#endif

mercurial