I have a simple question but I fear there is no simple answer. I just want to set the font for a text field dynamically.
The content of the text field comes from the database and can include everthing. (Chinese or other characters or unicode).
I would like set the font name of the text field in a scriptlet methode. But it does not work. (see http://community.jaspersoft.com/questions/538566/problems-setfontname-dy...)
I want to use the method Font.canDisplayUpTo(...) to find the right font and then set it dynamically.
I know the font extensions, the conditional styles and the styled text features, but I could not solve my problem yet.
Has anyone an idea or a similar problem ever solved?
Thanks for any hint.
We implemented something before using Conditional Styles. The condition was ReportUtils.hasChineseCharacters(<field>), where ReportUtils.hasChineseCharacters is a custom made Java function that is imported to the template. If it has, it uses the Chinese font, if it doesn't it uses the English font.
Down side is, we have to make a conditional style for each field that needs this.