带有 Jasper Reports 的 JVM 无法使用字体 [英] Font is not available to the JVM with Jasper Reports
问题描述
我正在尝试使用 DynamicJasper 生成报告,但出现以下错误:
I'm trying to generate report with DynamicJasper, but I'm getting the following error:
net.sf.jasperreports.engine.util.JRFontNotFoundException:
Font 'Arial' is not available to the JVM.
msttcorefonts 已安装,但我猜JVM没有使用任何字体它.
msttcorefonts is installed, but I guess the JVM is not using any fonts from it.
我使用的是 Ubuntu 10.04.
I'm using Ubuntu 10.04.
我该如何解决这个问题?
How can I fix this?
推荐答案
我尝试安装 mscorefonts,但软件包已安装并且是最新的.
I tried installing mscorefonts, but the package was installed and up-to-date.
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
我尝试在文件系统中搜索字体:
I tried searching for the font in the filesystem, with:
ls /usr/share/fonts/truetype/msttcorefonts/
此文件夹中只有自述文件,其中包含有关如何安装的正确说明.
This folder just had the README, with the correct instructions on how to install.
cat /usr/share/fonts/truetype/msttcorefonts/README
您需要互联网连接:
sudo apt-get install --reinstall ttf-mscorefonts-installer
我重新安装了ttf-mscorefonts-installer
(如上图,一定要接受EULA!),问题就解决了.
I re-installed ttf-mscorefonts-installer
(as shown above, making sure to accept the EULA!) and the problem was solved.
这篇关于带有 Jasper Reports 的 JVM 无法使用字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!