Requirement:
To embed and export different foreign languages' fonts (like Hindi, Japanese, Korean, Russian, and Thai) in PDF format.
Solution:
Sometimes it may happen when using special fonts that the PDF export of those reports may seem incorrect with the special fonts exported in PDF format as ?s, boxes, or just blank. There can be some problems with fonts in PDF exporter. The PDF format has its own set of fonts and, if a document needs to use other fonts, they must be embedded inside the PDF.
To address this issue, we need to apply font extension. With font extension, we can check the option 'Embed this font in PDF document' to make sure the font will be included into generated PDF document and the content will be displayed properly. Refer below Wiki article to know about font extensions and how to use them with report exports:
https://community.jaspersoft.com/wiki/custom-font-font-extension
Font extensions required for each of the foreign languages' font can be downloaded from the internet, or may be supplied by the client or other teams, etc. For convenience, font extensions for languages - Hindi, Japanese, Korean, Russian, and Thai can be found in the attachments section of this article. A user may download/use a separate .ttf font extension file as per their requirements if a particular font extension attached doesn't seem to work for them.
Using multiple foreign languages' fonts in one report under one column itself:
Further, if your requirement is to use multiple foreign languages' fonts in one report under one column itself, we can use font set to combine multiple font extensions and achieve our requirement to embed and export different foreign languages' fonts in one PDF export.
Font set is a combination (set) of different font extensions and is useful when we are required to use different fonts under one detail field, for example. Once a font set is created, we can use this font set's font name for the field value having multiple foreign languages' fonts data while designing the reports in Studio. The report exported to PDF then should output correctly and display all the fonts.
To create a font set in Studio, simply ctrl-select all the required font extensions under Window > Preferences > Fonts section in Studio and click on 'Create Set' button.
A sample .jrxml report (i18ntesting (1).jrxml) using different foreign languages' fonts in one report under one column and its PDF output (i18testing_Final.pdf) can also be found in the attachments section of this article for reference.
Log in or register to post comments