Multi Language Fonts in a Report


I'm trying to support as many languages as possible in my reports (we have clients worldwide) and, while fonts are being displayed correctly on my html, docx, xls, csv etc exports, the pdf output just shows blank characters where the font doesn't support the characters (particularly Chinese). I can get it to display Chinese characters if, for example, I import the Arial Unicode MS font but there's no bold, italic or bold-italic variations of that font so I can't use that. I've tried using the Google Noto fonts which would solve my problem but I can't figure out how to make the pdf exporter choose from multiple fonts to select the right character. Is there any capability within Jaspersoft Studio to do this? What I'm talking about is similar to the CSS font-family tag - i.e:

    font-family: "Times New Roman", Georgia, Serif;

I was reading about font locales but I want to have the capability of displaying multiple languages in a single report - not choosing the font to serve based on the user's location. (e.g. one of our clients uses Latin and Chinese characters in the same labels).

Is there something simple that I'm missing? Is there a way to simulate the bold, italic and bold-italic fonts with Arial Unicode MS similar to how you would do it in Word?

jasperUser12's picture
Joined: May 23 2014 - 4:52pm
Last seen: 6 years 10 months ago

1 Answer:

2. add this jar in 2 places - 
a) webapps-jasperserver-WEBINF-lib (add here) 
b) in Ireport u need to add in classpath. (tools-options-classpath)
3.set font name as "Arial Unicode MS" and keep same property set in ur xml 
<font fontName="Arial Unicode MS" size="12" isBold="true" pdfFontName="Arial Unicode MS" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
4. restart ur jasperserver.
5. restart ur ireport.
jaspersoft123's picture
Joined: Sep 24 2014 - 12:15am
Last seen: 4 years 5 months ago