问题描述
在将 Jasper 升级到最新版本后,它找不到一种字体:Symbol.其余的字体似乎没问题.我在运行 jasper 的同一目录中有一堆 ttfs,该程序只是一个生成 PDF 的小包装器,它抛出了这个错误:
After upgrading Jasper to the last version, it stopped finding one font: Symbol. The rest of the fonts seem to be fine. I have a bunch of ttfs in the same directory as where jasper is run, the program is just a small wrapper to generate PDFs, and it's throwing 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>
程序运行的目录:
# ls *.ttf
arial.ttf arialbd.ttf lsans.ttf lsansd.ttf lsansi.ttf symbol.ttf
找到所有其他字体.哦,在我的笔记本电脑 (macosx) 中,它运行良好,它只会在服务器 (Debian) 上中断.我打开了symbol.ttf,它在Mac OS X 上打开得很好(以防万一文件损坏).
All other fonts are found. Oh, in my laptop (macosx), it works fine, it only breaks on the server (Debian). I opened symbol.ttf and it opened fine on Mac OS X (just in case the file was corrupt).
有什么想法可能会发生什么吗?
Any ideas what may be going on?
推荐答案
尝试添加行
net.sf.jasperreports.awt.ignore.missing.font=true
到您的 jasperreports.properties 文件.
这篇关于Jasper 停止寻找一种字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!