@Override protected byte[] encode(int unicode) throws IOException String name = getGlyphList().codePointToName(unicode); if (!encoding.contains(name)) throw new IllegalArgumentException( String.format("U+%04X ('%s') is not available in this font's encoding: %s", unicode, name, encoding.getEncodingName())); String nameInFont = getNameInFont(name); Map<String, Integer> inverted = encoding.getNameToCodeMap(); if (nameInFont.equals(".notdef") || !genericFont.hasGlyph(nameInFont)) throw new IllegalArgumentException( String.format("No glyph for U+%04X in font %s", unicode, getName())); int code = inverted.get(name); return new byte[] { (byte)code };
if (!encoding.contains(getGlyphList().codePointToName(unicode)))
if (font.getEncoding().contains(index))
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;
glyphs[index][3] = renderType3Glyph(font, index);
totalAvailableGlyph++;
glyphs[index][1] = NO_GLYPH;
glyphs[index][2] = NO_GLYPH;
glyphs[index][3] = NO_GLYPH;
return glyphs;
@Override protected byte[] encode(int unicode) throws IOException String name = getGlyphList().codePointToName(unicode); if (!encoding.contains(name)) throw new IllegalArgumentException( String.format("U+%04X ('%s') is not available in this font's encoding: %s", unicode, name, encoding.getEncodingName())); String nameInFont = getNameInFont(name); Map<String, Integer> inverted = encoding.getNameToCodeMap(); if (nameInFont.equals(".notdef") || !genericFont.hasGlyph(nameInFont)) throw new IllegalArgumentException( String.format("No glyph for U+%04X in font %s", unicode, getName())); int code = inverted.get(name); return new byte[] { (byte)code };
@Override protected byte[] encode(int unicode) throws IOException String name = getGlyphList().codePointToName(unicode); if (!encoding.contains(name)) throw new IllegalArgumentException( String.format("U+%04X ('%s') is not available in this font's encoding: %s", unicode, name, encoding.getEncodingName())); String nameInFont = getNameInFont(name); Map<String, Integer> inverted = encoding.getNameToCodeMap(); if (nameInFont.equals(".notdef") || !genericFont.hasGlyph(nameInFont)) throw new IllegalArgumentException( String.format("No glyph for U+%04X in font %s", unicode, getName())); int code = inverted.get(name); return new byte[] { (byte)code };
if (!encoding.contains(getGlyphList().codePointToName(unicode)))
if (!encoding.contains(getGlyphList().codePointToName(unicode)))