@Override public String toString() { String descendant = null; if (getDescendantFont() != null) { descendant = getDescendantFont().getClass().getSimpleName(); } return getClass().getSimpleName() + "/" + descendant + ", PostScript name: " + getBaseFont(); }
/** * Constructor. * @param fontName COSName instance, Font name in the fonts dictionary. * @param dictionary COSDictionary instance for resources which resides the font. */ public FontEncodingPaneController(COSName fontName, COSDictionary dictionary) { PDResources resources = new PDResources(dictionary); try { PDFont font = resources.getFont(fontName); if (font instanceof PDType3Font) { fontPane = new Type3Font((PDType3Font) font, resources); } else if (font instanceof PDSimpleFont) { fontPane = new SimpleFont((PDSimpleFont) font); } else if (font instanceof PDType0Font) { fontPane = new Type0Font(((PDType0Font) font).getDescendantFont(), (PDType0Font) font); } } catch (IOException e) { e.printStackTrace(); } }
if (t0font.getDescendantFont() instanceof PDCIDFontType2) int unitsPerEm = ((PDCIDFontType2) t0font.getDescendantFont()).getTrueTypeFont().getHeader().getUnitsPerEm(); at.scale(1000d / unitsPerEm, 1000d / unitsPerEm);
private boolean isCffDescendant() { return type0Font.getDescendantFont() instanceof PDCIDFontType0; } }
private boolean isTtfDescendant() { return type0Font.getDescendantFont() instanceof PDCIDFontType2; }
@Override public String toString() { String descendant = null; if (getDescendantFont() != null) { descendant = getDescendantFont().getClass().getSimpleName(); } return getClass().getSimpleName() + "/" + descendant + " " + getBaseFont(); }
@Override public String toString() { String descendant = null; if (getDescendantFont() != null) { descendant = getDescendantFont().getClass().getSimpleName(); } return getClass().getSimpleName() + "/" + descendant + ", PostScript name: " + getBaseFont(); }
private List<PDCIDFont> getDescendantFonts() { org.apache.pdfbox.pdmodel.font.PDCIDFont pdcidFont = ((org.apache.pdfbox.pdmodel.font.PDType0Font) this.pdFontLike) .getDescendantFont(); if (pdcidFont != null) { List<PDCIDFont> list = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); list.add(new PBoxPDCIDFont(pdcidFont, this.renderingMode, this.document, this.flavour)); return Collections.unmodifiableList(list); } return Collections.emptyList(); }
/** * Constructor. * * @param type0Font Type0 font, with CIDFontType2 descendant */ TTFGlyph2D(PDType0Font type0Font) throws IOException { this(((PDCIDFontType2)type0Font.getDescendantFont()).getTrueTypeFont(), type0Font, true); vectorFont = type0Font; }
PDCIDFont cidFont = ((PDType0Font)font).getDescendantFont(); if (cidFont instanceof PDCIDFontType2)
PDCIDFont descendantFont = ((PDType0Font) font).getDescendantFont(); if (descendantFont instanceof PDCIDFontType2)
if (type0Font.getDescendantFont() instanceof PDCIDFontType2) else if (type0Font.getDescendantFont() instanceof PDCIDFontType0) PDCIDFontType0 cidType0Font = (PDCIDFontType0)type0Font.getDescendantFont(); glyph2D = new CIDType0Glyph2D(cidType0Font); // todo: could be null (need incorporate fallback)
@Override public Boolean getisSupplementCompatible() { org.apache.pdfbox.pdmodel.font.PDCIDFont descendantFont = ((org.apache.pdfbox.pdmodel.font.PDType0Font) this.pdFontLike).getDescendantFont(); if (descendantFont != null) { PDCIDSystemInfo cidSystemInfo = descendantFont.getCIDSystemInfo(); CMap currentCMap = ((org.apache.pdfbox.pdmodel.font.PDType0Font) this.pdFontLike).getCMap(); if (cidSystemInfo != null && currentCMap != null) { return Boolean.valueOf(cidSystemInfo.getSupplement() >= currentCMap.getSupplement()); } } return Boolean.FALSE; }
PDCIDFont descendantFont = ((PDType0Font) font).getDescendantFont(); if (descendantFont instanceof PDCIDFontType2) table.addEntry(font);
private static boolean descendantFontProgramIsNull(PDType0Font font) { org.apache.pdfbox.pdmodel.font.PDCIDFont descendant = font.getDescendantFont(); if(descendant instanceof PDCIDFontType2) { if(descendant.getFontDescriptor() != null) { return descendant.getFontDescriptor().getFontFile3() == null && descendant.getFontDescriptor().getFontFile2() == null; } } else { return descendant.getFontDescriptor().getFontFile3() == null; } return true; }
String descRegistry = null; PDCIDSystemInfo info = ((org.apache.pdfbox.pdmodel.font.PDType0Font) this.pdFontLike) .getDescendantFont().getCIDSystemInfo(); if (info != null) { descOrdering = info.getOrdering();
public FVFont convert(PDType0Font type0Font) throws IOException, IllegalAccessException, InstantiationException { this.type0Font = type0Font; PDCIDFont descendantFont = type0Font.getDescendantFont(); otfFont = getOtfFromDescendantFont(descendantFont); // so the descendant ttf font will usually have some important tables missing from it // that we need to create ourselves from data in the parent type 0 font. // always build cmap from type0 parent ourselves, cmaps existing in the ttf child tend to have some // issues in certain browsers and apps. convertCmap(); if (otfFont.getNameTable() == null || isCffDescendant()) convertNameRecords(); otfFont.finalizeFont(); otfFont.normalize(); return otfFont; }
Type0Container container = new Type0Container(font); PDCIDFont pdcidFont = ((PDType0Font) font) .getDescendantFont(); String cidType = pdcidFont.getCOSObject() .getNameAsString(COSName.SUBTYPE);
PDCIDFont descendantFont = ((PDType0Font) font).getDescendantFont(); if (descendantFont instanceof PDCIDFontType2)
String descendantID = getId(descendantFontDictionaryBase, FeatureObjectType.FONT); if (checkIDBeforeProcess(descendantID)) { parseFont(type0.getDescendantFont(), descendantID);