From e298d0b1849d1d1361a686da3ce7319909128588 Mon Sep 17 00:00:00 2001 From: Manuel Mall Date: Sun, 22 Jul 2007 03:08:14 +0000 Subject: Changed my mind on handling of width calculation for zero width spaces and moved it into the Font class where other similar cases are already dealt with git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@558456 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/Font.java | 4 ++++ src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/java/org') diff --git a/src/java/org/apache/fop/fonts/Font.java b/src/java/org/apache/fop/fonts/Font.java index e8a81a0ea..b8e7fa9c8 100644 --- a/src/java/org/apache/fop/fonts/Font.java +++ b/src/java/org/apache/fop/fonts/Font.java @@ -284,8 +284,12 @@ public class Font { width = 0; } else if (c == '\u202F') { width = getCharWidth(' ') / 2; + } else if (c == '\u2060') { + width = 0; } else if (c == '\u3000') { width = getCharWidth(' ') * 2; + } else if (c == '\ufeff') { + width = 0; } else { //Will be internally replaced by "#" if not found width = getWidth(mapChar(c)); diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 2a61ca188..93196d8ab 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -695,7 +695,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager { iThisStart = (short) (iNextStart + 1); } else if (CharUtilities.isFixedWidthSpace(ch) || CharUtilities.isZeroWidthSpace(ch)) { // create the AreaInfo object - MinOptMax ipd = new MinOptMax(CharUtilities.isZeroWidthSpace(ch) ? 0 : font.getCharWidth(ch)); + MinOptMax ipd = new MinOptMax(font.getCharWidth(ch)); ai = new AreaInfo(iNextStart, (short) (iNextStart + 1), (short) 0, (short) 0, ipd, false, true, breakOpportunity); -- cgit v1.2.3