Jasper ireport 3.7.6字体样式不以PDF格式呈现 [英] Jasper ireport 3.7.6 font style not rendering in PDF

查看:141
本文介绍了Jasper ireport 3.7.6字体样式不以PDF格式呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ireport 3.7.6并尝试为不同的文本元素使用不同的字体。我对字体样式进行了必要的更改,并在我进行预览时显示,但是java应用程序生成的PDF只获取默认字体。我检查了XML,它有 fontName =Times New Roman。请帮帮我。

I am using ireport 3.7.6 and trying to use different fonts for the different text elements. I made the necessary changes to the font style and is showing up when I do the preview but, the PDF produced by the java application only gets the default font. i checked the XML and it has the fontName="Times New Roman" . Please help me with this.

推荐答案

在最新版本的jasper报告中,通过字体扩展名

In the latest version of jasper report 5,6 different fonts are included through font extensions.

您需要一个。 ttf你想要显示的字体版本(Times new roman可以在windows / font中找到)。

You need a .ttf version of the font you like to display (Times new roman can be found in windows / font).

包含字体的最简单方法是通过 ireport-designer Jaspersoft Studio

The easiest way to include a font is through ireport-designer or Jaspersoft Studio


  1. 获取所需的ttf字体。

  2. 在ireport或studio中安装字体

  3. 导出字体扩展名(这会创建一个.jar)

  4. 将jar添加到你的类路径。

  1. Obtain desired ttf font.
  2. Install the font in ireport or studio
  3. Export the font extension (this creates a .jar)
  4. Add the jar to your classpath.

这是这一步的链接 iReport 以及 Jaspersoft Studio

This is a link for these step iReport and this in Jaspersoft Studio

这篇关于Jasper ireport 3.7.6字体样式不以PDF格式呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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