0
votes

I am trying to create a pdf document which is internationalized, My specific requirement is to generate a pdf document which has text elements defined in "Marathi" language. I have the TTF file for the font which enables me to see the "Marathi" language, I would like to know how can I let my JRXML file know of existence of this "font" defined in the TTF file.

Where should I define the font or keep my TTF file so as I am able to use the font in the <font/> element of my JRXML file. So as the "Marathi" language text is displayed in the PDF document.

2
Depending on you version you should either use font extensions (> 3.7.2) as explained by AlexK or rely on system installed font as described by Saifuddin. Of course font extension is recommended.Olivier.Roger

2 Answers

2
votes

You can use Font Extensions mechanism.

You can read this article for more information.

The quote from JasperReports Ultimate guide:

The best way to control fonts in JasperReports is to provide the font files as extensions to the library. Basically, this involves putting True Type Font files in a JAR file, together with an XML file that describes the content of the JAR and the various relationships between the fonts and the locales.

1
votes

Just put the .ttf file in class path and specify the font name in .jrxml , Optionally Arial Uni.ttf would also work for your case