aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-11-07 05:09:51 +0000
committerGlen Mazza <gmazza@apache.org>2003-11-07 05:09:51 +0000
commit2695d9ffc228a9670365145c011c332c67188cf8 (patch)
tree02c04baafa4fdf67a6652f529156a5fdf7e3ba3c
parentf34418c2321f603df21b4a2f0b14d57cd0793734 (diff)
downloadxmlgraphics-fop-2695d9ffc228a9670365145c011c332c67188cf8.tar.gz
xmlgraphics-fop-2695d9ffc228a9670365145c011c332c67188cf8.zip
Hyphenation problem in Bug 23985 (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23985)
fixed in HEAD. (maintenance still to be done.) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196983 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/TextLayoutManager.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
index 7b36f3b3b..fec1958e1 100644
--- a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
@@ -186,9 +186,10 @@ public class TextLayoutManager extends AbstractLayoutManager {
*/
public boolean canBreakBefore(LayoutContext context) {
char c = chars[iNextStart];
- return ((c == NEWLINE)
- || (textInfo.bWrap && (CharUtilities.isBreakableSpace(c)
- || BREAK_CHARS.indexOf(c) >= 0)));
+ return ((c == NEWLINE) || (textInfo.bWrap
+ && (CharUtilities.isBreakableSpace(c)
+ || (BREAK_CHARS.indexOf(c) >= 0 && (iNextStart == 0
+ || Character.isLetterOrDigit(chars[iNextStart-1]))))));
}
/**
@@ -373,19 +374,20 @@ public class TextLayoutManager extends AbstractLayoutManager {
// Don't look for hyphenation points here though
for (; iNextStart < chars.length; iNextStart++) {
char c = chars[iNextStart];
- if ((c == NEWLINE) || // Include any breakable white-space as break char
- // even if fixed width
- (textInfo.bWrap && (CharUtilities.isBreakableSpace(c)
- || BREAK_CHARS.indexOf(c) >= 0))) {
- iFlags |= BreakPoss.CAN_BREAK_AFTER;
- if (c != SPACE) {
- iNextStart++;
- if (c != NEWLINE) {
- wordIPD += textInfo.fs.getCharWidth(c);
- } else {
- iFlags |= BreakPoss.FORCE;
- }
- }
+ // Include any breakable white-space as break char
+ if ((c == NEWLINE) || (textInfo.bWrap
+ && (CharUtilities.isBreakableSpace(c)
+ || (BREAK_CHARS.indexOf(c) >= 0 && (iNextStart == 0
+ || Character.isLetterOrDigit(chars[iNextStart-1])))))) {
+ iFlags |= BreakPoss.CAN_BREAK_AFTER;
+ if (c != SPACE) {
+ iNextStart++;
+ if (c != NEWLINE) {
+ wordIPD += textInfo.fs.getCharWidth(c);
+ } else {
+ iFlags |= BreakPoss.FORCE;
+ }
+ }
// If all remaining characters would be suppressed at
// line-end, set a flag for parent LM.
int iLastChar;