My recommendation for displaying Chinese fonts within IDL on Unix platforms is to do the following:
1) Register your new font with IDL.
To do this, you will need to modify the ttfont.map file in the resource/fonts/tt subdirectory of your IDL distribution. This is a text file describing the TrueType fonts that will be utilized by IDL. (I recommend making a backup copy of the original version of this file before you edit it.)
The format of this file is:
FontName FileName DirectGraphicsScale ObjectGraphicsScale
Edit the file to include an additional entry for your Chinese font. Initially, you can set the two scale factors to 1.0; these may be adjusted later if you find it is necessary.
After editing the ttfont.map file, you will need to start a new session of IDL for the addition to take effect.
2) Display the Chinese font.
To display characters from the Chinese font in a Direct Graphics window, you will need to take a few steps:
a) Setup IDL to use TrueType fonts:
IDL> !P.FONT = 1
b) Set the current TrueType font:
IDL> DEVICE, SET_FONT=fontName, /TT_FONT
c) Prepare the string to be display. For Chinese fonts, it may be easiest to utilize the Unicode value for each glyph:
IDL> XYOUTS, '!Z(305c,3060,306d)'
[I randomly chose Unicode values 305c, 3060, 306d in this example. Replace these with the Unicode values for the glyphs you want to display.)
Note that Object Graphics may also be used to display your new TrueType font. Be sure to set the ENABLE_FORMATTING property on your IDLgrText object in this case.
|