Jasper stops searching for one font

After updating Jasper to the latest version, he stopped searching for one font: Symbol. The rest of the fonts seem beautiful. I have a bunch of ttfs in the same directory as when jasper started, the program is just a small shell for creating PDF files, and it throws this error:

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Symbol' is not available to the JVM. See the Javadoc for more details. at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:358) at net.sf.jasperreports.engine.util.JRStyledText.getAwtAttributedString(JRStyledText.java:226) at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:362) at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:1129) at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:183) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:269) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:127) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624) at XmlJasperInterface.report(XmlJasperInterface.java:82) at XmlJasperInterface.main(XmlJasperInterface.java:60)</pre> 

The directory in which the program runs:

 # ls *.ttf arial.ttf arialbd.ttf lsans.ttf lsansd.ttf lsansi.ttf symbol.ttf 

All other fonts found. Oh, in my laptop (macosx), it works fine, it only breaks on the server (Debian). I opened the symbol.ttf file and completely opened it on Mac OS X (just in case, the file was corrupted).

Any ideas what could happen?

+12
fonts jasper-reports
Oct 21 2018-10-21
source share
6 answers

Try adding a line

net.sf.jasperreports.awt.ignore.missing.font=true

to jasperreports.properties file.

+13
Oct 26 '10 at 21:13
source share

On ubuntu, I needed to remove the fonts and reinstall them:

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

Then it works fine.

+5
Mar 27 2018-12-23T00:
source share

Well, the font must be installed on the OS where the report is executed.

+2
Dec 13 '11 at 22:52
source share

Simple steps to solve this problem:

  • Open jasperreports-xxxjar, in my case jasperreports-3.7.2.jar.
  • Locate the default.jasperreports.properties file and open it.
  • Find the line net.sf.jasperreports.awt.ignore.missing.font = false and change the value from false to true net.sf.jasperreports.awt.ignore.missing. font = True .
  • Refresh the jar.
  • Add to the classpath of your project.

The problem is resolved.

+1
Dec 15 2018-11-11T00:
source share

2015 update:

Add this (or uncomment) /etc/apt/sources.list

 deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse 

Then run this:

 sudo apt-get update sudo apt-get install msttcorefonts 
0
Apr 26 '15 at 15:18
source share

I am using JasperReports 6.3.1. I solved the problem by adding the following line to my .jrxml :

 <property name="net.sf.jasperreports.awt.ignore.missing.font" value="true"/> 

Thus, our report will look different, depending on the fonts preinstalled in the system. In my case, this is not a problem, and I am not interested in adding an extra font to my project, since I need to be as light as possible.




If you want to use the original report fonts in all runtime environments, a simple solution is to add the necessary dependencies to the project.

Example for Maven:

 <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports-fonts</artifactId> <version>6.0.0</version> </dependency> 

You can also load libraries and add them manually to the project, however it will work.




I hope you find them useful.

0
Nov 15 '16 at 15:02
source share



All Articles