iReport在操作系统没有相关“字符集”时的处理方法,比如Windows英文版下,fonts中就没有“宋体”
iReport在操作系统没相关“字符集”时的处理方法,比如Windows英文版下,fonts中就没有“宋体”
解决方案:
运行时报错:
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目录,至于要放到其它地方的话,没试过!估计这只是建议放到默认位置就可以了吧。