private byte[] buildCmapTable() throws IOException if (ttf.getCmap() == null || uniToGID.isEmpty() || keepTables != null && !keepTables.contains("cmap"))
if (!isEmbedded && font.getCmap() == null)
private CmapSubtable getUnicodeCmapImpl(boolean isStrict) throws IOException CmapTable cmapTable = getCmap(); if (cmapTable == null)
CmapTable cmapTable = ttf.getCmap(); if (cmapTable != null)
@Override protected void processFontFile(PDFontDescriptor fontDescriptor, PDStream fontFile) { if (font.isDamaged()) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The FontFile can't be read")); } else { // there must be exactly one encoding in the "cmap" table if the font is symbolic TrueTypeFont ttf = pdTrueTypeFont.getTrueTypeFont(); try { if (pdTrueTypeFont.isSymbolic() && ttf.getCmap().getCmaps().length != 1) { this.fContainer.push(new ValidationError(ERROR_FONTS_ENCODING, this.font.getName() + ": Symbolic TrueType font has more than one 'cmap' entry")); } } catch (IOException e) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The TTF 'cmap' could not be read")); } } } }
/** * @return number of CMap`s */ @Override public Long getnrCmaps() { try { CmapTable cmap = ((TrueTypeFont) this.fontProgram).getCmap(); if (cmap != null) { int nrCmaps = cmap.getCmaps().length; return Long.valueOf(nrCmaps); } } catch (IOException e) { LOGGER.debug(e); } return null; }
private byte[] buildCmapTable() throws IOException if (ttf.getCmap() == null || uniToGID.isEmpty() || keepTables != null && !keepTables.contains("cmap"))
private byte[] buildCmapTable() throws IOException if (ttf.getCmap() == null || uniToGID.isEmpty() || keepTables != null && !keepTables.contains("cmap"))
if (!isEmbedded && font.getCmap() == null)
if (!isEmbedded && font.getCmap() == null)
private CmapSubtable getUnicodeCmapImpl(boolean isStrict) throws IOException CmapTable cmapTable = getCmap(); if (cmapTable == null)
CmapTable cmapTable = getCmap(); if (cmapTable == null)
CmapTable cmapTable = ttf.getCmap(); if (cmapTable != null)
CmapTable cmapTable = ttf.getCmap(); if (cmapTable != null)
@Override protected void processFontFile(PDFontDescriptor fontDescriptor, PDStream fontFile) { if (font.isDamaged()) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The FontFile can't be read")); } else { // there must be exactly one encoding in the "cmap" table if the font is symbolic TrueTypeFont ttf = pdTrueTypeFont.getTrueTypeFont(); try { if (pdTrueTypeFont.isSymbolic() && ttf.getCmap().getCmaps().length != 1) { this.fContainer.push(new ValidationError(ERROR_FONTS_ENCODING, this.font.getName() + ": Symbolic TrueType font has more than one 'cmap' entry")); } } catch (IOException e) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The TTF 'cmap' could not be read")); } } } }
@Override protected void processFontFile(PDFontDescriptor fontDescriptor, PDStream fontFile) { if (font.isDamaged()) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The FontFile can't be read")); } else { // there must be exactly one encoding in the "cmap" table if the font is symbolic TrueTypeFont ttf = pdTrueTypeFont.getTrueTypeFont(); try { if (pdTrueTypeFont.isSymbolic() && ttf.getCmap().getCmaps().length != 1) { this.fContainer.push(new ValidationError(ERROR_FONTS_ENCODING, this.font.getName() + ": Symbolic TrueType font has more than one 'cmap' entry")); } } catch (IOException e) { this.fContainer.push(new ValidationError(ERROR_FONTS_TRUETYPE_DAMAGED, this.font.getName() + ": The TTF 'cmap' could not be read")); } } } }