私はJavaでのJasperReportsを使用して多言語レポートを生成しています。
私は、PDFを生成する場合、いくつかの言語が正しく表示されません。
私はExcelを生成するときには、レポートが正しい言語で適切に生成されます。
インターネット上の検索私は、PDFフォントがサポートされていません発見しました。
- 追加私はそうサンセリフ能登フォント。
- カスタムジャーフォントファイルの作成JASPARスタジオを。
- クラスパスに追加しました。
ここでは、フォントに私のコードセット:
Style rowStyle = new Style();
Font font = new Font(FONT_SIZE_SMALL, "Noto Sans", false, false, false);
font.setPdfFontName("Noto Sans");
font.setPdfFontEncoding(Font.PDF_ENCODING_Identity_H_Unicode_with_horizontal_writing);
font.setPdfFontEmbedded(false);
rowStyle.setFont(font);
すべてのアイデアはどのように解決するには?
あなたはPDFをレンダリングする際に慣れされているフォントをチェックするためにログインするDEBUGのジャスパーレポートを設定しようとしたことがありますか?(以下の例のlog4jの設定)
<category name="net.sf.jasperreports">
<priority value="DEBUG" />
</category>
For example you should see DEBUG log of a font being loaded by jasper:
DEBUG SimpleFontFace:177 - Loading font fonts/ARIALUNI.TTF
And if you are using jasper font extension (described below), you should see something like:
DEBUG FontExtensionsRegistry:88 - Loading font extensions from net/sf/jasperreports/fonts/jasperreports-fonts.xml
Are you including the font in the classpath? I have successfully used a custom built jar similar to what is described in this post in the docs: https://community.jaspersoft.com/wiki/adding-fonts-embedding-pdf
I would also try setPdfFontEmbedded(true). In the generated PDF you can determine if the font is included in the report if you open the PDF in Adobe Acrobat Reader, and see if it is listed under File -> Properties... -> Fonts tab (see screenshot). It should have (Embedded) or (Embedded subset) next to the font name.
Edit
上記の手順は、このようなデバッグの問題を助けることができます。それは「能登のSans」フォントがけれども「はArial UnicodeのMS」作品を使用して、インドの文字をサポートしていないことが判明します。
ではドキュメントには、サポートされているどのように多くの言語を見ることができます。