Browse Source

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
tags/fop-0_95beta
Manuel Mall 17 years ago
parent
commit
e298d0b184

+ 4
- 0
src/java/org/apache/fop/fonts/Font.java View File

@@ -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));

+ 1
- 1
src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java View File

@@ -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);

Loading…
Cancel
Save