gmazza      2003/11/06 21:09:51

  Modified:    src/java/org/apache/fop/layoutmgr TextLayoutManager.java
  Log:
  Hyphenation problem in Bug 23985 
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23985)
  fixed in HEAD.  (maintenance still to be done.)
  
  Revision  Changes    Path
  1.8       +18 -16    xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
  
  Index: TextLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TextLayoutManager.java    1 Nov 2003 04:28:01 -0000       1.7
  +++ TextLayoutManager.java    7 Nov 2003 05:09:51 -0000       1.8
  @@ -186,9 +186,10 @@
        */
       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 @@
               // 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;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to