JVM 无法使用字体“Arial"

编程入门 行业动态 更新时间:2024-10-28 04:21:05
本文介绍了JVM 无法使用字体“Arial"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个使用 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.

en.wikipedia/wiki/Arial 表示已安装在 MS-Windows 和 MAC OSX 上

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

更多推荐

JVM 无法使用字体“Arial"

本文发布于:2023-07-26 18:18:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1217743.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   JVM   quot   Arial

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!