Jump to content
We've recently updated our Privacy Statement, available here ×
  • Embedding and exporting different foreign languages' fonts (like Hindi, Japanese, Korean, Russian, and Thai) in PDF format.


    Dhiraj Pahlani
    • Features: Exporters Product: Jaspersoft® Studio

    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.

    fontset.png.2c98188f451e6008a3308eac8e614666.png

    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.

     

     

    fontset.png.8f399a473e8ff5f9b3128ea96c050a13.png

    hindi.zip

    japanese.zip

    korean.zip

    russian.zip

    thai.zip

    i18ntesting_1.jrxml

    i18testing_final.pdf


    User Feedback

    Recommended Comments

    There are no comments to display.



    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...