if ((currentPosition.getY() + fm.getHeight()) >= (renderArea.getY() + renderArea.getHeight()))
break;
textLine = new TextLine();
textLines.add(textLine);
}
TSpan tspan = new TSpan(currentPosition.getX(),
currentPosition.getY() + Math.abs(rect.getY()),
rect.getWidth(),
rect.getHeight(),
fontFamily, fontSize, value);
currentPosition.setLocation(currentPosition.getX() + rect.getWidth() + minPadding,
currentPosition.getY());
textLine.getTspans().add(tspan);
text.getTspans().add(tspan);
}
for (TextLine line : textLines) {
if (line.getTspans().size() > 1) {
TSpan span = line.getTspans().get(line.getTspans().size() - 1);
double additionalXPadding = ((renderArea.getX() + renderArea.getWidth()) - (span.getX() + span.getWidth())) / (double) (line.getTspans().size());
for (int i = 0; i < line.getTspans().size(); i++) {
TSpan tSpan = line.getTspans().get(i);
if (i != 0) {
tSpan.setX(tSpan.getX() + ((i + 1) * additionalXPadding));
}
}
}
}
// remove single entry text line