ChartDirector Ver 4.1 (ColdFusion Edition)

Font Specification


Font Name

In ChartDirector for ColdFusion, a font can be specified using the format:

{font name} [Bold] [Italic]

The followings are some examples:

Arial Bold
Times New Roman
Courier Bold Italic
SansSerif

Special Note for Headless Systems

Headless systems refer to systems that do not have GUI, such as some Linux/UNIX servers.

On Microsoft Windows and Mac OS X, Java uses the font subsystem provided by the OS. On Linux/UNIX, there is no font subsystem at the OS level. Many Java VM will attempt to use X Window services to support fonts. If the system is headless and does not has X Window running, the Java font system may not function.

As a backup, ChartDirector also comes with its own internal font system. If the Java font system is not functional, ChartDirector will automatically use its internal font system. The internal font system only has 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.

You may use "cfdemo/cdinfo.cfm" to determine if the Java font system is functional or not.

Java 1.4 or above contains built-in support for headless systems, so the Java font system can function even on headless systems. However, this feature may need to be enabled by a command line switch. See the following ColdFusion knowledge base article on how to enable headless support in ColdFusion MX.

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18747


Font List

Instead of specifying a single font file as the font name, you may specify a list of font files as the font name, separated by semi-colons. This is useful when using international characters that are only available in some fonts.

For example, if you would like to use the Arial font for western characters, and the MingLiu font for Chinese characters (since the Arial font does not have Chinese characters), you may specify the font name as "Arial;MingLiu". In this case, ChartDirector will try the Arial font first. If it cannot find a certain character there, it will try the MingLiu font.

Indirect Font Names

ChartDirector supports several special keywords for specifying the font name indirectly. When these keywords are used as font names, ChartDirector will look up the actual font names from a font table. The keywords are as follows:

KeywordsDescription
"normal"This default normal font, which is the first font in the font table. This is initially mapped to "Arial".
"bold"The default bold font, which is the second font in the font table. This is initially mapped to "Arial Bold".
"italic"The default italic font, which is the third font in the font table. This is initially mapped to "Arial Italic".
"boldItalic"The default bold-italic font, which is the fourth font in the font table. This is initially mapped to "Arial Bold Italic" .
"fontN"The (N + 1)th font in the font table (the first font is "font0").

The font table can be modified using BaseChart.setFontTable or DrawArea.setFontTable.

The advantage of using indirect font names is that you can change the fonts fonts in your charts in one place.

Font Index

The font index is ignored in ChartDirector for ColdFusion. It is solely for compatibility with other ChartDirector editions.

Font Size

The font size decides how big a font will appear in the image. The font size is expressed in a font unit called points. This is the same unit used in common word processors.

Instead of specifying font size, some ChartDirector API (eg. TextBox.setFontSize) allow you to specify font height and font width separately. In ChartDirector for ColdFusion, only font height is used as the font size, and font width is ignored.

Font Color

This is the color to draw the font. (See Color Specification on how colors are represented in ChartDirector.)

Font Angle

This is the angle in degrees by which the font should be rotated anti-clockwise.

Vertical Layout

By default, text are laid out horizontally, with characters being drawn from left to right.

ChartDirector also supports vertical layout, with characters being drawn from top to bottom. For example, you may use BaseChart.addText to add text that are laid out vertically. Vertical layout is common for oriental languages such as Chinese, Japanese and Korean.