[#11976] - Text not fully rendered on text field with Stretch With Overflow

Category:
Bug report
Priority:
Urgent
Status:
Confirmed
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

I have a jasper report with text field. On text field Stretch With Overflow is checked. For most examples, text is rendered correctly, but for:
"Zgodnie z art. 109 ust. 3a-3e ustawy z dnia 22 lipca 2010 r. (Dz. U. z 2010 r. nr 151, poz. 1013) niniejszym oświadczamy, iż posiadamy kopię dokumentu potwierdzającego zapłatę podatku akcyzowego na terytorium kraju od samochodu osobowego wykazanego w niniejszej fakturze."
last word is missed on PDF created by Jasper Studio in Preview section and Jasper Studio on Java App. I tried to use properties like 'net.sf.jasperreports.export.pdf.force.linebreak.policy' but no change.
I also tried to debug on Java app and I found that in the class TextMeasurer, method renderParagraph() counts 2 lines for that text. This report uses font Lato, which is registered in both Java App (Font Extensions) and Jasper Studio (Window -> Preferences -> Jaspersoft Studio -> Fonts).
I attached simple version of template containing only text field filled with problematic text.

Best regards,
Adam

AttachmentSize
Binary Data test.jrxml2.43 KB
v6.7.0
TextField
a.brych's picture
Joined: Jul 10 2019 - 1:41am
Last seen: 1 week 3 hours ago

3 Comments:

#1

Moved to JasperReports.

#2
  • Status:New» Confirmed
#3

The problem occurs because the text fits on two lines when measured via AWT with no affine transform. But when rendering the text using for instance a 220/72 affine transform, the last word of the second line no longer fits within 550 pixels. This is somewhat unusual and unexpected from the point of view of the library.

As a note, with Oracle Java 11 and 12 the problem is no longer present, the text is consistently measured to fit on three lines.

We'll need to spend more time investigating this to determine if there's something that we can do about it.

Regards,
Lucian

Feedback