aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java16
-rw-r--r--src/java/org/apache/fop/util/CharUtilities.java4
2 files changed, 14 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
index 4bc66adfb..9067c575c 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
@@ -32,6 +32,7 @@ import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.area.Trait;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.traits.SpaceVal;
+import org.apache.fop.util.CharUtilities;
import java.util.List;
import java.util.LinkedList;
@@ -73,12 +74,17 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager {
}
private org.apache.fop.area.inline.TextArea getCharacterInlineArea(Character node) {
- org.apache.fop.area.inline.TextArea ch
+ org.apache.fop.area.inline.TextArea text
= new org.apache.fop.area.inline.TextArea();
- ch.addWord(String.valueOf(node.getCharacter()), 0);
- TraitSetter.setProducerID(ch, node.getId());
- TraitSetter.addTextDecoration(ch, fobj.getTextDecoration());
- return ch;
+ char ch = node.getCharacter();
+ if (CharUtilities.isAnySpace(ch)) {
+ text.addSpace(ch, 0, CharUtilities.isAdjustableSpace(ch));
+ } else {
+ text.addWord(String.valueOf(ch), 0);
+ }
+ TraitSetter.setProducerID(text, node.getId());
+ TraitSetter.addTextDecoration(text, fobj.getTextDecoration());
+ return text;
}
/** @see org.apache.fop.layoutmgr.LayoutManager#getNextKnuthElements(LayoutContext, int) */
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index f200c3e2f..985c25df7 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -61,6 +61,8 @@ public class CharUtilities {
public static final char ZERO_WIDTH_SPACE = '\u200B';
/** zero-width no-break space (= byte order mark) */
public static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
+ /** soft hyphen */
+ public static final char SOFT_HYPHEN = '\u00AD';
/**
@@ -142,7 +144,7 @@ public class CharUtilities {
//TODO: are there other kinds of adjustable spaces?
return
(c == '\u0020' // normal space
- /*|| c == ''*/);
+ || c == NBSPACE); // no-break space
}
/**