Skip to content

How to Change Fonts in Etendo Reports

IMPORTANT: THIS IS A BETA VERSION

It is under active development and may contain unstable or incomplete features. Use it at your own risk.

Overview

This section explains how to change the fonts used in Etendo reports. Updating the default fonts can be useful in two main scenarios: enhancing the visual appearance of the reports with more readable or brand-aligned typography, or ensuring proper display of languages whose characters are not supported by the standard font set, such as Japanese, Arabic, or Vietnamese. Replacing the default fonts with ones that support the required character sets allows the reports to render correctly across different languages.

Info

For more information visit, How to Create a Module and How to Create a Report.

Etendo uses Jasper Reports tool to create reports:

Changing the font in Jasper Reports

When changing the font in Jasper Reports the software Jaspersoft Studio will be very helpful.

In the above link, find a detailed tutorial that describes how to handle custom fonts in Jaspersoft Studio. In short, these are the steps to carry out:

  1. Get the desired font's .ttf file from the pc or from the Internet.
  2. Create the Font Extension, go to Preferences window.

  3. Click on JasperSoft Studio > Fonts. Click Add . At this point provide a unique name for the Font Extension and the path to its extension by selecting the path of the downloaded .ttf file.

  4. Once done, set a PDF Encoding type for the new font in the wizard.
  5. Change the fontName and pdfFontName used in the text fields wanted to have being displayed with the new font in our report. Accomplish that by either using Jaspersoft Studio or making changes directly in the .jrxml file using a text editor.
  6. And, for the document(s), do not forget to to choose the same PDF Encoding type as the one set for the font in step 4.
  7. Export the font into a .jar file. Once again, Jaspersoft Studio can lend us a hand with doing this: Go to JasperSoft Studio > Fonts and this time click Export . Select the font and export it into a .jar file.
  8. Create a new module to keep the .jar file. Inside the module folder, create a subfolder /lib/runtime and put the exported .jar file in there.

  9. Stop tomcat.

  10. Execute ./gradlew smartbuild
  11. Restart tomcat.

Result

The following screenshots show the results after successfully carrying out the steps mentioned above:

Jasper Report where the font of the title has been replaced with another font:


This work is a derivative of How to Change Fonts in Openbravo Reports by Openbravo Wiki, used under CC BY-SA 2.5 ES. This work is licensed under CC BY-SA 2.5 by Etendo.