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?
Hey Having trouble viewing documents produced on Windows?
You can try a fine solution easy:
After this I need reboot my system CentOS6.
Source: http://mscorefonts2.sourceforge.net/
Try adding the line
net.sf.jasperreports.awt.ignore.missing.font=true
to your jasperreports.properties file.
Jasper stops finding one font
For CentOS:
wget msttcorefonts
Then:
After all, restart JVM.
Jasper reports is trying to help you in your report development, stating that it can not export your report correctly since it can not find the font defined in
TextField
orStaticText
Yes you can disable this by setting net.sf.jasperreports.awt.ignore.missing.font to false but you will have export inconsistencies.
Yes you can install the font as JVM system font (but you need to do it on every PC used that may generate report and you can still have encoding problems).
The correct way!
Use Font Extensions!, if you like to create your own (see link below), jasper reports also distributes a default font-extension jar (
jasperreports-fonts-x.x.x.jar
), that supports fontNameDejaVu Sans
,DejaVu Serif
andDejaVu Sans Mono
From the JasperReport Ultimate Guide:
Links on StackOverflow on how to render fonts correctly in pdf
Checklist on how to render font correctly in pdf
Generate font-extensions with JasperSoft Studio
Generate font-extensions with iReport
Actually I fixed this issue in a very simple way
home path
, like/root
.fonts
all your font files
to.fonts
, you can copy the font fromC:\windows\fonts
if you use windows.sudo apt-get install fontconfig
fc-cache –fv
to rebuid fonts caches.