Browse Source

Corrected word area length for leader-pattern="dots" and insert inline

space for adjustment if necessary.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196053 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_20_5rc3
Joerg Pietschmann 21 years ago
parent
commit
dc99fc4ed7
1 changed files with 12 additions and 5 deletions
  1. 12
    5
      src/org/apache/fop/layout/LineArea.java

+ 12
- 5
src/org/apache/fop/layout/LineArea.java View File

@@ -181,9 +181,9 @@ public class LineArea extends Area {
}
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 @@ public class LineArea extends Area {
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

Loading…
Cancel
Save