Jump to content

How to Instruct JasperReports to Use a Set of Fonts for a Certain Text


cutebluangel
Go to solution Solved by cutebluangel,

Recommended Posts

I'm working on a report that will display textual input from users. As the report is for Chinese users, we are not sure on whether the input will have commonly used Chinese characters or from the Ideographs Ext B. Most Chinese fonts have two different fonts to address this (e.g. MingLiu will have a MingLiu-Ext-B counterpart) and it seems that we can usually set ONE font per field. 

How can we make a field behave as if it's using CSS wherein it will prefer Font A first, then switch to Font B if it can't display a certain character (related: https://community.jaspersoft.com/questions/844026/multi-language-fonts-report)? Is this even possible?

Another related question is: https://community.jaspersoft.com/questions/823048/chinese-font-ireport

I've tested a single report with different Chinese fonts (MingLiu, MingLiu_HKSCS, Ming for ISO, Wen Quan Yi Zen Hei, etc) and behavior when output to different document types. 

Excel seems to fare the best, with each of our 7 test cases displaying save for Ming for ISO font.

For PDF, even with Font Embedding, none of the font seems to display all of our test cases. Max number of test cases displayed by a single font is 3 out of 7. 

For DOCx, it still does not show all, but have more success with 5 out of 7 test cases successful for a single font (2 ext B test cases failed). But when I try to edit the output document and set the font of the ext-2b characters to that particular font, it suddenly shows correctly. 

Link to comment
Share on other sites

  • 3 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...