I'm currently trying to display Japanese characters in a report produced using JasperReports 5.2.0. The Japanese characters in the document are lost. When I examine the PDF properties I see that only one font exists in the document: Helvetica.
Through some research I've found that the IText library is responsible for producing the PDF export. JasperReports 5.2.0 uses itext-2.1.7.js2. This jar does not contain international character sets. Instead, this is provided separately in IText-Asian, under a different license (AGPL).
The JasperReports library tutorial (http://community.jaspersoft.com/wiki/jasperreports-library-tutorial) says:
To simplify the use of the font settings, a new element was introduced: .
Report fonts are report level font definitions that ca be used as default or base font settings in other font definitions throughout the entire report. Since the support for international characters is somehow tied to the iText library, you can find more details about how to create PDF documents in different languages and different character sets in the iText documentation.
This seems to imply that the international characters are locked behind the later versions of the IText library.
Is it possible to embed international character fonts into a PDF without upgrading to JasperReports 6.x, or IText 5.x?
Update:
I have tried to set up a simple font extension using a JasperReports_extensions.properties with the contents:
net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.test=path/to/fonts/fonts.xml
This XML file contains:
<fontFamily name="Arial Unicode MS">
<normal>path/to/fonts/testJA/ARIALUNI.TTF</normal>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
<exportFonts>
<export key="net.sf.jasperreports.html">'Arial Unicode MS', Arial, Helvetica, sans-serif</export>
<export key="net.sf.jasperreports.xhtml">'Arial Unicode MS', Arial, Helvetica, sans-serif</export>
</exportFonts>
<locales>
<locale>ja_JP</locale>
</locales>
</fontFamily>
The target directory contains the windows ARIALUNI.TTF file. (Note, not intending on using this, only using it currently for debugging).