Jasper and custom fonts

Questions and answers on developing, deploying and using plugins and JavaBeans

Jasper and custom fonts

Postby steve1376656734 » Mon Jul 01, 2019 6:22 pm

Hi,

Can anyone help me figure out how to get custom fonts to work with Jasper please. I have followed the advice given on the Jaspersoft community to create a font extension jar (https://community.jaspersoft.com/wiki/custom-font-font-extension) and have included this jar file in the servoy-jaspersoft directory on the server. I have also tried following the advice given on the servoyforge Jasper plugin page (https://www.servoyforge.net/projects/se ... ease_notes) albeit this seems to be for a very old release. Nothing seems to work and I constantly get the following error message when I try to run a report with the custom font in it:

Code: Select all
java.lang.Exception: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Font Awesome 5 Pro Regular" is not available to the JVM. See the Javadoc for more details.


I'm relatively new to Jasper so would appreciate any advice on solving this one.

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 327
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: Jasper and custom fonts

Postby lwjwillemsen » Mon Jul 01, 2019 10:33 pm

+1 for documentation on how to...
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Jasper and custom fonts

Postby tgs » Tue Jul 02, 2019 11:13 am

I had the same problem with ArialMT.
The customers environment is macOS, also the Servoy App Server and ArialMT ist not part of the Fonts Library.
Since I have downloaded the ARIALMT.ttf and imported to the Fonts Library, the Jasper Reports are working without any font issue.
Are your custem fonts installed on the Servoy App Server machine?
Maybe this will help?
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: Jasper and custom fonts

Postby robert.edelmann » Tue Jul 02, 2019 1:15 pm

When using the smartclient, the font is needed on the client-machine, when generating a pdf on the server the font has to be installed on the server (and we had to restart tomcat / servoy for the font to be working).

We still have some problems with glyps (checkboxes etc) when generating pdfs and printing bold/italic.
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 91
Joined: Wed Aug 14, 2013 6:12 pm

Re: Jasper and custom fonts

Postby steve1376656734 » Tue Jul 02, 2019 8:12 pm

Hi Thomas,

tgs wrote:Since I have downloaded the ARIALMT.ttf and imported to the Fonts Library,

When you say "imported into the fonts library" what do you mean exactly? Is this a library on the server or something that is part of the Jasper stuff?

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 327
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: Jasper and custom fonts

Postby marco.rossi » Tue Aug 06, 2019 11:46 am

Hi Steve,

I had a very similar problem but with Servoy. I was using a Font not recognized by java.

I solved in this way:
- Open your Java installation folder and go into the "fonts" folder (es: C:\Program Files\Java\jdk1.8.0_202\jre\lib\fonts).
- Copy here the .ttf of your custom font.
- restart your machine.

It's not exactly your scenario but because you're facing a Java problem, maybe this could help.

In my case the problem was getting the font within Servoy but, to solve it, I had to act at Java level as described above.

Hope this help
Marco Rossi
Senior Analyst Developer
Freelance Consultant

IT Manager @Mantho
Webmaster @Sitoliquido
marco.rossi
 
Posts: 110
Joined: Sun Apr 12, 2015 9:33 pm

Re: Jasper and custom fonts

Postby steve1376656734 » Tue Aug 06, 2019 2:12 pm

Thanks Marco - will try that now
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 327
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 10 guests