将Jasper升级到最后一个版本后,它停止找到一种字体:Symbol.其余的字体似乎没问题.我在运行jasper的同一目录中有一堆ttfs,程序只是一个生成PDF的小包装器,它抛出了这个错误:
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)
程序运行的目录:
# ls *.ttf arial.ttf arialbd.ttf lsans.ttf lsansd.ttf lsansi.ttf symbol.ttf
找到所有其他字体.哦,在我的笔记本电脑(macosx)中,它工作正常,它只在服务器上断开(Debian).我打开了symbol.ttf,它在Mac OS X上打开正常(以防文件损坏).
可能会发生什么想法?
尝试添加该行
net.sf.jasperreports.awt.ignore.missing.font=true
到你的jasperreports.properties文件.
在ubuntu上我需要卸载字体并重新安装它们:
sudo apt-get remove ttf-mscorefonts-installer sudo apt-get install ttf-mscorefonts-installer
然后,它工作正常.