Jasper 报告字体未找到异常

Mut*_*thu 2 java fonts jasper-reports ireport

当我在Windows 和 Mac上使用 jasper 报告时,它工作正常,当我将应用程序部署到Linux 机器并尝试生成它抛出的报告时,它工作正常

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Times New Roman' is not available to the JVM. See the Javadoc for more details.
Run Code Online (Sandbox Code Playgroud)

我知道我们可以通过在 Linux 机器上安装缺少的字体来解决这个问题(http://stackoverflow.com/questions/3987804/jasper-stops-finding-one-font)。我的问题是,我们可以将字体打包为 jar 并与应用程序一起作为包提供。这个怎么做 ?

Bal*_*jan 5

您需要 Jasper 的字体扩展来实现此目的。本博客解释了实现此目的的步骤,并将其扩展为可用于 PDF 导出。