Skip to content

Commit a1c1add

Browse files
committed
Update PdfFont#containsGlyph().
1 parent 7958b64 commit a1c1add

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

kernel/src/main/java/com/itextpdf/kernel/font/PdfFont.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ protected PdfFont() {
5656
public abstract Glyph getGlyph(int unicode);
5757

5858
public boolean containsGlyph(char unicode) {
59-
return getGlyph(unicode) != null;
59+
Glyph glyph = getGlyph(unicode);
60+
if (glyph != null) {
61+
if (getFontProgram() != null && getFontProgram().isFontSpecific()) {
62+
//if current is symbolic, zero code is valid value
63+
return glyph.getCode() > -1;
64+
} else {
65+
return glyph.getCode() > 0;
66+
}
67+
} else {
68+
return false;
69+
}
6070
}
6171

6272
public abstract GlyphLine createGlyphLine(String content);

0 commit comments

Comments
 (0)