diff options
author | Tore Engvig <tore@apache.org> | 2001-07-17 20:27:13 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-07-17 20:27:13 +0000 |
commit | d02a43aaefc7678be9f66e0758eb6a4f088fb0b9 (patch) | |
tree | 9080484259937e09361d65f0467433d9e78077ee | |
parent | bd80a07ca213125986d1c98ea03f422542c4caf0 (diff) | |
download | xmlgraphics-fop-d02a43aaefc7678be9f66e0758eb6a4f088fb0b9.tar.gz xmlgraphics-fop-d02a43aaefc7678be9f66e0758eb6a4f088fb0b9.zip |
PR: 2556
This fixes bug 2556 by changing the leader with pattern "space" to use an
InlineSpace instead of adding actually spaces.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194358 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/layout/LineArea.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index 2c51041e4..d7d703940 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -474,13 +474,9 @@ public class LineArea extends Area { switch (leaderPattern) { case LeaderPattern.SPACE: - //whitespace setting must be false for this - int whiteSpaceSetting = this.whiteSpaceCollapse; - this.changeWhiteSpaceCollapse(WhiteSpaceCollapse.FALSE); - pendingAreas.addElement( - this.buildSimpleLeader(whitespaceIndex, - leaderLength)); - this.changeWhiteSpaceCollapse(whiteSpaceSetting); + InlineSpace spaceArea = + new InlineSpace(leaderLength); + pendingAreas.addElement(spaceArea); break; case LeaderPattern.RULE: LeaderArea leaderArea = @@ -751,19 +747,17 @@ public class LineArea extends Area { * creates a leader as String out of the given char and the leader length * and wraps it in an InlineArea which is returned */ - private InlineArea buildSimpleLeader(int charNumber, int leaderLength) { - int width = this.currentFontState.width(charNumber); - if (width == 0) { - char c = (char) charNumber; - MessageHandler.errorln("char " + c + " has width 0. Using width 100 instead."); - width = 100; - } + private InlineArea buildSimpleLeader(char c, int leaderLength) { + int width = this.currentFontState.width(currentFontState.mapChar(c)); + if (width == 0) { + MessageHandler.errorln("char " + c + " has width 0. Using width 100 instead."); + width = 100; + } int factor = (int) Math.floor (leaderLength / width); char [] leaderChars = new char [factor]; - char fillChar = (char) charNumber; for (int i = 0; i < factor; i ++) { - leaderChars[i] = fillChar; + leaderChars[i] = c;//currentFontState.mapChar(c); } WordArea leaderPatternArea = new WordArea(currentFontState, this.red, this.green, |