JasperReports raises a JRFontNotFoundException in the case where the font used inside a report template is not available to the JVM as either as a system font or a font coming from a JR font extension. This ensure that all problems caused by font metrics mismatches are avoided and we have an early warning about the inconsistency.
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
or StaticText
<font fontName="Arial"/>
Yes you can disable this by setting net.sf.jasperreports.awt.ignore.missing.font to true 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).
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 fontName DejaVu Sans
, DejaVu Serif
and DejaVu Sans Mono
<font fontName="DejaVu Sans"/>
From the JasperReport Ultimate Guide:
We strongly encourage people to use only fonts derived from font extensions, because this is the only way to make sure that the fonts will be available to the application when the reports are executed at runtime. Using system fonts always brings the risk for the reports not to work properly when deployed on a new machine that might not have those fonts installed
Links on StackOverflow on how to render fonts correctly in pdf
Checklist on how to render font correctly in pdf