FONTS – Change the font when the report is exported to PDF

I am using Jaspersoft Studio 5.2, I used Courier New font for the report, and when I exported it to PDF, it changed the font to Arial.

I only use the Studio tool. It is ok when I preview the report, but it will happen when I export it.

How to export my report using Courier New font?

The textField model I used in the report:




< font fontName="Courier New" size="8"/>

< br />

You should use the Font Extensions mechanism.

Steps

Create a font in Jaspersoft Studio

You should use Window to create a new font -> Preference dialog:

Use “Font Family ”Dialog box, you can set the ttf file for the font:

Create report style

You should create a new style with the help of the context menu:

After that, you can set the font of this style:

After that, you can use this new style:

Example

jrxml file: