/** * Retrieves a record from the cache. * * @param fileName the physical filename name of the font file. * @param encoding the encoding; never null. * @return the PDF font record or null, if not found. */ private BaseFontRecord getFromCache( final String fileName, final String encoding, final boolean embedded ) { final Object key = new BaseFontRecordKey( fileName, encoding, embedded ); final BaseFontRecord r = (BaseFontRecord) baseFonts.get( key ); if ( r != null ) { return r; } return null; }
/** * Creates a font record key. * * @return the font record key. */ public BaseFontRecordKey createKey() { if ( key == null ) { key = new BaseFontRecordKey( getFileName(), getEncoding(), isEmbedded() ); } return key; }
putToCache( new BaseFontRecordKey( fontKey, encoding, embedded ), fontRecord ); return fontRecord; ( BaseFont.HELVETICA, false, embedded, f, bold, italic ); putToCache( fontRecord ); putToCache( new BaseFontRecordKey( fontKey, encoding, embedded ), fontRecord ); return fontRecord;