字体“Arial”不可用于JVM [英] Font 'Arial' is not available to the JVM

查看:959
本文介绍了字体“Arial”不可用于JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Jasperreports的Java项目。我在其他项目中使用相同的技术多次工作,在尝试在Unix环境中打印报告时遇到了同样的问题。

I'm working on a Java project that uses Jasperreports. I worked several times in other projects using the same technology, and i had the same problem when trying to print a report in Unix environments.

我的项目使用:


  • JBoss 4.2.3.GA

  • Java 1.6

  • Jasperreports 4.7.0

抛出的异常是:

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Arial' is not available to the JVM. See the Javadoc for more details.

我找到了一个解决这个问题的常用解决方案,并且确实有效:

I found a common solution to solve this issue and ir really works:

sudo apt-get install msttcorefonts



<但是,我想了解Jasper如何使用字体,以及如何搜索Unix环境中安装的字体。也许更好的问题是:JVM如何处理原生字体?谁能给我一个关于这个主题的详细解释?如何在运行时为JVM提供系统字体?

However, I want to understand how Jasper works with fonts, and how it searches this fonts installed in Unix environments. Maybe a better question is: how JVM handles native fonts? Can anyone give me a detailed explanation on this subject? How are system fonts made available for the JVM in runtime?

推荐答案

Java要求操作系统提供字体。工作原理取决于操作系统。

Java asks the OS to provide the fonts. How that works depends on the OS.

http://en.wikipedia.org / wiki / Arial 声明它安装在MS-Windows和MAC OSX上

http://en.wikipedia.org/wiki/Arial states its is installed on MS-Windows and MAC OSX

这篇关于字体“Arial”不可用于JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆