首页 > Windows开发 > 详细

iReport在操作系统没相关“字符集”时的处理方法,比如Windows英文版下,fonts中就没有“宋体”

时间:2015-03-31 10:53:00      阅读:679      评论:0      收藏:0      [点我收藏+]

运行时报错:

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '宋体' is not available to the JVM. See the Javadoc for more details.

解决方案:

在项目中的classpath目录下

1.添加你在需要的字体集(如:在windows的fonts下找到你要的字符集或者下载)simsun.ttc(宋体)到classpath目录;

2.添加配置文件jasperreports.properties,并内容为“

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

”,也是放在classpath目录下;

PS:我只是放在classpath目录,至于要放到其它地方的话,没试过!估计这只是建议放到默认位置就可以了吧。

iReport在操作系统没相关“字符集”时的处理方法,比如Windows英文版下,fonts中就没有“宋体”

原文:http://blog.csdn.net/u013474104/article/details/44774739

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!