aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-04-10 07:39:01 +0000
committerJeremias Maerki <jeremias@apache.org>2006-04-10 07:39:01 +0000
commit2569a6d829991a2aebad001df2447483d44e1d9b (patch)
tree6322f43132c46501d647fb83c5ee8cda43eb6be8 /src/java/org
parent45c2b951496f399540056fd971521f4e47c10044 (diff)
downloadxmlgraphics-fop-2569a6d829991a2aebad001df2447483d44e1d9b.tar.gz
xmlgraphics-fop-2569a6d829991a2aebad001df2447483d44e1d9b.zip
List NBSP under adjustable spaces in CharUtilities.
Generate space elements in the area tree from spaces in fo:character. Clearly mark test cases which test for NBSP. Document failure to generate adjustable spaces from fo:character in a disabled test case. Adjust checks to the fact the fo:character can now also generate spaces. Enable block_white-space-collapse_2.xml again git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@392901 13f79535-47bb-0310-9956-ffa450edef68
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
}
/**