@Override protected void checkSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) { if (trueTypeFont.getFontEncoding().hasDifferences()) { throw new PdfAConformanceException(PdfAConformanceException.ALL_SYMBOLIC_TRUE_TYPE_FONTS_SHALL_NOT_SPECIFY_ENCODING); } // if symbolic font encoding doesn't have differences, itext7 won't write encoding for such font }
@Override protected void checkSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) { if (trueTypeFont.getFontEncoding().hasDifferences()) { throw new PdfAConformanceException(PdfAConformanceException.ALL_SYMBOLIC_TRUE_TYPE_FONTS_SHALL_NOT_SPECIFY_ENCODING); } // if symbolic font encoding doesn't have differences, itext7 won't write encoding for such font }
@Override protected void checkNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) { String encoding = trueTypeFont.getFontEncoding().getBaseEncoding(); // non-symbolic true type font will always has an encoding entry in font dictionary in itext7 if (!PdfEncodings.WINANSI.equals(encoding) && !encoding.equals(PdfEncodings.MACROMAN) || trueTypeFont.getFontEncoding().hasDifferences()) { throw new PdfAConformanceException(PdfAConformanceException.ALL_NON_SYMBOLIC_TRUE_TYPE_FONT_SHALL_SPECIFY_MAC_ROMAN_OR_WIN_ANSI_ENCODING_AS_THE_ENCODING_ENTRY, trueTypeFont); } }
@Override protected void checkNonSymbolicTrueTypeFont(PdfTrueTypeFont trueTypeFont) { String encoding = trueTypeFont.getFontEncoding().getBaseEncoding(); // non-symbolic true type font will always has an encoding entry in font dictionary in itext7 if (!PdfEncodings.WINANSI.equals(encoding) && !encoding.equals(PdfEncodings.MACROMAN) || trueTypeFont.getFontEncoding().hasDifferences()) { throw new PdfAConformanceException(PdfAConformanceException.ALL_NON_SYMBOLIC_TRUE_TYPE_FONT_SHALL_SPECIFY_MAC_ROMAN_OR_WIN_ANSI_ENCODING_AS_THE_ENCODING_ENTRY, trueTypeFont); } }
} else if (!fontEncoding.hasDifferences() && fontProgram.getGlyphByCode(k) != null) { shortTag[k] = 1; } else { if (fontEncoding.hasDifferences()) { if (isForceWidthsOutput() || !isBuiltInFont() || fontEncoding.hasDifferences()) { getPdfObject().put(PdfName.FirstChar, new PdfNumber(firstChar)); getPdfObject().put(PdfName.LastChar, new PdfNumber(lastChar));