Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font is not available to the JVM with Jasper Reports

I'm trying to generate report with DynamicJasper, but I'm getting the following error:

net.sf.jasperreports.engine.util.JRFontNotFoundException:                                    Font 'Arial' is not available to the JVM.    

msttcorefonts is installed, but I guess the JVM is not using any fonts from it.

I'm using Ubuntu 10.04.

How can I fix this?

like image 282
Andrew Avatar asked Sep 28 '10 10:09

Andrew


People also ask

How do I add a font to Jasper report?

Installing a new fontClick on Tools -> Options. Click on Fonts tab and Install Font. Click on Browse to select your font path and click Next. If needed, check the option Embed this font in the PDF document.


1 Answers

I tried installing mscorefonts, but the package was installed and up-to-date.

sudo apt-get update sudo apt-get install ttf-mscorefonts-installer 

I tried searching for the font in the filesystem, with:

ls /usr/share/fonts/truetype/msttcorefonts/ 

This folder just had the README, with the correct instructions on how to install.

cat /usr/share/fonts/truetype/msttcorefonts/README 

You need an internet connection for this:

sudo apt-get install --reinstall ttf-mscorefonts-installer 

I re-installed ttf-mscorefonts-installer (as shown above, making sure to accept the EULA!) and the problem was solved.

like image 76
Braully Rocha Avatar answered Sep 17 '22 16:09

Braully Rocha