// constructor public EBLC_cache( Table_EBLC 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_tableEBDT = OwnerTable.getTableEDBT(); m_bitmapSizeTables = new ArrayList( (int)m_numSizes ); for( uint i = 0; i < m_numSizes; i++ ) { bitmapSizeTable bst = OwnerTable.GetBitmapSizeTable( i ); m_bitmapSizeTables.Add( new bitmapSizeTableCache( OwnerTable, bst )); } }
private indexSubTableCache getEBLCIndexSubTable( Table_EBLC OwnerTable, bitmapSizeTable bst, indexSubTableArray ista ) { indexSubTable ist = bst.GetIndexSubTable(ista); Table_EBDT tableEDBT = OwnerTable.getTableEDBT(); indexSubTableCache istc = null; switch( ist.header.indexFormat ) { case 1: { ArrayList cImageCache = new ArrayList(); for( uint i = ista.firstGlyphIndex; i <= ista.lastGlyphIndex; i++ ) { cImageCache.Add( getEBDTImageFormat( tableEDBT, ist, i, ista.firstGlyphIndex )); } istc = new indexSubTableCache1( ist.header.indexFormat, ist.header.imageFormat, cImageCache ); break; } case 2: { ArrayList cImageCache = new ArrayList(); for( uint i = ista.firstGlyphIndex; i <= ista.lastGlyphIndex; i++ ) { cImageCache.Add( getEBDTImageFormat( tableEDBT, ist, i, ista.firstGlyphIndex )); } uint nImageSize = ((indexSubTable2)ist).imageSize; Table_EBDT.bigGlyphMetrics bgm = ((indexSubTable2)ist).bigMetrics; istc = new indexSubTableCache2( ist.header.indexFormat, ist.header.imageFormat, cImageCache, nImageSize, bgm ); break; } case 3: { ArrayList cImageCache = new ArrayList(); for( uint i = ista.firstGlyphIndex; i <= ista.lastGlyphIndex; i++ ) { cImageCache.Add( getEBDTImageFormat( tableEDBT, ist, i, ista.firstGlyphIndex )); } istc = new indexSubTableCache3( ist.header.indexFormat, ist.header.imageFormat, cImageCache ); break; } case 4: { ArrayList cImageCache = new ArrayList(); ArrayList cGlyphCodes = new ArrayList(); for( uint i = 0; i < ((indexSubTable4)ist).numGlyphs; i++ ) { ushort nGlyphCode = ((indexSubTable4)ist).GetCodeOffsetPair( i ).glyphCode; cGlyphCodes.Add( nGlyphCode ); cImageCache.Add( getEBDTImageFormat( tableEDBT, ist, nGlyphCode, ista.firstGlyphIndex )); } istc = new indexSubTableCache4( ist.header.indexFormat, ist.header.imageFormat, cImageCache, cGlyphCodes ); break; } case 5: { ArrayList cImageCache = new ArrayList(); uint nImageSize = ((indexSubTable5)ist).imageSize; Table_EBDT.bigGlyphMetrics bgm = ((indexSubTable5)ist).bigMetrics; ArrayList cGlyphCodes = new ArrayList(); for( uint i = 0; i < ((indexSubTable5)ist).numGlyphs; i++ ) { ushort nGlyphCode = ((indexSubTable5)ist).GetGlyphCode( i ); cGlyphCodes.Add( nGlyphCode ); cImageCache.Add( getEBDTImageFormat( tableEDBT, ist, nGlyphCode, ista.firstGlyphIndex )); } istc = new indexSubTableCache5( ist.header.indexFormat, ist.header.imageFormat, cImageCache, nImageSize, bgm, cGlyphCodes ); break; } default: { Debug.Assert( false, "unsupported index format" ); break; } } return istc; }