[#12526] - Wide characters issue with isStretchWithOverflow option (Chinese, Japanese output)

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

When we want dynamic height in PDF and we are using the option isStretchWithOverflow - it works well with Latin and Cyrillic characters but it fails and trims 1 line or more with Chinese and Japanese hieroglyphs.

After diving deeper into the issue, it appears that the content is trimmed and the height is not calculated properly for all wide characters. For example, it is reproducible with "%" sign as well. It has been tried on about 15 different ttf fonts.

When the width of the particular glyph is more then its height - the problem occurs.

Please see the picture attached. The font, used on the screenshot is "NotoSansCJKTCRegular".

In order to reproduce the issue you need to add the amount of symbols worth at least 2 lines of text and 1 additional symbol. In that case, the height will not increase appropriately and that additional symbol will not be displayed. If you add more lines it may cut off up to 4 lines of text with hieroglyphs. The effect is cumulative.

jrxml code:
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="normalText" positionType="Float" x="0" y="16" width="462" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" uuid="250c0050-c5a5-47be-b839-515951fa9cec" />
<box bottomPadding="20" />
<textFieldExpression><![CDATA[$F{RC_DESCRIPTION}]]></textFieldExpression>
</textField>

AttachmentSize
Image icon font-jasper-glitch.png88.43 KB
v6.11
jasper library
aleks_ja's picture
Joined: Jan 22 2020 - 2:41am
Last seen: 3 years 4 months ago
Feedback
randomness