Skip to content

Commit 51514e2

Browse files
committed
Fix incorrect glyph appearance for hebrew glyphs (fillFieldWithHebrewCase2 test).
According to ISO 32000-2 specification if the DR and Resources dictionaries contain resources with the same name, the one already in the Resources dictionary shall take precedence. DEVSIX-2069
1 parent 069247d commit 51514e2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

forms/src/main/java/com/itextpdf/forms/fields/PdfFormField.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,11 +2762,10 @@ protected Object[] getFontAndSize(PdfDictionary asNormal) throws IOException {
27622762
if (fontNameObj != null) {
27632763
daFontName = new PdfName(fontNameObj.toString());
27642764
// according to spec, DA font shall be taken from the DR
2765-
if (defaultFontDic != null && null != defaultFontDic.getAsDictionary(daFontName)) {
2766-
daFontDict = defaultFontDic.getAsDictionary(daFontName);
2767-
} else if (normalFontDic != null) {
2768-
// search normal appearance as a fall back in case it was not found in DR
2765+
if (normalFontDic != null && null != normalFontDic.getAsDictionary(daFontName)) {
27692766
daFontDict = normalFontDic.getAsDictionary(daFontName);
2767+
} else if (defaultFontDic != null) {
2768+
daFontDict = defaultFontDic.getAsDictionary(daFontName);
27702769
}
27712770
}
27722771
}

0 commit comments

Comments
 (0)