Index: LineArea.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/layout/Attic/LineArea.java,v
retrieving revision 1.53.2.20
diff -r1.53.2.20 LineArea.java
1184c1184
< 
---
>         
1188c1188,1189
<         if (currentFontState.getWordWidth(wordToHyphenate) < remainingWidth) {
---
>         int additionalWidth = 0; // add. width for hyphen char we may need to insert
>         while (wordToHyphenate.length() >0 && (additionalWidth + currentFontState.getWordWidth(wordToHyphenate)) < remainingWidth) {
1190a1192
>                            + (null == preString ? 0 : preString.length())
1192,1202c1194,1206
<             if (inwordPunctuation == '-' || inwordPunctuation == '/') {
<                 preString = new StringBuffer(wordToHyphenate);
<                 preString = preString.append(inwordPunctuation);
<                 wordToHyphenate =
<                     getHyphenationWord(characters,
<                                        wordStart + remainingString.length()
<                                        + wordToHyphenate.length() + 1);
<                 remainingWidth -=
<                     (currentFontState.getWordWidth(wordToHyphenate)
<                      + currentFontState.getCharWidth(inwordPunctuation));
<             }
---
>             if (preString == null) preString = new StringBuffer();
>             preString.append(wordToHyphenate).append(inwordPunctuation);
>             wordToHyphenate =
>                 getHyphenationWord(characters,
>                                    wordStart + remainingString.length()
>                                    + preString.length());
>             
>             additionalWidth = (inwordPunctuation == '-')
>               ? 0 : currentFontState.getCharWidth(this.hyphProps.hyphenationChar);
>             
>             remainingWidth -=
>                 (currentFontState.getWordWidth(wordToHyphenate)
>                  + currentFontState.getCharWidth(inwordPunctuation));
1204c1208
< 
---
>         
1213c1217
<             return wordStart;
---
>           return wordStart;
1216a1221,1222
>             int length = remainingString.length();
>             if (additionalWidth > 0) remainingString.append(this.hyphProps.hyphenationChar);
1218c1224
<             return wordStart + remainingString.length();
---
>             return wordStart + length;
1235c1241
<                 return wordStart + remainingString.length() - 1;
---
>                return wordStart + remainingString.length() - 1;
1237a1244,1245
>                 int length = remainingString.length();
>                 if (additionalWidth > 0) remainingString.append(this.hyphProps.hyphenationChar);
1239c1247
<                 return wordStart + remainingString.length();
---
>                return wordStart + length;

