Ejemplo n.º 1
0
                private imageCache getEBDTImageFormat( Table_EBDT tableEDBT , indexSubTable ist, uint nGlyphIndex, uint nStartGlyphIndex )
                {                    
                    imageCache ic = null;
                    
            
                    switch( ist.header.imageFormat )
                    {
                        case 1:
                        {
                            Table_EBDT.smallGlyphMetrics sgm = tableEDBT.GetSmallMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            byte[] bData = tableEDBT.GetImageData( ist, nGlyphIndex, nStartGlyphIndex );
                            ic = new imageCache1( sgm, bData );                            
                            break;
                        }
                        case 2:
                        {
                            Table_EBDT.smallGlyphMetrics sgm = tableEDBT.GetSmallMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            byte[] bData = tableEDBT.GetImageData( ist, nGlyphIndex, nStartGlyphIndex );
                            ic = new imageCache2( sgm, bData );
                            break;
                        }                        
                        case 5:
                        {
                            byte[] bData = tableEDBT.GetImageData( ist, nGlyphIndex, nStartGlyphIndex );
                            ic = new imageCache5( bData );                            
                            break;
                        }        
                        case 6:
                        {
                            Table_EBDT.bigGlyphMetrics bgm = tableEDBT.GetBigMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            byte[] bData = tableEDBT.GetImageData( ist, nGlyphIndex, nStartGlyphIndex );
                            ic = new imageCache6( bgm, bData );
                            break;
                        }        
                        case 7:
                        {
                            Table_EBDT.bigGlyphMetrics bgm = tableEDBT.GetBigMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            byte[] bData = tableEDBT.GetImageData( ist, nGlyphIndex, nStartGlyphIndex );
                            ic = new imageCache7( bgm, bData );                        
                            break;
                        }        
                        case 8:
                        {
                            Table_EBDT.smallGlyphMetrics sgm = tableEDBT.GetSmallMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            ushort nNumComp = tableEDBT.GetNumComponents( ist, nGlyphIndex, nStartGlyphIndex );
                            ArrayList components = new ArrayList( nNumComp );
                            for( uint i = 0; i < nNumComp; i++ )
                            {
                                components.Add( tableEDBT.GetComponent( ist, nGlyphIndex, nStartGlyphIndex, i ));                                
                            }
                            ic = new imageCache8( sgm, nNumComp, components );                    
                            break;
                        }        
                        case 9:
                        {
                            Table_EBDT.bigGlyphMetrics bgm = tableEDBT.GetBigMetrics( ist, nGlyphIndex, nStartGlyphIndex );
                            ushort nNumComp = tableEDBT.GetNumComponents( ist, nGlyphIndex, nStartGlyphIndex );
                            ArrayList components = new ArrayList( nNumComp );
                            for( uint i = 0; i < nNumComp; i++ )
                            {
                                components.Add( tableEDBT.GetComponent( ist, nGlyphIndex, nStartGlyphIndex, i ));                                
                            }
                            ic = new imageCache9( bgm, nNumComp, components );                        
                            break;
                        }        
                        default:
                            Debug.Assert( false, "unsupported image format" );
                            break;
                        
                    }

                    return ic;
                }