/** * Stores a record in the cache. * * @param record the record. */ private void putToCache( final BaseFontRecord record ) { final BaseFontRecordKey key = record.createKey(); putToCache( key, record ); }
/** * Creates a iText-BaseFont for an font. If no basefont could be created, an BaseFontCreateException is thrown. * * @param logicalName the name of the font (null not permitted). * @param bold a flag indicating whether the font is rendered as bold font. * @param italic a flag indicating whether the font is rendered as italic or cursive font. * @param encoding the encoding. * @param embedded a flag indicating whether to embed the font glyphs in the generated documents. * @return the base font record. * @throws BaseFontCreateException if there was a problem setting the font for the target. */ public BaseFont createBaseFont( final String logicalName, final boolean bold, final boolean italic, final String encoding, final boolean embedded ) throws BaseFontCreateException { return createBaseFontRecord( logicalName, bold, italic, encoding, embedded ).getBaseFont(); }
/** * Creates a font record key. * * @return the font record key. */ public BaseFontRecordKey createKey() { if ( key == null ) { key = new BaseFontRecordKey( getFileName(), getEncoding(), isEmbedded() ); } return key; }
useGlobalCache, null, null ); if ( f != null ) { fontRecord = new BaseFontRecord( fontName, false, embedded, f, bold, italic ); putToCache( fontRecord ); return fontRecord; useGlobalCache, null, null ); if ( f != null ) { fontRecord = new BaseFontRecord ( BaseFont.HELVETICA, false, embedded, f, bold, italic ); putToCache( fontRecord );
final BaseFontRecord record = new BaseFontRecord ( filename, true, embedded, f, fontRecord.isBold(), fontRecord.isItalic() ); putToCache( record );