diff options
author | Keiron Liddle <keiron@apache.org> | 2002-11-27 14:59:52 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-11-27 14:59:52 +0000 |
commit | 23ec62f389f8d869e5ca889d5147c0ce0ab9c673 (patch) | |
tree | ff0eb4f2c1a1f51103410817025a72455d2776c4 /src/org | |
parent | 4964200b9b055b1e30008453fe2b08940271f77e (diff) | |
download | xmlgraphics-fop-23ec62f389f8d869e5ca889d5147c0ce0ab9c673.tar.gz xmlgraphics-fop-23ec62f389f8d869e5ca889d5147c0ce0ab9c673.zip |
convert " " into a Space inline
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195639 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/apache/fop/layoutmgr/TextLayoutManager.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/org/apache/fop/layoutmgr/TextLayoutManager.java index f3fdc9ae2..bda6fdba9 100644 --- a/src/org/apache/fop/layoutmgr/TextLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/TextLayoutManager.java @@ -164,8 +164,8 @@ public class TextLayoutManager extends AbstractLayoutManager { if (prevPos != null) { // ASSERT (prevPos.getLM() == this) if (prevPos.getLM() != this) { - //log.error( - // "TextLayoutManager.resetPosition: " + "LM mismatch!!!"); + getLogger().error( + "TextLayoutManager.resetPosition: " + "LM mismatch!!!"); } LeafPosition tbp = (LeafPosition) prevPos; AreaInfo ai = @@ -477,23 +477,27 @@ public class TextLayoutManager extends AbstractLayoutManager { // " total=" + iAdjust); // Make an area containing all characters between start and end. - Word word = null; + InlineArea word = null; int adjust = 0; // ingnore newline character if(chars[ai.iBreakIndex - 1] == NEWLINE) { adjust = 1; } String str = new String(chars, iStart, ai.iBreakIndex - iStart - adjust); - //if(!"".equals(str.trim())) { - word = createWord( + if(" ".equals(str)) { + word = new Space(); + word.setWidth(ai.ipdArea.opt + iAdjust); + } else { + Word w = createWord( str, ai.ipdArea.opt + iAdjust, context.getBaseline()); if (iWScount > 0) { - //log.error("Adjustment per word-space= " + + //getLogger().error("Adjustment per word-space= " + // iAdjust / iWScount); - word.setWSadjust(iAdjust / iWScount); + w.setWSadjust(iAdjust / iWScount); } - //} + word = w; + } if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE) && context.getLeadingSpace().hasSpaces()) { context.getLeadingSpace().addSpace(halfWS); |