pietsch 2003/03/09 03:49:56 Modified: src/org/apache/fop/layout Tag: fop-0_20_2-maintain LineArea.java Log: Corrected word area length for leader-pattern="dots" and insert inline space for adjustment if necessary. Revision Changes Path No revision No revision 1.53.2.17 +13 -6 xml-fop/src/org/apache/fop/layout/Attic/LineArea.java Index: LineArea.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Attic/LineArea.java,v retrieving revision 1.53.2.16 retrieving revision 1.53.2.17 diff -u -r1.53.2.16 -r1.53.2.17 --- LineArea.java 2 Mar 2003 16:55:15 -0000 1.53.2.16 +++ LineArea.java 9 Mar 2003 11:49:56 -0000 1.53.2.17 @@ -181,9 +181,9 @@ } void expand() { char dot = '.'; - int dotWidth = currentFontState.getCharWidth(dot); + int dotWidth = fontState.getCharWidth(dot); char space = ' '; - int spaceWidth = currentFontState.getCharWidth(space); + int spaceWidth = fontState.getCharWidth(space); int idx=children.indexOf(this); children.remove(this); switch (leaderPattern) { @@ -242,12 +242,19 @@ for (int i = 0; i < factor; i++) { leaderChars[i] = dot; } + String leaderWord = new String(leaderChars); + int leaderWordWidth = fontState.getWordWidth(leaderWord); WordArea leaderPatternArea = - new WordArea(currentFontState, red, green, blue, - new String(leaderChars), - leaderLengthOptimum); + new WordArea(fontState, red, green, blue, + leaderWord,leaderWordWidth); leaderPatternArea.setYOffset(placementOffset); children.add(idx, leaderPatternArea); + int spaceAfterLeader = leaderLengthOptimum + - leaderWordWidth; + if (spaceAfterLeader!=0) { + children.add(idx+1, new InlineSpace(spaceAfterLeader, + false)); + } } else { // if leader-alignment is used, calculate space to // insert before leader so that all dots will be
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]