Skip to content

Commit

Permalink
Merge pull request #160 from metanorma/zerowidthspace
Browse files Browse the repository at this point in the history
Zerowidthspace
  • Loading branch information
Intelligent2013 authored Dec 3, 2022
2 parents 3046f17 + 84b56ff commit a3b8541
Show file tree
Hide file tree
Showing 2 changed files with 1,522 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/org/apache/fop/fonts/GlyphMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class GlyphMapping {
public MinOptMax areaIPD;
public final boolean isHyphenated;
public final boolean isSpace;
public final boolean isZeroWidthSpace; // to check for zero-width space (otherwise we get redundant spaces in copy-paste text from PDF)
public boolean breakOppAfter;
public final Font font;
public final int level;
Expand All @@ -64,7 +65,21 @@ public GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letter
}

public GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letterSpaceCount,
MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean breakOppAfter,
MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean isZeroWidthSpace, boolean breakOppAfter,
Font font, int level, int[][] gposAdjustments) {
this(startIndex, endIndex, wordSpaceCount, letterSpaceCount, areaIPD, isHyphenated,
isSpace, isZeroWidthSpace, breakOppAfter, font, level, gposAdjustments, null, null);
}

public GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letterSpaceCount,
MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean breakOppAfter,
Font font, int level, int[][] gposAdjustments, String mapping, List associations) {
this(startIndex, endIndex, wordSpaceCount, letterSpaceCount, areaIPD, isHyphenated,
isSpace, false, breakOppAfter, font, level, gposAdjustments, null, null);
}

public GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letterSpaceCount,
MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean isZeroWidthSpace, boolean breakOppAfter,
Font font, int level, int[][] gposAdjustments, String mapping, List associations) {
assert startIndex <= endIndex;
this.startIndex = startIndex;
Expand All @@ -75,6 +90,7 @@ public GlyphMapping(int startIndex, int endIndex, int wordSpaceCount, int letter
this.areaIPD = areaIPD;
this.isHyphenated = isHyphenated;
this.isSpace = isSpace;
this.isZeroWidthSpace = isZeroWidthSpace;
this.breakOppAfter = breakOppAfter;
this.font = font;
this.level = level;
Expand Down
Loading

0 comments on commit a3b8541

Please sign in to comment.