I\'m developing a web application which use JFreeChart to render chart. However, when server dose not have any Chinese font installed, JFreeChart dose not display Chinese ch
Why do I have to register font into JVM even if I create my font from file?
How else is the JVM going to know your font exists?
Your font has to be registered with the JVM so that Java knows how to draw your font in the graphics environment that JFreeChart uses to render charts.
How do I make it always use the font I set in order to display character properly in all environment ?
You need to check that the registerFont() method returns true. If it returns false, your font is not available.
It looks like you're loading the font correctly. Maybe the file path of your font isn't correct on your server. You might want to try
getClass().getResource(fontPath);