Making fonts available to your JasperReports

From iDempiere en

If you only use JasperReports on the same machine and your client has access to all the fonts you're using, then this isn't necessary, but it's a good practise to make sure all your fonts are available regardless of what system fonts are installed on the machine that renders the font.

In the source code tree of idempiere-examples there's a project called

This package is an example of how you pack your fonts to have them available to the reporting engine.

The key issues are:

  • It must be a plugin.
  • Put the TTF-fonts in the source/resources path.
  • Add the following statement to the end of the MANIFEST.MF
Fragment-Host: net.sf.jasperreports.engine;bundle-version="6.3.1"

Add the plugin to the server's/client's run configuration.

One easy way to create a JAR consisting of the fonts used in JasperReports is to create an extension-jar from JasperReports.

This can be done using menu Tools -> Options -> Fonts -> Create Extension


NOTE! The created jar must be included in the plugin's classpath.

Add by hieplq when resolve issue IDEMPIERE-1865

When I use, I encounter some issue. I fixed it with ticket IDEMPIERE-1865, I want note some my know-how at here.

  • structure of plug-in

1. store font file in src folder (or sub folder)

2. make text file with name: fonts-attribute.xml head of file is

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

each font want load, add a block with id is unique value, example with font Arial

<bean id="fontBean133462384309185621" class="net.sf.jasperreports.engine.fonts.SimpleFontFamily">
       <property name="name" value="Arial"/>
       <property name="normal" value="Arial.ttf"/>
       <property name="bold" value="Arial_Bold.ttf"/>
       <property name="italic" value="Arial_Italic.ttf"/>
       <property name="boldItalic" value="Arial_Bold_Italic.ttf"/>
       <property name="pdfEmbedded" value="TRUE"/>
       <property name="pdfEncoding" value="Identity-H"/>

about mean of property please refer

Note: to suport unicode. must define property pdfEncoding and value must is "Identity-H" meaning of Identity-H please refer itext document

3. make file with exact name contain of file is:


Note value of properties net.sf.jasperreports.extension.fonts.spring.beans.resource is relative path of file in step 2.

4. update by hieplq, when build this plug-in to jar (invoke buckminster create.product action) with setup as above, run idempiere from elipse font load perfect. but when i put this plug-in to build product. font is can't load. after investigate i see it's my fault. file fonts-attribute.xml and not include in jar file.

two method to fix it.

 add files fonts-attribute.xml and to src folder, it will auto pack to jar.
 Open MANIFEST.MF, open tab build.
 at binary build, tick file fonts-attribute.xml and

5. other issue is when make report, at first time, Spring lib must connect to internet to check schema. i fix it by download file spring-beans-2.0.xsd and push it to src folder.

in file fonts-attribute.xml change ""
to "spring-beans-2.0.xsd"

See also

See also:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.