

#JASPER FONT PLUS#
Learn how we are “A Citizen Wherever We Serve” plus tips to prevent fraud and stay safe around water or electricity. Georgia Power is committed to the communities where we live and work. We promote education, safety and helping others.

I did that just by adding isBold flag and setting it true in the font element. It didn’t require me to use any complex science. Second staticText displays Calibri – Bold using the bold calibri font. That is because I have used the following font element configuration. The first staticText element displays normal (or regular) calibri font. If you have a look at the xml (or jrxml) template, you will see that I have used tag in each of the staticText elements. Here is what my jasperReport.jrxml looks like. Each static text element will be using each of our four font types. In my jasperReport.jrxml template, I have added four static text elements. JRXML at the following directory path with the name jasperReport.jrxml. Since we are done with the fonts configuration, its time to use the fonts in our JasperReport XML or JRXML Template. Net.sf.families.myfontfamily=fonts/fonts.xml 4. src / main / resources /Īfter creating your file, open it and add the following properties in your jasperreports_extension.properties file: net.sf.fonts=net.sf. In order to allow your Jasper Reports library to read fonts families, you need to to create a properties file named jasperreports_extension.properties in the resources directory. This is a final step of configuring fonts. Here we are done with configuring font pack to be used in our JasperReports. As per the configuration xml, I have added following our font files in the calibri directory. Right where the fonts.xml file is located, create a another directory named calibri and add your font files (.ttf) in the directory. This is a configuration file for the fonts. In the fonts directory, create a file named fonts.xml. You can name this folder anything, but to be specific about it’s usage, I named it fonts. Once done with adding the dependency, create a directory named fonts in your resources directory. This dependency will allow you to configure custom fonts for your reports. With the help of this dependency we will be able to create our JasperReport. The following dependency is an important one, that will add the JasperReport library in our Java project. Let’s start by adding following two maven dependencies to our pom.xml file You can use use any font of your choice just by replacing the font files and configuring it on your own, following this tutorial. Note that I am using Calibri font and its four versions. Uh, no thanks!Īfter being stuck for 3 days and nights, I was able to find a solution to this problem.

Many of the solutions asked me to create a jar package and then add it as a library in my java project.

Sadly the JasperReport community wasn’t too helpful as I couldn’t find an easier solution to my problem. I had to add custom fonts to jasper report in a Java project. Sometimes its quite easy to find a library or a solution and implement it just by following a couple of steps.
