List of usage examples for org.apache.pdfbox.pdmodel.font PDFontDescriptor getFontFile
public PDStream getFontFile()
From source file:org.apache.fop.render.pdf.pdfbox.FOPPDFMultiByteFont.java
License:Apache License
private InputStream readFontFile(PDFont font) throws IOException { PDFontDescriptor fd = font.getFontDescriptor(); if (font instanceof PDType0Font) { PDCIDFont cidFont = ((PDType0Font) font).getDescendantFont(); fd = cidFont.getFontDescriptor(); }// ww w .j a v a2s . com PDStream ff = fd.getFontFile3(); if (ff == null) { ff = fd.getFontFile2(); if (ff == null) { ff = fd.getFontFile(); } } if (ff == null) { throw new IOException(font.getName() + " no fontfile"); } InputStream is = ff.createInputStream(); return new ByteArrayInputStream(IOUtils.toByteArray(is)); }
From source file:org.apache.fop.render.pdf.pdfbox.FOPPDFSingleByteFont.java
License:Apache License
private PDStream readFontFile(PDFont font) throws IOException { PDFontDescriptor fd = font.getFontDescriptor(); setFlags(fd.getFlags());/*from w w w .j a v a2 s . co m*/ PDStream ff = fd.getFontFile3(); if (ff == null) { ff = fd.getFontFile2(); if (ff == null) { ff = fd.getFontFile(); } } else { setFontType(FontType.TYPE1C); } if (ff == null) { throw new IOException(font.getName() + " no font file"); } return ff; }