private PDType3CharProc getCharProc(int code) throws ValidationException { PDType3CharProc charProc = font.getCharProc(code); if (charProc == null) { // There are no character description, we declare the Glyph as Invalid. If the character // is used in a Stream, the GlyphDetail will throw an exception. GlyphException glyphEx = new GlyphException(ERROR_FONTS_METRICS, code, font.getName() + ": The CharProcs \"" + font.getEncoding().getName(code) + "\" doesn't exist"); this.fontContainer.markAsInvalid(code, glyphEx); } return charProc; }
private Object[][] getGlyphs(PDType3Font font) throws IOException { Object[][] glyphs = new Object[256][4]; for (int index = 0; index <= 255; index++) { glyphs[index][0] = index; if (font.getEncoding().contains(index)) { glyphs[index][1] = font.getEncoding().getName(index); glyphs[index][2] = font.toUnicode(index); if (fontBBox.toGeneralPath().getBounds2D().isEmpty()) { glyphs[index][3] = NO_GLYPH; } else { glyphs[index][3] = renderType3Glyph(font, index); } totalAvailableGlyph++; } else { glyphs[index][1] = NO_GLYPH; glyphs[index][2] = NO_GLYPH; glyphs[index][3] = NO_GLYPH; } } return glyphs; }
/** * Returns the stream of the glyph for the given character code * * @param code character code * @return the stream to be used to render the glyph */ public PDType3CharProc getCharProc(int code) { String name = getEncoding().getName(code); COSBase base = getCharProcs().getDictionaryObject(COSName.getPDFName(name)); if (base instanceof COSStream) { return new PDType3CharProc(this, (COSStream) base); } return null; } }
/** * Returns the stream of the glyph for the given character code * * @param code character code * @return the stream to be used to render the glyph */ public PDType3CharProc getCharProc(int code) { String name = getEncoding().getName(code); if (!".notdef".equals(name)) { COSStream stream; stream = (COSStream)getCharProcs().getDictionaryObject(COSName.getPDFName(name)); if (stream == null) { return null; } return new PDType3CharProc(this, stream); } return null; } }
private PDType3CharProc getCharProc(int code) throws ValidationException { PDType3CharProc charProc = font.getCharProc(code); if (charProc == null) { // There are no character description, we declare the Glyph as Invalid. If the character // is used in a Stream, the GlyphDetail will throw an exception. GlyphException glyphEx = new GlyphException(ERROR_FONTS_METRICS, code, font.getName() + ": The CharProcs \"" + font.getEncoding().getName(code) + "\" doesn't exist"); this.fontContainer.markAsInvalid(code, glyphEx); } return charProc; }
private PDType3CharProc getCharProc(int code) throws ValidationException { PDType3CharProc charProc = font.getCharProc(code); if (charProc == null) { // There are no character description, we declare the Glyph as Invalid. If the character // is used in a Stream, the GlyphDetail will throw an exception. GlyphException glyphEx = new GlyphException(ERROR_FONTS_METRICS, code, font.getName() + ": The CharProcs \"" + font.getEncoding().getName(code) + "\" doesn't exist"); this.fontContainer.markAsInvalid(code, glyphEx); } return charProc; }
/** * Returns the stream of the glyph for the given character code * * @param code character code * @return the stream to be used to render the glyph */ public PDType3CharProc getCharProc(int code) { String name = getEncoding().getName(code); COSBase base = getCharProcs().getDictionaryObject(COSName.getPDFName(name)); if (base instanceof COSStream) { return new PDType3CharProc(this, (COSStream) base); } return null; } }