Page 1 of 1

Jasper and custom fonts

PostPosted: Mon Jul 01, 2019 6:22 pm
by steve1376656734
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

Re: Jasper and custom fonts

PostPosted: Mon Jul 01, 2019 10:33 pm
by lwjwillemsen
+1 for documentation on how to...

Re: Jasper and custom fonts

PostPosted: Tue Jul 02, 2019 11:13 am
by tgs
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?

Re: Jasper and custom fonts

PostPosted: Tue Jul 02, 2019 1:15 pm
by robert.edelmann
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.

Re: Jasper and custom fonts

PostPosted: Tue Jul 02, 2019 8:12 pm
by steve1376656734
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

Re: Jasper and custom fonts

PostPosted: Tue Aug 06, 2019 11:46 am
by marco.rossi
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

Re: Jasper and custom fonts

PostPosted: Tue Aug 06, 2019 2:12 pm
by steve1376656734
Thanks Marco - will try that now