aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/util
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-05-21 07:32:46 +0000
committerJeremias Maerki <jeremias@apache.org>2007-05-21 07:32:46 +0000
commit2b5c710ccf7e9e32900b8dc5914339fcdba5a978 (patch)
tree654b120216f51a1027f785494441b665fdd53532 /src/java/org/apache/fop/util
parentc432f41561bb6dc966b7e918b127a412a2da8acc (diff)
downloadxmlgraphics-fop-2b5c710ccf7e9e32900b8dc5914339fcdba5a978.tar.gz
xmlgraphics-fop-2b5c710ccf7e9e32900b8dc5914339fcdba5a978.zip
Bugzilla #42109:
Fixed the rendering of zero-width spaces for certain fonts by not generating them into the area tree. Submitted by: Paul Vinkenoog <paul.at.vinkenoog.nl> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@540049 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/util')
-rw-r--r--src/java/org/apache/fop/util/CharUtilities.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index dc2d987f3..1aad75ad7 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -64,8 +64,8 @@ public class CharUtilities {
public static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF';
/** soft hyphen */
public static final char SOFT_HYPHEN = '\u00AD';
-
-
+
+
/**
* Utility class: Constructor prevents instantiating when subclassed.
*/
@@ -98,7 +98,17 @@ public class CharUtilities {
public static boolean isBreakableSpace(char c) {
return (c == SPACE || isFixedWidthSpace(c));
}
-
+
+ /**
+ * Method to determine if the character is a zero-width space.
+ * @param c the character to check
+ * @return true if the character is a zero-width space
+ */
+ public static boolean isZeroWidthSpace(char c) {
+ return c == ZERO_WIDTH_SPACE // 200Bh
+ || c == ZERO_WIDTH_NOBREAK_SPACE; // FEFFh (also used as BOM)
+ }
+
/**
* Method to determine if the character is a (breakable) fixed-width space.
* @param c the character to check
@@ -111,7 +121,7 @@ public class CharUtilities {
// c == '\u2002' // en space
// c == '\u2003' // em space
// c == '\u2004' // three-per-em space
-// c == '\u2005' // four--per-em space
+// c == '\u2005' // four-per-em space
// c == '\u2006' // six-per-em space
// c == '\u2007' // figure space
// c == '\u2008' // punctuation space
@@ -120,7 +130,7 @@ public class CharUtilities {
// c == '\u200B' // zero width space
// c == '\u3000' // ideographic space
}
-
+
/**
* Method to determine if the character is a nonbreaking
* space.