{font name} [Bold] [Italic]
where "{font name}" is a Java compatible font name (that is, the font name that is used in java.awt.Font). The "[Bold]" and "[Italic]" are optional. The followings are some examples:
Arial Bold Times New Roman Courier Bold Italic SansSerif
When using the above format, you may use all fonts that are known to the Java system.
ChartDirector also supports using true-type fonts that are unknown to the Java system. This is useful if you are using private fonts in your application. The method is by specifying the font using the font file name. ChartDirector will search the font file from the class path, and also will search using the java library path (java.library.path).
For example, if you are using ChartDirector on a web server, you can put the fonts files in the WEB-INF/classes inside your web application directory. In this way, you can use your own fonts without relying on the fonts provided by the web server.
Note: Private font files support require Java 1.3 or above.
Note: Using Java fonts or private font files requires your Java font system be functional (java.awt.Font is functional).
Java on Microsoft Windows, Mac OS X, and Java systems that interacts with a GUI (such as standalone Java programs and Java Applets) always have functional font systems. However, some server side Java systems, such as the Java for running JSP or servlets on Linux/UNIX servers, may not have a working font system.
It is because many Java systems on Linux/UNIX rely on X Window services to support fonts. On the other hand, many servers do not need a GUI and may not have X Window. In these cases, any attempt to use the Java font system (eg. simply create a java.awt.Font object) will cause Java to throw an Error.
To solve this problem, ChartDirector comes with its own internal font system. If the Java font system is not functional, ChartDirector will automatically use its internal font system, so the charts will still work. The internal font system only have 3 fonts - generic sans serif (Arial like font), generic serif (Times New Roman like font) and generic monospace (Courier like font). All of them have bold, italic and bold-italic styles.
If you are encounter the above problem but still want to use the Java font system, you may start Java in "headless" mode (requires Java 1.4 or above). Please refer to the link below on how to start Java in "headless" mode.
If you are using Java 1.3 or Java 1.2 and you want to use the Java font system, you may need to install a working GUI subsystem on your computer.
Java on Microsoft Windows, Mac OS X, and Java systems that interacts with a GUI (such as standalone Java programs and Java Applets) always have functional font systems. However, some server side Java systems, such as the Java for running JSP or servlets on Linux/UNIX servers, may not have a working font system.
It is because many Java systems on Linux/UNIX rely on X Window services to support fonts. On the other hand, many servers do not need a GUI and may not have X Window. In these cases, any attempt to use the Java font system (eg. simply create a java.awt.Font object) will cause Java to throw an Error.
To solve this problem, ChartDirector comes with its own internal font system. If the Java font system is not functional, ChartDirector will automatically use its internal font system, so the charts will still work. The internal font system only have 3 fonts - generic sans serif (Arial like font), generic serif (Times New Roman like font) and generic monospace (Courier like font). All of them have bold, italic and bold-italic styles.
If you are encounter the above problem but still want to use the Java font system, you may start Java in "headless" mode (requires Java 1.4 or above). Please refer to the link below on how to start Java in "headless" mode.
If you are using Java 1.3 or Java 1.2 and you want to use the Java font system, you may need to install a working GUI subsystem on your computer.