Jaspersoft Fonts for embedding in PDF

Document ID : KB000009981
Last Modified Date : 14/02/2018
Show Technical Document Details

Adding TTF Fonts to Jaspersoft Studio and Jasper Report Server


Adding TTF Fonts to Jaspersoft Studio and Jasper Report Server


Jaspoersoft 6.2CA PPM 14.3, 14.4, 15.1 On PREM

Steps to to add  TTF, fonts either to Jaspersoft Studio and to Jasper Reports Server.

The correct form of Jar with the fonts.

  1. jasperreports_extension.properties - where is declared the factory for loading the fonts and the location of the font mapping xml within the jar.

  2. fonts.xml - the font mapping xml 

  3. The font files themselves in one of the accepted formats, being TTF

The jar structure should be somewhat like this, considering that the "path" can be any java valid path:

fonts-extension.jar    /jasperreports_extension.properties    /path/fonts.xml    /path/font/*.TTF (or any of the above file types)

the Jaspersoft Studio considers "net.sf.jasperreports.extension.registry.factory.fonts" and the JasperReports Server considers the "net.sf.jasperreports.extension.registry.factory.simple.font.families"

Here is an example of the font.xml for adding source sans pro font:

<?xml version="1.0" encoding="UTF-8"?><fontFamilies>    <fontFamily name="Source Sans Pro">        <normal>path/font/SourceSansPro-Regular.ttf</normal>        <bold>path/font/SourceSansPro-Bold.ttf</bold>        <italic>path/font/SourceSansPro-Italic.ttf</italic>        <boldItalic>path/font/SourceSansPro-BoldItalic.ttf</boldItalic>        <pdfEncoding>Identity-H</pdfEncoding>        <pdfEmbedded>true</pdfEmbedded>    </fontFamily></fontFamilies>
Now add this jar to your project build path. Jaspersoft Studio will not assume the font, but if you type the font name (the one declared for the font family in the fonts.xml, in this case "Source Sans Pro") and press enter you will see the font. If you cannot see the font, check your jar structure, because if any of the declared fonts cannot be found, Jasper Studio will not load the jar and will not complain either.
Additional Information:

For using the font on the JasperReports Server, just deploy the fonts jar to

  • jasperreports-server-6.2.0\apache-tomcat\webapps\jasperserver-pro\WEB-INF\lib

Or, alternatively, to the

  • jasperreports-server-6.2.0\apache-tomcat\lib

The last, will make the jar file available to all deployed apps.