net.sf.jasperreports.engine.JRRuntimeException: Could not load the following fon

xiakexiaoyaoyouangel 2009-11-12 04:36:26
大家好!我是java新手,请大家帮下忙.
我在 ireport2.5+Jasperreport+iText2.5整合报表时,通过TTF类型文件设置报表字体,出现下列异常
环境:Windows Xp
1)SIMFANG.TTF字体文件:分别位于classpath、lib、报表.jrxml同级目录、ExJRPdfExporter类同级目录.
2)报表.jrxml文件字体:
<font fontName="仿宋体" pdfFontName="SIMFANG.TTF" size="18" isBold="true" isPdfEmbedded ="true" pdfEncoding ="Identity-H"/>

问题:报 net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :
pdfFontName : SIMFANG.TTF
pdfEncoding : Identity-H
isPdfEmbedded : true
at com.guoantec.core.print.ExJRPdfExporter.getFont(ExJRPdfExporter.java:1687)
at com.guoantec.core.print.ExJRPdfExporter.getChunk(ExJRPdfExporter.java:1595)
at com.guoantec.core.print.ExJRPdfExporter.getPhrase(ExJRPdfExporter.java:1578)
at com.guoantec.core.print.ExJRPdfExporter.exportText(ExJRPdfExporter.java:1904)
at com.guoantec.core.print.ExJRPdfExporter.exportElements(ExJRPdfExporter.java:626)
异常?
SIMFANG.TTF的绝对路径,相对路径我都尝试过!任得不到解决?还请各位高人指点?

<font fontName="仿宋体" pdfFontName="STSong-Light" size="18" isBold="true" isPdfEmbedded ="true" pdfEncoding ="UniGB-UCS2-H"/>
方案是可行,我测试时存在很大的缺陷,
1)单元格字满不会自动换行,
2)前一个单元格字填充满后会与后一个单元格字重叠
3)字母和与数字间存在很大间隙
不知道是我配置或包有问题还什么原因,还请高人明示!
...全文
2038 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧