Although translation packs for Chinese and Japanese ship with JasperReports Server, the fonts that it uses by default do not support those languages. Therefore, if your organization requires those fonts, you need to configure JasperReports Server for them.
While the fonts JasperReports Server uses are generally dictated by the JRXML files that define your reports, some font configuration is required for special circumstances. For example, you can configure Jaspersoft OLAP to offer different options in the Chart Default Font field in the Chart Options dialog. But note that, in order to use a font, the font must be available to the host's operating system. This section describes steps you may need to take, depending on the functionality you use and the locales you support.
The tasks in this section require you to edit these files:
File Name | Location | Purpose of Edits |
jpivot_internal_messages.properties | .../WEB-INF/internal | Specifying chart fonts for Jaspersoft OLAP Community |
Ja_pro_internal_messages.properties | .../WEB-INF/internal | Specifying chart fonts for Jaspersoft OLAP Professional and Enterprise |
userConfig.xml | .../WEB-INF/jpivot/print | Embedding fonts in PDF |
Enabling East Asian Fonts
The default configuration of the Java Runtime Environment (JRE) does not support East Asian fonts. If your locale requires such a font, you need to configure your users' computers for the fonts and update their JRE.
To configure a Microsoft Windows computer (XP and later) for East Asian fonts:
Details of this procedure vary, depending on your version of Windows. |
1. | In the Control Panel, click Region and Language. |
2. | In the Region and Language dialog, select the Keyboards and Languages tab. |
3. | On the tab, install the language(s) that you need. |
4. | If necessary, install the related keyboard modifications. |
5. | Close the control panel. |
6. | Locate the fontconfig.properties.src file in the C:Program Files<JRE_directory>lib folder. |
7. | In the file, locate the following line: |
sequence.allfonts=alphabetic/default,dingbats,symbol
8. | Change the line to include the East Asian fonts that you need, such as the following: |
sequence.allfonts=alphabetic/default,dingbats,symbol,korean,japanese,chinese-ms936,chinese-ms950
9. | At the end of the file, check to be sure that the fonts you selected are listed, as in the following: |
filename.Gulim=gulim.TTC
If the fonts are not listed, add them.
10. | Save and close the file. |
11. | Rename the file to fontconfig.properties in the file system. |
Configuring OLAP Options for Chart Default Fonts
If you implement Jaspersoft OLAP and support a locale with special font requirements, you can configure Jaspersoft OLAP to offer different options in the Chart Default Font field in the Chart Options dialog of the OLAP view. This may be necessary if you implement locales that Latin 1 doesn't support.
An OLAP view's Chart Options dialog includes the Chart Default Font field, which allows users to select the font to use in charts. The default options are SansSerif, Serif, and MonoSpaced. JasperReports Server reads these values from a properties file and attempts to map them to fonts available in the server host's operating system. You can configure the server to offer different fonts if these fonts don't support the locales you implement.
To change the Chart Default Font field's options:
1. | Save the jpivot_internal_messages.properties file with a new name that reflects the new locale. For example, for Japanese, the new file would be called jpivot_internal_messages_ja.properties. |
2. | Open the new file and locate the following keys: |
If you are using Jaspersoft OLAP Community Edition, the name of the file and the keys that you edit are different. For the Community Edition, open the jpivot_internal_message.properties file and edit these keys: |
3. | Change one or more of the strings to the name of a font available in the host's operating system. For example, if you wanted to change the SansSerif font to the SimHei font, edit the value specified by jsp.wcf.chart.sansserif. For example: |
4. | Save the file. |
5. | Restart JasperReports Server. |
Embedding Fonts in PDF Output for OLAP Views
When users export OLAP views 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.
You can embed any Unicode font using this procedure, though larger font files may have significantly larger memory footprints. To keep memory requirements small, we recommend you use the smallest font file you can, such as SimHei to support Chinese, Japanese, and Korean.
Recommended Comments
There are no comments to display.