Use Noto Sans CJK in Jasper Report

1,026 views
Skip to first unread message

CL

unread,
Mar 8, 2017, 7:38:09 AM3/8/17
to noto-font
Hello

I need to generate a report with Jasper Repors with texts in several languages, like English, Russian, Japanese and Chinese. I create a Font Extension (Jasper) with Noto Sans, Noto Sans CJK JP Thin, Noto Sans CJK SC Thin and Noto Sans CJK TC Thin, with PDF Encoding Identity-H.

When I generate a report, if doesn't contains japanese and chinese caracters, the report is fine. But if it contains these, the field with this font extension shows japanese and chinese caracters but it has much height and only appears a line.

I test several configurations but this is the result always.

Can someone help me?

Very Thanks.

Regards.

Adam Twardoch

unread,
Mar 8, 2017, 12:00:49 PM3/8/17
to noto-font, charo.l...@gmail.com
The Noto Sans CJK fonts are CID-keyed CFF-flavored OpenType fonts (.otf). They were developed by Adobe Systems (the authors of PDF), so they fully conform to the OpenType and PDF specifications. 

From what I see in the Jasper documentation http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v630/fonts Jasper makes no mention of CFF-flavored OpenType fonts. It only lists "TrueType (.ttf)" format, plus some dependant webfonts, as supported formats. 


> When users save reports in PDF format, JasperReports Server generates the PDF output using Apache FOP (Formatting Objects Processor). In order for FOP to render fonts properly, you must install the font itself (for example, a TTF file) on the server host, create a font metrics file (using Apache’s org.apache.fop.fonts.apps.TTFReader utility), and update the userConfig.xml file to associate the font with its metrics. For more information, refer to the Apache FOP documentation.

The Apache FOP documentation regarding fonts is: 

There, OTF are mentioned. That doc says 

> OpenType Advanced Font Features
> OpenType fonts support advanced layout features such as ligatures, small caps, swashes, alternates, old style figures and more. Please see Advanced Typographic Extensions - OpenType Layout. These features are currently missing within FOP due to the implementation opting to favor a greater number of formats.

> While FOP may support embedding OpenType with advanced features in the future, the current method extracts the Compact Font Format (CFF) data containing among other things the character definitions, optionally subsets and embeds the result as a Type1C font. This allows the font to be used by both Postscript and older PDF versions while losing the features mentioned above. This is because embedding Open-Type in it's original state is only supported by PDF 1.6 and above.

Generally speaking, the Noto Sans CJK fonts need to be embedded in the PDF as CID-keyed Type1C. 

My guess is that either Jasper or Apache FOP (which may be used by Jasper) have some problems dealing with the Noto Sans CJK fonts. I think you'd be best advised to contact the developers of Jasper to try resolve this issue. 

Also, since the Noto Sans CJK fonts are direct derivatives of the Source Han Sans fonts ( https://github.com/adobe-fonts/source-han-sans ), you may inquire there. The Adobe experts may be able to answer your question. 

Regards,
Adam Twardoch

charo.l...@gmail.com

unread,
Mar 20, 2017, 3:38:35 AM3/20/17
to noto-font, charo.l...@gmail.com
Thank you very much for your explication, it's very clear.

My solution was to create a font extension with Google Noto basic and Code2000.

Regards.

Reply all
Reply to author
Forward
0 new messages