List of usage examples for com.itextpdf.kernel.font PdfFontFactory createFont
public static PdfFont createFont(byte[] fontProgram, String encoding, boolean embedded, boolean cached) throws IOException
From source file:org.reactome.server.tools.diagram.exporter.raster.itext.awt.DefaultFontMapper.java
License:Open Source License
public DefaultFontMapper() { byte[] bytes; try {/*from ww w .j ava2s . c o m*/ bytes = IOUtils.toByteArray(Resources.class.getResourceAsStream("fonts/arial.ttf")); REGULAR = PdfFontFactory.createFont(bytes, PdfEncodings.UTF8, true, true); bytes = IOUtils.toByteArray(Resources.class.getResourceAsStream("fonts/arialbd.ttf")); BOLD = PdfFontFactory.createFont(bytes, PdfEncodings.UTF8, true, true); } catch (IOException e) { e.printStackTrace(); } }