首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Jasper报表中动态设置字体系列?

如何在Jasper报表中动态设置字体系列?
EN

Stack Overflow用户
提问于 2015-06-23 02:28:42
回答 1查看 1.5K关注 0票数 0

我试过了

代码语言:javascript
复制
            <textElement markup="html">
                <font fontName="$P{contentFont}"/>
            </textElement>

并将Arial Unicode MS放在$P{contentFont}上,但iReport抛出:

代码语言:javascript
复制
Error filling print... Font '$P{contentFont}' is not available to the JVM. 
See the Javadoc for more details. 
    net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '$P{contentFont}' 
    is not available to the JVM. See the Javadoc for more details.      

在net.sf.jasperreports.engine.fonts.FontUtil.checkAwtFont(FontUtil.java:347)上,

所以我猜没有办法在运行时预定义字体系列?有什么办法可以解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2015-06-29 20:18:46

有一个特性可以实现你想要的东西,

查看Jasper Report Style Templates

Jasper报表有font extensions,它支持一些字体,包括,

代码语言:javascript
复制
DejaVu Sans
DejaVu Serif
DejaVu Sans Mono

如果你想使用Jasper Font Extesnions以外的字体,可以看看here

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30987230

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档