If fonts are not displaying correctly in rendered files generated from a Linux server, follow the steps below to verify and fix font availability.
1. Verify font installation
- Check that the required fonts are physically present under the
/usr/share/fontsdirectory of your Linux server. - If not, reinstall the fonts and copy them into
/usr/share/fonts. - Ensure appropriate access rights and privileges are applied.
- Confirm the same fonts are also available in your JDK (lib/fonts) directory.
Note: Fonts need to be deployed to the JDK font directory because the Java runtime does not always rely on system fonts. If the JVM can’t locate fonts in its own search path, the fonts rendered in the report will be substituted, even if the actual fonts exist at the OS level.
2. Rebuild the font cache
Run the following command to rebuild the system font cache:
fc-cache -f -v
3. Verify fonts are readable
Run the following command to list available fonts and confirm the system can read them:
fc-list
Once the system recognizes the fonts, render your template again. Check the font properties in the generated output to confirm that the expected fonts are being embedded correctly.