Ejemplo n.º 1
0
        /// <summary>
        ///     Reads the contents of the "os/2" table from the supplied stream
        ///     at the current position.
        /// </summary>
        /// <param name="reader"></param>
        protected internal override void Read(FontFileReader reader)
        {
            FontFileStream stream = reader.Stream;

            version       = stream.ReadUShort();
            avgCharWidth  = stream.ReadShort();
            usWeightClass = stream.ReadUShort();
            usWidthClass  = stream.ReadUShort();
            // According to the OpenType spec, bit 0 must be zero.
            fsType             = (ushort)(stream.ReadUShort() & ~1);
            subscriptXSize     = stream.ReadShort();
            subscriptYSize     = stream.ReadShort();
            subscriptXOffset   = stream.ReadShort();
            subscriptYOffset   = stream.ReadShort();
            superscriptXSize   = stream.ReadShort();
            superscriptYSize   = stream.ReadShort();
            superscriptXOffset = stream.ReadShort();
            superscriptYOffset = stream.ReadShort();
            strikeoutSize      = stream.ReadShort();
            strikeoutPosition  = stream.ReadShort();
            short familyClass = stream.ReadShort();

            classID    = (byte)(familyClass >> 8);
            subclassID = (byte)(familyClass & 255);
            stream.Read(panose, 0, panose.Length);
            unicodeRange1    = stream.ReadULong();
            unicodeRange2    = stream.ReadULong();
            unicodeRange3    = stream.ReadULong();
            unicodeRange4    = stream.ReadULong();
            vendorID[0]      = stream.ReadChar();
            vendorID[1]      = stream.ReadChar();
            vendorID[2]      = stream.ReadChar();
            vendorID[3]      = stream.ReadChar();
            fsSelection      = stream.ReadUShort();
            usFirstCharIndex = stream.ReadUShort();
            usLastCharIndex  = stream.ReadUShort();
            typoAscender     = stream.ReadShort();
            typoDescender    = stream.ReadShort();
            typoLineGap      = stream.ReadShort();
            usWinAscent      = stream.ReadUShort();
            usWinDescent     = stream.ReadUShort();
            codePageRange1   = stream.ReadULong();
            codePageRange2   = stream.ReadULong();
            sxHeight         = stream.ReadShort();
            sCapHeight       = stream.ReadShort();
            usDefaultChar    = stream.ReadUShort();
            usBreakChar      = stream.ReadUShort();
            usMaxContext     = stream.ReadUShort();
        }