Adding fonts for embedding in PDF

Table of Contents 

It's Easy

It is pretty easy to add fonts either to TIBCO Jaspersoft® Studio IDE and to TIBCO JasperReports® Server.

All you need is the correct form of jar with the fonts. This jar has mainly 3 fundamental concepts:

  1. - 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. And lastly, the font files themselfes in one of the accepted formats, being TTF, EOT, SVG or WOFF.

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

    /path/font/*.TTF (or any of the above file types)

Pay attention for the property declared for containing the factory since 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", at least for the 6.2 versions.

This can be a source of problems.

Do not configure the font by adding through the Jaspersoft Studio preferences - this will render a few different errors.

Here is an example that will work in both applications by declaring both properties:


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

<?xml version="1.0" encoding="UTF-8"?>
    <fontFamily name="Source Sans Pro">

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.

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.

If you are deploying to a different Application Server, like JBOSS or WAS, consider the appropriate documentation.

For deeper knowledge take a look at jasperreports-fonts-6.0.0.jar located in:

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

and refer to the TIBCO Jaspersoft documentation and community.


linux cent it work