iReport exported pdf does not show correct font

喜欢而已 提交于 2020-01-01 03:36:10

问题


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?


回答1:


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" ... />



回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/1978865/ireport-exported-pdf-does-not-show-correct-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!