Jump to content
We've recently updated our Privacy Statement, available here ×

Jasper report can not load Japanese text with some fonts


hungncv.apt

Recommended Posts

I need print PDF report from Java application (Spring boot) which is can show Japanese characters and when change font, it has to show correctly font. My app using jasperreports-fonts-6.10.0.jar and setting in jasperreports_extension.properties is setting as below :

net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactorynet.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory# font.xml placenet.sf.jasperreports.extension.simple.font.families.myfont=fonts/fonts.xml[/code]

and in fonts/fonts.xml, is setting as below :

 ....<fontFamily name="Meiryo UI">    <normal>fonts/Meiryo UI.ttf</normal>    <pdfEncoding>Identity-H</pdfEncoding>    <pdfEmbedded>true</pdfEmbedded>    <exportFonts>    </exportFonts></fontFamily><fontFamily name="Tahoma">    <normal>fonts/tahoma.ttf</normal>    <bold>fonts/tahomabd.ttf</bold>    <pdfEncoding>Identity-H</pdfEncoding>    <pdfEmbedded>true</pdfEmbedded><fontFamily name="MS UI Gothic">    <normal>fonts/msgothic.ttc</normal>    <pdfEncoding>Identity-H</pdfEncoding>    <pdfEmbedded>true</pdfEmbedded></fontFamily><fontFamily name="Times New Roman">    <normal>fonts/times.ttf</normal>    <pdfEncoding>Identity-H</pdfEncoding>    <pdfEmbedded>true</pdfEmbedded></fontFamily>[/code]

and in Java code :

myReport.getDefaultStyle().setPdfFontName(newfontReport); // newfontReport is setting in DB[/code]

All of above fonts are existing in resource of web app. But it only show japansese text and englist text correctly in report with "Meiryo UI". Other fonts (ex : "Times New Roman"), it show englist text parts only , japansese text parts are invisiblity. Have got any one can be show me why ?  

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can create a font set extension to include fonts that are for english and japanese. The font set can be exported to a jar file which can be placed on the JR server under web-inflib dir. Detailed information regarding font extension is available in the TIBCO JasperSoft Studio guide. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...