Font configuration in JVM
- One minute read - 174 wordsLast year we have migrated one of our application from Java 5 to Java 6. The Java 6(OpenJDK) installation was done by client on a fresh system. After installing our application (under JBoss app), we found the fonts on JFreeCharts and on the images generated from AWT were not correct.
We have solved the issue by configuring the fonts at JVM level. Let understand it better.
How AWT / JFreeCharts shows the fonts
AWT rely on native fonts, it usages default Java fonts (which best fits) if no native fonts mapping found. JFree also usage the AWT library to generates chart images.
JVM Font Configuration
JVM has font configurations, where font mapping to the native fonts can be defined.
Fonts configuration exists in [JRE Installation]/lib/fontconfig.properties.src
or look for the similar file fontconfig.properties
In our application, we noticed an error at the logs saying that the font mapping was defined in the fontconfig.properties.src
but font files did not exists on the mentioned paths.
We then installed the missing font library and font issue get fixed.
#awt #java #jvm #jfreechart #fonts #customizations #technology