protected boolean fontFileNotEmbedded(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 == null && ff2 == null && ff3 == null); }
PDStream fontFile = fd.getFontFile(); if (fontFile != null)
/** * Return true if the FontDescriptor has only one FontFile entry. * * @param fontDescriptor * @return true if the FontDescriptor has only one FontFile entry. */ protected boolean hasOnlyOneFontFile(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 != null ^ ff2 != null ^ ff3 != null); }
@Override public PDStream extractFontFile(PDFontDescriptor fontDescriptor) PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff3 = fontDescriptor.getFontFile3();
stream = fd.getFontFile();
PDStream fontFile = fd.getFontFile(); if (fontFile != null)
protected boolean fontFileNotEmbedded(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 == null && ff2 == null && ff3 == null); }
PDStream fontFile = fd.getFontFile(); if (fontFile != null)
PDFontDescriptorAdapter(PDFontDescriptor descriptor) { this.descriptor = descriptor; file = descriptor.getFontFile(); if (file == null) { file = descriptor.getFontFile2(); } if (file == null) { file = descriptor.getFontFile3(); } }
@Override public PDStream extractFontFile(PDFontDescriptor fontDescriptor) PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff3 = fontDescriptor.getFontFile3();
protected boolean fontFileNotEmbedded(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 == null && ff2 == null && ff3 == null); }
@Override public PDStream extractFontFile(PDFontDescriptor fontDescriptor) PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff3 = fontDescriptor.getFontFile3();
/** * Return true if the FontDescriptor has only one FontFile entry. * * @param fontDescriptor * @return true if the FontDescriptor has only one FontFile entry. */ protected boolean hasOnlyOneFontFile(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 != null ^ ff2 != null ^ ff3 != null); }
/** * Return true if the FontDescriptor has only one FontFile entry. * * @param fontDescriptor * @return true if the FontDescriptor has only one FontFile entry. */ protected boolean hasOnlyOneFontFile(PDFontDescriptor fontDescriptor) { PDStream ff1 = fontDescriptor.getFontFile(); PDStream ff2 = fontDescriptor.getFontFile2(); PDStream ff3 = fontDescriptor.getFontFile3(); return (ff1 != null ^ ff2 != null ^ ff3 != null); }
public byte[] getData() throws IOException { if (cachedFontData != null) return cachedFontData; if (descriptor.getFontFile2() != null && baseFont instanceof PDType0Font) cachedFontData = loadType0TtfDescendantFont(); else if (descriptor.getFontFile2() != null) cachedFontData = loadTrueTypeFont(descriptor.getFontFile2()); else if (descriptor.getFontFile() != null) cachedFontData = loadType1Font(descriptor.getFontFile()); else if (descriptor.getFontFile3() != null) // FontFile3 docs say any font type besides TTF/OTF or Type 1.. cachedFontData = loadOtherTypeFont(descriptor.getFontFile3()); return cachedFontData; }
private static boolean fontProgramIsNull(org.apache.pdfbox.pdmodel.font.PDFont font) { if(font instanceof PDType3Font) { return false; } else if(font instanceof PDType0Font) { return descendantFontProgramIsNull((PDType0Font) font); } else if (!font.getSubType().equals(FontFactory.TYPE_3) && (font.isEmbedded())) { PDStream fontFile; if (font.getSubType().equals(FontFactory.TYPE_1) || font.getSubType().equals(FontFactory.MM_TYPE_1)) { if (font instanceof PDType1CFont) { fontFile = font.getFontDescriptor().getFontFile3(); } else { fontFile = font.getFontDescriptor().getFontFile(); } } else if (font.getSubType().equals(FontFactory.CID_FONT_TYPE_2) || font.getSubType().equals(FontFactory.TRUE_TYPE)) { fontFile = font.getFontDescriptor().getFontFile2(); } else { fontFile = font.getFontDescriptor().getFontFile3(); } if (fontFile != null) { return false; } } return true; }
private List<FontProgram> getFontFile() { if (!getSubtype().equals(FontFactory.TYPE_3) && (this.pdFontLike.isEmbedded())) { if (getSubtype().equals(FontFactory.TRUE_TYPE)) { PBoxTrueTypeFontProgram trueTypeFontProgram = new PBoxTrueTypeFontProgram( ((PDTrueTypeFont) this.pdFontLike).getTrueTypeFont(), getisSymbolic()); return PBoxPDFont.getFontProgramList(trueTypeFontProgram); } PDFontDescriptor fontDescriptor = pdFontLike.getFontDescriptor(); PDStream fontFile; if (getSubtype().equals(FontFactory.TYPE_1)) { if (this.pdFontLike instanceof PDType1CFont) { fontFile = fontDescriptor.getFontFile3(); } else { fontFile = fontDescriptor.getFontFile(); } } else if (getSubtype().equals(FontFactory.CID_FONT_TYPE_2)) { fontFile = fontDescriptor.getFontFile2(); } else { fontFile = fontDescriptor.getFontFile3(); } if (fontFile != null) { return PBoxPDFont.getFontProgramList(new PBoxFontProgram(fontFile)); } } return Collections.emptyList(); }
stream = fd.getFontFile();
stream = fd.getFontFile();