@Override public Glyph getGlyph(int unicode) { if (fontEncoding.canEncode(unicode) || unicode < 33) { Glyph glyph = getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)); if (glyph == null && (glyph = notdefGlyphs.get(unicode)) == null) { // Handle special layout characters like sfthyphen (00AD). // This glyphs will be skipped while converting to bytes glyph = new Glyph(-1, 0, unicode); notdefGlyphs.put(unicode, glyph); } return glyph; } return null; }
@Override public boolean containsGlyph(int unicode) { return (fontEncoding.canEncode(unicode) || unicode < 33) && getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)) != null; }
@Override public boolean containsGlyph(int unicode) { if (fontEncoding.isFontSpecific()) { return fontProgram.getGlyphByCode(unicode) != null; } else { return fontEncoding.canEncode(unicode) && getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)) != null; } }
@Override public Glyph getGlyph(int unicode) { if (fontEncoding.canEncode(unicode)) { Glyph glyph = getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)); //TODO TrueType what if font is specific? if (glyph == null && (glyph = notdefGlyphs.get(unicode)) == null) { Glyph notdef = getFontProgram().getGlyphByCode(0); if (notdef != null) { glyph = new Glyph(getFontProgram().getGlyphByCode(0), unicode); notdefGlyphs.put(unicode, glyph); } } return glyph; } return null; }
@Override public Glyph getGlyph(int unicode) { if (fontEncoding.canEncode(unicode)) { Glyph glyph; if (fontEncoding.isFontSpecific()) { glyph = getFontProgram().getGlyphByCode(unicode); } else { glyph = getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)); if (glyph == null && (glyph = notdefGlyphs.get(unicode)) == null) { // Handle special layout characters like sfthyphen (00AD). // This glyphs will be skipped while converting to bytes glyph = new Glyph(-1, 0, unicode); notdefGlyphs.put(unicode, glyph); } } return glyph; } return null; }
@Override public boolean containsGlyph(int unicode) { if (fontEncoding.canEncode(unicode)) { if (fontEncoding.isFontSpecific()) { return getFontProgram().getGlyphByCode(unicode) != null; } else { return getFontProgram().getGlyph(fontEncoding.getUnicodeDifference(unicode)) != null; } } else { return false; } }