
Replacing fonts using NLS font map
In a NLS font map, the original font face and size that is to be replaced and the target font face and size that will replace the original one are mapped together. When you run a report set that contains the original font, it will be replaced by the target font defined in the NLS font map.
One map contains one pair of original and target font face and size. You can define font maps for every locale or language, and all the NLS font maps you define are stored in a XML file named fontMaps.xml which is located in <install_root>\properties.
Editing NLS font map
You can add, edit, and delete NLS font maps on the JReport Administration page according to your requirement.
To create a new font map:
- On the JReport Administration > Reports page, select the NLS Font Map tab, then click the Create New Font Map link.
- In the Create New Font Map dialog, select the language in which you want to create the font map from the Language drop-down list.
- Click the Add button to define a font mapping rule.
- In the Original Fonts box, select the font face and font size for the original fonts, then in the Target Fonts box, select the font face and size for the target fonts accordingly.
- Check Use Relative Font Size if required, then the true final target font size will be the value of the original font size plus the specified target font size.
- Click OK to add the mapping rule to the font map.
- Repeat steps 3 to 6 to add more mapping rules to the font map.
- When done, click OK and the font map will then be created.
To edit a font map:
- In the NLS Font Map tab of the JReport Administration > Reports page, click the language name for the font map.
- In the Edit Font Map dialog, add more mapping rules or remove some according to your requirements.
- When done, click OK to accept the changes.
To delete a font map:
- In the NLS Font Map tab of the JReport Administration > Reports page, check the checkbox ahead of the font map you want to remove.
- Click the Delete link.
Notes:
- When creating a font map with the Create New Font Map dialog, you can set the original font size to "*", in this case, all fonts same as the original will be replaced by the target fonts.
-
You can also edit NLS font maps by modifying the fontMaps.xml file in <install_root>\properties manually, however, if you take this way, you need restart the server after modifying the xml file in order to make the changes take effect.
Font priority between the server NLS font map and report set NLS properties
When both the NLS properties for a report set and the NLS font map for the server have defined font information, which will have higher priority and will be applied if you run the report set? It follows the below rules:
- For fonts that are defined in the NLS properties, NLS properties will be applied.
- For fonts that are defined in the NLS font map and not in the NLS properties, NLS font map will be applied.
- For fonts defined in neither, the default value of the report set will be applied.
