Beispiel #1
0
            public override OTTable GenerateTable()
            {
                // create a Motorola Byte Order buffer for the new table
                MBOBuffer newbuf = new MBOBuffer((uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(Table_EBSC.bitmapScaleTable.length * m_numSizes));

                // populate the buffer
                newbuf.SetFixed(m_version, (uint)Table_EBSC.FieldOffsets.version);
                newbuf.SetUint(m_numSizes, (uint)Table_EBSC.FieldOffsets.numSizes);

                for (uint i = 0; i < m_numSizes; i++)
                {
                    bitmapScaleTable bst = (bitmapScaleTable)m_bitmapScaleTables[(int)i];

                    newbuf.SetSbyte(bst.hori.ascender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length));
                    newbuf.SetSbyte(bst.hori.descender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 1);
                    newbuf.SetByte(bst.hori.widthMax, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 2);
                    newbuf.SetSbyte(bst.hori.caretSlopeNumerator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 3);
                    newbuf.SetSbyte(bst.hori.caretSlopeDenominator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 4);
                    newbuf.SetSbyte(bst.hori.caretOffset, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 5);
                    newbuf.SetSbyte(bst.hori.minOriginSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 6);
                    newbuf.SetSbyte(bst.hori.minAdvanceSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 7);
                    newbuf.SetSbyte(bst.hori.maxBeforeBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 8);
                    newbuf.SetSbyte(bst.hori.minAfterBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 9);
                    newbuf.SetSbyte(bst.hori.pad1, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 10);
                    newbuf.SetSbyte(bst.hori.pad2, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 11);


                    newbuf.SetSbyte(bst.vert.ascender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 12);
                    newbuf.SetSbyte(bst.vert.descender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 13);
                    newbuf.SetByte(bst.vert.widthMax, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 14);
                    newbuf.SetSbyte(bst.vert.caretSlopeNumerator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 15);
                    newbuf.SetSbyte(bst.vert.caretSlopeDenominator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 16);
                    newbuf.SetSbyte(bst.vert.caretOffset, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 17);
                    newbuf.SetSbyte(bst.vert.minOriginSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 18);
                    newbuf.SetSbyte(bst.vert.minAdvanceSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 19);
                    newbuf.SetSbyte(bst.vert.maxBeforeBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 20);
                    newbuf.SetSbyte(bst.vert.minAfterBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 21);
                    newbuf.SetSbyte(bst.vert.pad1, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 22);
                    newbuf.SetSbyte(bst.vert.pad2, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 23);

                    newbuf.SetByte(bst.ppemX, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 24);
                    newbuf.SetByte(bst.ppemY, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 25);
                    newbuf.SetByte(bst.substitutePpemX, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 26);
                    newbuf.SetByte(bst.substitutePpemY, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 27);
                }

                // put the buffer into a Table_EBSC object and return it
                Table_EBSC EBSCTable = new Table_EBSC("EBSC", newbuf);

                return(EBSCTable);
            }
Beispiel #2
0
            protected ArrayList m_bitmapScaleTables; // bitmapScaleTableCache[]


            // constructor
            public EBSC_cache(Table_EBSC OwnerTable)
            {
                // copy the data from the owner table's MBOBuffer
                // and store it in the cache variables
                m_version  = OwnerTable.version;
                m_numSizes = OwnerTable.numSizes;

                m_bitmapScaleTables = new ArrayList((int)m_numSizes);

                for (uint i = 0; i < m_numSizes; i++)
                {
                    m_bitmapScaleTables.Add(OwnerTable.GetBitmapScaleTable(i));
                }
            }
Beispiel #3
0
        public virtual OTTable CreateTableObject(OTTag tag, MBOBuffer buf)
        {
            OTTable table = null;

            string sName = GetUnaliasedTableName(tag);

            switch (sName)
            {
            case "BASE": table = new Table_BASE(tag, buf); break;

            case "CFF ": table = new Table_CFF(tag, buf); break;

            case "cmap": table = new Table_cmap(tag, buf); break;

            case "cvt ": table = new Table_cvt(tag, buf); break;

            case "DSIG": table = new Table_DSIG(tag, buf); break;

            case "EBDT": table = new Table_EBDT(tag, buf); break;

            case "EBLC": table = new Table_EBLC(tag, buf); break;

            case "EBSC": table = new Table_EBSC(tag, buf); break;

            case "fpgm": table = new Table_fpgm(tag, buf); break;

            case "gasp": table = new Table_gasp(tag, buf); break;

            case "GDEF": table = new Table_GDEF(tag, buf); break;

            case "glyf": table = new Table_glyf(tag, buf); break;

            case "GPOS": table = new Table_GPOS(tag, buf); break;

            case "GSUB": table = new Table_GSUB(tag, buf); break;

            case "hdmx": table = new Table_hdmx(tag, buf); break;

            case "head": table = new Table_head(tag, buf); break;

            case "hhea": table = new Table_hhea(tag, buf); break;

            case "hmtx": table = new Table_hmtx(tag, buf); break;

            case "JSTF": table = new Table_JSTF(tag, buf); break;

            case "kern": table = new Table_kern(tag, buf); break;

            case "loca": table = new Table_loca(tag, buf); break;

            case "LTSH": table = new Table_LTSH(tag, buf); break;

            case "maxp": table = new Table_maxp(tag, buf); break;

            case "name": table = new Table_name(tag, buf); break;

            case "OS/2": table = new Table_OS2(tag, buf); break;

            case "PCLT": table = new Table_PCLT(tag, buf); break;

            case "post": table = new Table_post(tag, buf); break;

            case "prep": table = new Table_prep(tag, buf); break;

            case "VDMX": table = new Table_VDMX(tag, buf); break;

            case "vhea": table = new Table_vhea(tag, buf); break;

            case "vmtx": table = new Table_vmtx(tag, buf); break;

            case "VORG": table = new Table_VORG(tag, buf); break;

            //case "Zapf": table = new Table_Zapf(tag, buf); break;
            default: table = new Table__Unknown(tag, buf); break;
            }

            return(table);
        }
        public virtual OTTable CreateTableObject(OTTag tag, MBOBuffer buf)
        {
            OTTable table = null;

            string sName = GetUnaliasedTableName(tag);

            switch (sName)
            {
                case "BASE": table = new Table_BASE(tag, buf); break;
                case "CFF ": table = new Table_CFF(tag, buf); break;
                case "cmap": table = new Table_cmap(tag, buf); break;
                case "cvt ": table = new Table_cvt(tag, buf); break;
                case "DSIG": table = new Table_DSIG(tag, buf); break;
                case "EBDT": table = new Table_EBDT(tag, buf); break;
                case "EBLC": table = new Table_EBLC(tag, buf); break;
                case "EBSC": table = new Table_EBSC(tag, buf); break;
                case "fpgm": table = new Table_fpgm(tag, buf); break;
                case "gasp": table = new Table_gasp(tag, buf); break;
                case "GDEF": table = new Table_GDEF(tag, buf); break;
                case "glyf": table = new Table_glyf(tag, buf); break;
                case "GPOS": table = new Table_GPOS(tag, buf); break;
                case "GSUB": table = new Table_GSUB(tag, buf); break;
                case "hdmx": table = new Table_hdmx(tag, buf); break;
                case "head": table = new Table_head(tag, buf); break;
                case "hhea": table = new Table_hhea(tag, buf); break;
                case "hmtx": table = new Table_hmtx(tag, buf); break;
                case "JSTF": table = new Table_JSTF(tag, buf); break;
                case "kern": table = new Table_kern(tag, buf); break;
                case "loca": table = new Table_loca(tag, buf); break;
                case "LTSH": table = new Table_LTSH(tag, buf); break;
                case "maxp": table = new Table_maxp(tag, buf); break;
                case "name": table = new Table_name(tag, buf); break;
                case "OS/2": table = new Table_OS2(tag, buf); break;
                case "PCLT": table = new Table_PCLT(tag, buf); break;
                case "post": table = new Table_post(tag, buf); break;
                case "prep": table = new Table_prep(tag, buf); break;
                case "VDMX": table = new Table_VDMX(tag, buf); break;
                case "vhea": table = new Table_vhea(tag, buf); break;
                case "vmtx": table = new Table_vmtx(tag, buf); break;
                case "VORG": table = new Table_VORG(tag, buf); break;
                //case "Zapf": table = new Table_Zapf(tag, buf); break;
                default: table = new Table__Unknown(tag, buf); break;
            }

            return table;
        }
Beispiel #5
0
            public override OTTable GenerateTable()
            {
                // create a Motorola Byte Order buffer for the new table
                MBOBuffer newbuf = new MBOBuffer( (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(Table_EBSC.bitmapScaleTable.length * m_numSizes));

                // populate the buffer                
                newbuf.SetFixed( m_version,                (uint)Table_EBSC.FieldOffsets.version );
                newbuf.SetUint( m_numSizes,                (uint)Table_EBSC.FieldOffsets.numSizes );                

                for( uint i = 0; i < m_numSizes; i++ )
                {
                    bitmapScaleTable bst = (bitmapScaleTable)m_bitmapScaleTables[(int)i];

                    newbuf.SetSbyte( bst.hori.ascender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length)); 
                    newbuf.SetSbyte( bst.hori.descender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 1 );
                    newbuf.SetByte( bst.hori.widthMax, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 2 );
                    newbuf.SetSbyte( bst.hori.caretSlopeNumerator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 3 );
                    newbuf.SetSbyte( bst.hori.caretSlopeDenominator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 4 );
                    newbuf.SetSbyte( bst.hori.caretOffset, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 5 );
                    newbuf.SetSbyte( bst.hori.minOriginSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 6 );
                    newbuf.SetSbyte( bst.hori.minAdvanceSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 7 );
                    newbuf.SetSbyte( bst.hori.maxBeforeBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 8 );
                    newbuf.SetSbyte( bst.hori.minAfterBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 9 );
                    newbuf.SetSbyte( bst.hori.pad1, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 10 );
                    newbuf.SetSbyte( bst.hori.pad2, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 11 );

                    
                    newbuf.SetSbyte( bst.vert.ascender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 12 ); 
                    newbuf.SetSbyte( bst.vert.descender, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 13 );
                    newbuf.SetByte( bst.vert.widthMax, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 14 );
                    newbuf.SetSbyte( bst.vert.caretSlopeNumerator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 15 );
                    newbuf.SetSbyte( bst.vert.caretSlopeDenominator, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 16 );
                    newbuf.SetSbyte( bst.vert.caretOffset, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 17 );
                    newbuf.SetSbyte( bst.vert.minOriginSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 18 );
                    newbuf.SetSbyte( bst.vert.minAdvanceSB, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 19 );
                    newbuf.SetSbyte( bst.vert.maxBeforeBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 20 );
                    newbuf.SetSbyte( bst.vert.minAfterBL, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 21 );
                    newbuf.SetSbyte( bst.vert.pad1, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 22 );
                    newbuf.SetSbyte( bst.vert.pad2, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 23 );

                    newbuf.SetByte( bst.ppemX, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 24 );
                    newbuf.SetByte( bst.ppemY, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 25 );
                    newbuf.SetByte( bst.substitutePpemX, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 26 );
                    newbuf.SetByte( bst.substitutePpemY, (uint)Table_EBSC.FieldOffsets.FirstBitmapScaleTable + (uint)(i * Table_EBSC.bitmapScaleTable.length) + 27 );                    
                }

                // put the buffer into a Table_EBSC object and return it
                Table_EBSC EBSCTable = new Table_EBSC("EBSC", newbuf);

                return EBSCTable;
            }
Beispiel #6
0
            protected ArrayList m_bitmapScaleTables; // bitmapScaleTableCache[]

                
            // constructor
            public EBSC_cache(Table_EBSC OwnerTable)
            {
                // copy the data from the owner table's MBOBuffer
                // and store it in the cache variables
                m_version = OwnerTable.version;
                m_numSizes = OwnerTable.numSizes;

                m_bitmapScaleTables = new ArrayList( (int)m_numSizes );

                for( uint i = 0; i < m_numSizes; i++ )
                {
                    m_bitmapScaleTables.Add( OwnerTable.GetBitmapScaleTable( i ));
                }

            }