iReport exported pdf does not show correct font

2019-03-22 04:31发布

A PDF generated in iReport using the 'Times New Roman' font appears to be using 'Arial' for its print version.

Any idea what the problem is?

3条回答
Lonely孤独者°
2楼-- · 2019-03-22 04:58

I've found that, at least for me, I must explicitly set the pdfEncoding attribute, as well as pdfFontName and isPdfEmbedded, on each font tag in the xml, even when using the system encoding, and that "Identity-H" seems to be needed when using unicode.

So:

  1. Make sure your ttf font files are available on the classpath
  2. <font ... pdfFontName="filename.ttf"
  3.    isPdfEmbedded="true"
  4.    pdfEncoding="Identity-H" ... />
查看更多
淡お忘
3楼-- · 2019-03-22 05:04

have you set the PDF Font Property to Times New Roman as well, or just the Font property?

查看更多
男人必须洒脱
4楼-- · 2019-03-22 05:08

Have you tried adding your system fonts directory to the classpath?

查看更多
登录 后发表回答