Skip to content

Commit ce581c0

Browse files
committed
Do not substitute a symbol with itself during line transformations.
DEVSIX-2146
1 parent cc280cf commit ce581c0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

io/src/main/java/com/itextpdf/io/font/otf/GsubLookupType1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public boolean transformOne(GlyphLine line) {
7171
boolean changed = false;
7272
if (!openReader.isSkip(g.getCode(), lookupFlag)) {
7373
int substCode = substMap.get(g.getCode());
74-
if (substCode != 0) {
74+
if (substCode != 0 && substCode != g.getCode()) { // there is no need to substitute a symbol with itself
7575
line.substituteOneToOne(openReader, substCode);
7676
changed = true;
7777
}

io/src/main/java/com/itextpdf/io/font/otf/GsubLookupType3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public boolean transformOne(GlyphLine line) {
7171
boolean changed = false;
7272
if (!openReader.isSkip(g.getCode(), lookupFlag)) {
7373
int[] substCode = substMap.get(g.getCode());
74-
if (substCode != null) {
74+
if (substCode != null && substCode[0] != g.getCode()) { // there is no need to substitute a symbol with itself
7575
line.substituteOneToOne(openReader, substCode[0]);
7676
changed = true;
7777
}

0 commit comments

Comments
 (0)