java JasperReports默认字体
我有一个JasperReport模板(在服务器上生成),带有一个样式化的文本字段(RTF)。此字段的内容由用户生成,因此它可以包含客户端PC上安装的所有字体(称为字体X)。如果我现在在服务器上生成报告,则没有字体X,因此我希望将所有未知字体替换为字体Y
但是我得到的只是一个错误,没有找到字体。通常不需要关闭字体检查的功能(net.sf.jasperreports.awt.ignore.missing.font),因为我希望检查jrxml的字体
有没有办法设置默认字体(无需修改Jasper源代码)?(我已经在JRTyledText或JRTextUtil上找到了一些要点。)
# 1 楼答案
您可以尝试使用
net.sf.jasperreports.default.font.name
属性或者您可以使用
default style
有关更多详细信息,您可以阅读此article,
Default Fonts and Inheritance
部分更新:
JasperReports Ultimate Guide的引用