Example #1
0
            // generate a new table from the cached data

            public override OTTable GenerateTable()
            {
                // create a Motorola Byte Order buffer for the new table
                MBOBuffer newbuf;

                if (m_TableVersionNumber.GetUint() == 0x00000000)
                {
                    newbuf = new MBOBuffer(6);

                    newbuf.SetFixed(m_TableVersionNumber, (uint)Table_maxp.FieldOffsets.TableVersionNumber);
                    newbuf.SetUshort(m_NumGlyphs, (uint)Table_maxp.FieldOffsets.NumGlyphs);
                }
                else
                {
                    newbuf = new MBOBuffer(32);

                    newbuf.SetFixed(m_TableVersionNumber, (uint)Table_maxp.FieldOffsets.TableVersionNumber);
                    newbuf.SetUshort(m_NumGlyphs, (uint)Table_maxp.FieldOffsets.NumGlyphs);
                    newbuf.SetUshort(m_maxPoints, (uint)Table_maxp.FieldOffsets.maxPoints);
                    newbuf.SetUshort(m_maxContours, (uint)Table_maxp.FieldOffsets.maxContours);
                    newbuf.SetUshort(m_maxCompositePoints, (uint)Table_maxp.FieldOffsets.maxCompositePoints);
                    newbuf.SetUshort(m_maxCompositeContours, (uint)Table_maxp.FieldOffsets.maxCompositeContours);
                    newbuf.SetUshort(m_maxZones, (uint)Table_maxp.FieldOffsets.maxZones);
                    newbuf.SetUshort(m_maxTwilightPoints, (uint)Table_maxp.FieldOffsets.maxTwilightPoints);
                    newbuf.SetUshort(m_maxStorage, (uint)Table_maxp.FieldOffsets.maxStorage);
                    newbuf.SetUshort(m_maxFunctionDefs, (uint)Table_maxp.FieldOffsets.maxFunctionDefs);
                    newbuf.SetUshort(m_maxInstructionDefs, (uint)Table_maxp.FieldOffsets.maxInstructionDefs);
                    newbuf.SetUshort(m_maxStackElements, (uint)Table_maxp.FieldOffsets.maxStackElements);
                    newbuf.SetUshort(m_maxSizeOfInstructions, (uint)Table_maxp.FieldOffsets.maxSizeOfInstructions);
                    newbuf.SetUshort(m_maxComponentElements, (uint)Table_maxp.FieldOffsets.maxComponentElements);
                    newbuf.SetUshort(m_maxComponentDepth, (uint)Table_maxp.FieldOffsets.maxComponentDepth);
                }

                // put the buffer into a Table_maxp object and return it
                Table_maxp maxpTable = new Table_maxp("maxp", newbuf);

                return(maxpTable);
            }
Example #2
0
 // constructor
 public maxp_cache(Table_maxp OwnerTable)
 {
     // copy the data from the owner table's MBOBuffer
     // and store it in the cache variables
     m_TableVersionNumber = OwnerTable.TableVersionNumber;
     m_NumGlyphs          = OwnerTable.NumGlyphs;
     if (m_TableVersionNumber.GetUint() == 0x00010000)
     {
         m_maxPoints             = OwnerTable.maxPoints;
         m_maxContours           = OwnerTable.maxContours;
         m_maxCompositePoints    = OwnerTable.maxCompositePoints;
         m_maxCompositeContours  = OwnerTable.maxCompositeContours;
         m_maxZones              = OwnerTable.maxZones;
         m_maxTwilightPoints     = OwnerTable.maxTwilightPoints;
         m_maxStorage            = OwnerTable.maxStorage;
         m_maxFunctionDefs       = OwnerTable.maxFunctionDefs;
         m_maxInstructionDefs    = OwnerTable.maxInstructionDefs;
         m_maxStackElements      = OwnerTable.maxStackElements;
         m_maxSizeOfInstructions = OwnerTable.maxSizeOfInstructions;
         m_maxComponentElements  = OwnerTable.maxComponentElements;
         m_maxComponentDepth     = OwnerTable.maxComponentDepth;
     }
 }
Example #3
0
            protected char[] m_offset; // v2.5 NOTE: We may not need? so not supported yet

            // constructor
            public post_cache(Table_post OwnerTable)
            {
                m_Version = OwnerTable.Version;
                m_italicAngle = OwnerTable.italicAngle;
                m_underlinePosition = OwnerTable.underlinePosition;
                m_underlineThickness = OwnerTable.underlineThickness;
                m_isFixedPitch = OwnerTable.isFixedPitch;
                m_minMemType42 = OwnerTable.minMemType42;
                m_maxMemType42 = OwnerTable.maxMemType42;
                m_minMemType1 = OwnerTable.minMemType1;
                m_maxMemType1 = OwnerTable.maxMemType1;

                // NOTE: what about version 2.5 is that covered with this check?
                // NOTE: Are we not checking because it is deprecated?
                if( m_Version.GetUint() == 0x00020000 )
                {
                    m_numberOfGlyphs = OwnerTable.numberOfGlyphs;
                    m_glyphNameIndex = new ArrayList( m_numberOfGlyphs );

                    for( ushort i = 0; i < m_numberOfGlyphs; i++ )
                    {
                        m_glyphNameIndex.Add( OwnerTable.GetGlyphNameIndex( i ));
                    }

                    m_names = new ArrayList( (int)OwnerTable.NumberOfStrings );

                    // Get the gyph names
                    for( uint i = 0; i < OwnerTable.NumberOfStrings; i++ )
                    {
                        m_names.Add( OwnerTable.GetNameString( i ));
                    }
                }

            }
Example #4
0
 public void SetFixed(OTFixed value, uint offset)
 {
     uint n = value.GetUint();
     SetUint(n, offset);
 }
Example #5
0
 // constructor
 public maxp_cache(Table_maxp OwnerTable)
 {
     // copy the data from the owner table's MBOBuffer
     // and store it in the cache variables
     m_TableVersionNumber    = OwnerTable.TableVersionNumber;
     m_NumGlyphs                = OwnerTable.NumGlyphs;
     if( m_TableVersionNumber.GetUint() == 0x00010000 )
     {
         m_maxPoints                = OwnerTable.maxPoints;
         m_maxContours            = OwnerTable.maxContours;
         m_maxCompositePoints    = OwnerTable.maxCompositePoints;
         m_maxCompositeContours    = OwnerTable.maxCompositeContours;
         m_maxZones                = OwnerTable.maxZones;
         m_maxTwilightPoints        = OwnerTable.maxTwilightPoints;
         m_maxStorage            = OwnerTable.maxStorage;
         m_maxFunctionDefs        = OwnerTable.maxFunctionDefs;
         m_maxInstructionDefs    = OwnerTable.maxInstructionDefs;
         m_maxStackElements        = OwnerTable.maxStackElements;
         m_maxSizeOfInstructions    = OwnerTable.maxSizeOfInstructions;
         m_maxComponentElements    = OwnerTable.maxComponentElements;
         m_maxComponentDepth        = OwnerTable.maxComponentDepth;                    
     }
 }
Example #6
0
        public void SetFixed(OTFixed value, uint offset)
        {
            uint n = value.GetUint();

            SetUint(n, offset);
        }