Ejemplo n.º 1
0
        /// <summary>
        ///     Reads the contents of the "maxp" 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;

            // These two fields are common to versions 0.5 and 1.0
            versionNo = stream.ReadFixed();
            numGlyphs = stream.ReadUShort();

            // Version 1.0 of this table contains more data
            if (versionNo == 0x00010000)
            {
                maxPoints             = stream.ReadUShort();
                maxContours           = stream.ReadUShort();
                maxCompositePoints    = stream.ReadUShort();
                maxCompositeContours  = stream.ReadUShort();
                maxZones              = stream.ReadUShort();
                maxTwilightPoints     = stream.ReadUShort();
                maxStorage            = stream.ReadUShort();
                maxFunctionDefs       = stream.ReadUShort();
                maxInstructionDefs    = stream.ReadUShort();
                maxStackElements      = stream.ReadUShort();
                maxSizeOfInstructions = stream.ReadUShort();
                maxComponentElements  = stream.ReadUShort();
                maxComponentDepth     = stream.ReadUShort();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Reads the contents of the "post" 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.ReadFixed();

            // The italic angle is stored in the stupid fixed field format.
            italicAngle = (float)stream.ReadFixed() / 65536.0f;

            underlinePosition  = stream.ReadFWord();
            underlineThickness = stream.ReadFWord();
            fixedPitch         = stream.ReadULong();
            minMemType42       = stream.ReadULong();
            maxMemType42       = stream.ReadULong();
            minMemType1        = stream.ReadULong();
            maxMemType1        = stream.ReadULong();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Reads the contents of the "head" table from the current position
        ///     in the supplied stream.
        /// </summary>
        /// <param name="reader"></param>
        protected internal override void Read(FontFileReader reader)
        {
            FontFileStream stream = reader.Stream;

            versionNo          = stream.ReadFixed();
            fontRevision       = stream.ReadFixed();
            checkSumAdjustment = stream.ReadULong();
            magicNumber        = stream.ReadULong();
            flags       = stream.ReadUShort();
            unitsPermEm = stream.ReadUShort();
            // Some fonts have dodgy date offsets that cause AddSeconds to throw an exception
            createDate        = GetDate(stream.ReadLongDateTime());
            updateDate        = GetDate(stream.ReadLongDateTime());
            xMin              = stream.ReadShort();
            yMin              = stream.ReadShort();
            xMax              = stream.ReadShort();
            yMax              = stream.ReadShort();
            macStyle          = stream.ReadUShort();
            lowestRecPPEM     = stream.ReadUShort();
            fontDirectionHint = stream.ReadShort();
            indexToLocFormat  = stream.ReadShort();
            glyphDataFormat   = stream.ReadShort();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Reads the contents of the "hhea" table from the current position
        ///     in the supplied stream.
        /// </summary>
        /// <param name="reader"></param>
        protected internal override void Read(FontFileReader reader)
        {
            FontFileStream stream = reader.Stream;

            versionNo           = stream.ReadFixed();
            ascender            = stream.ReadFWord();
            decender            = stream.ReadFWord();
            lineGap             = stream.ReadFWord();
            advanceWidthMax     = stream.ReadUFWord();
            minLeftSideBearing  = stream.ReadFWord();
            minRightSideBearing = stream.ReadFWord();
            xMaxExtent          = stream.ReadFWord();
            caretSlopeRise      = stream.ReadShort();
            caretSlopeRun       = stream.ReadShort();
            caretOffset         = stream.ReadShort();
            stream.ReadShort();
            stream.ReadShort();
            stream.ReadShort();
            stream.ReadShort();
            metricDataFormat = stream.ReadShort();
            numberOfHMetrics = stream.ReadUShort();
        }