CmapSubtable[] cmaps = cmapTable.getCmaps(); for (CmapSubtable cmap : cmaps)
CmapSubtable cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_FULL); if (cmap == null) cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_FULL); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_SYMBOL); else if (cmapTable.getCmaps().length > 0) cmap = cmapTable.getCmaps()[0];
data.seek(cmap.getOffset() + subTableOffset); int subtableFormat = data.readUnsignedShort(); long length;
table = new CmapTable(font); break; case GlyphTable.TAG:
data.seek(cmap.getOffset() + subTableOffset); int subtableFormat = data.readUnsignedShort(); long length;
if (tag.equals(CmapTable.TAG)) table = new CmapTable(font);
@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")); } } } }
CmapSubtable cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_FULL); if (cmap == null) cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_FULL); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_SYMBOL); else if (cmapTable.getCmaps().length > 0) cmap = cmapTable.getCmaps()[0];
data.seek(cmap.getOffset() + subTableOffset); int subtableFormat = data.readUnsignedShort(); long length;
table = new CmapTable(font); break; case GlyphTable.TAG:
/** * @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; }
CmapSubtable cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_FULL); if (cmap == null) cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_FULL); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_UNICODE_BMP); cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS, CmapTable.ENCODING_WIN_SYMBOL); else if (cmapTable.getCmaps().length > 0) cmap = cmapTable.getCmaps()[0];
CmapSubtable[] cmaps = cmapTable.getCmaps(); for (CmapSubtable cmap : cmaps)
CmapSubtable[] cmaps = cmapTable.getCmaps(); for (CmapSubtable cmap : cmaps)
@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")); } } } }