Jasper在Linux和Windows上是否有通用的字体格式来生成pdf? [英] Is there a common font format for Jasper on linux and windows to produce pdf?

查看:453
本文介绍了Jasper在Linux和Windows上是否有通用的字体格式来生成pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作碧玉报告来制作PDF文件。

当我运行在linux操作系统机器上生成PDF的程序时,我遇到字体格式异常的问题。我已经使用Times新的罗马字体格式的Jasper文件和Linux操作系统不支持Times新的罗马,任何人都可以建议我常见的字体格式为Linux和Windows操作系统创建Jasper文件。

逻辑字体系列:


  • 对话框

  • DialogInput

  • 等宽字体

  • Serif

  • SansSerif



这意味着这些字体在Java运行时总是可用的,但它们不是实际的字体库,而是由java映射到系统上安装的某种字体。因此,使用这些字体中的任何一个都不会导致Java中的任何错误。



然而,您正在导出到pdf,而不是所谓的标准类型1的字体,你可以看到有没有匹配和iText(lib创建PDF)将使用,如果没有定义默认字体Helvetica。



结论逻辑字体,这不会抛出错误,这可能导致报告不一致在PDF(使用另一种字体)。



解决方案jasper-reports中的是使用 font-extensions


I am working on jasper reports to produce PDF file.

I have problem that is Font format exception when I run program which generates PDF on linux OS machine. I have used Times new roman font format for jasper file and linux OS does not support Times new roman, can anyone suggest me common font format for linux and windows OS to create jasper file .

解决方案

Java defines the following five logical font families:

  • Dialog
  • DialogInput
  • Monospaced
  • Serif
  • SansSerif

This means that these fonts are always available in java runtime, however they are not actual font libraries but mapped by java to some font installed on system. Hence using any of these font will not cause any error in java.

However, you are exporting to pdf that instead have what is called Standard Type 1 fonts as you can see there is no match and iText (the lib creating the pdf) will use if not defined the default font Helvetica.

The conclusion is that while using a logical font, which would not throw an errors this could lead to report inconsistency in pdf (using another font).

The solution in jasper-reports is to use font-extensions

这篇关于Jasper在Linux和Windows上是否有通用的字体格式来生成pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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