iReport exported pdf does not show correct font

后端 未结 3 1251
野性不改
野性不改 2021-02-11 00:43

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条回答
  •  孤独总比滥情好
    2021-02-11 01:04

    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.    isPdfEmbedded="true"
    3.    pdfEncoding="Identity-H" ... />

提交回复
热议问题