Asian Application Developer's Guide

Traditional Chinese Font Sets

In the Traditional Chinese OpenWindows environment, a font set is composed of one Roman font (presenting codeset 0 or ASCII characters in ISO8859 standard) and nine Chinese fonts (presenting plane 1, 2, 3, 4, 5, 6, 7, 15, and 16 characters in CNS 11643).


Note -

Asian Solaris software provides only plane 1, 2, and 3 characters.


The Asian OpenWindows environment provides some default font sets defined in a Chinese font set definition file:

/usr/openwin/lib/locale/zh_TW/OW_FONT_SETS/OpenWindows.fs

The following is part of this file:

! (14 points, proportional)
-sun-sung-medium-r-normal--16-140-75-75-p-140-tchinese-0:definition,\
    -b&h-lucida-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-1,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-2,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-3,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-4,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-5,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-6,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-7,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-15,\
    -sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-16

The following line describes the Roman font:

"-sun-sung-medium-r-normal--16-140-75-75-p-140-tchinese-0"

The following line describes the codeset 0 (ASCII) character display:

"-b&h-lucida-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1"

The following line describes the plane 1 (codeset 1) Chinese character display:

"-sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-1"

The following line describes the plane 2 (codeset 2) Chinese character display:

"-sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-2"

The following line describes the plane 3 (codeset 2) Chinese character display:

"-sun-sung-medium-r-normal--16-140-75-75-c-140-cns11643-3"

Note the default font sets defined in the Asian OpenWindows environment:

-sun-sung-medium-r-normal--14-120-75-75-c-120-tchinese-0
-sun-sung-medium-r-normal--16-140-75-75-p-140-tchinese-0
-sun-sung-medium-r-normal--16-140-75-75-c-140-tchinese-0
-sun-sung-medium-r-normal--18-160-75-75-c-160-tchinese-0
-sun-sung-medium-r-normal--22-200-75-75-c-200-tchinese-0
-sun-sung-medium-r-normal--26-240-75-75-c-240-tchinese-0
-sun-sung-bold-r-normal--16-140-75-75-p-140-tchinese-0
-sun-sung-bold-r-normal--16-140-75-75-c-140-tchinese-0

The font set name alias definitions are also provided in /usr/openwin/lib/locale/zh_TW/OW_FONT_SETS/OpenWindows.fs.

The following is an alias definition line in the file:

sung14: alias, -sun-sung-medium-r-normal--16-140-75-75-c-140-tchinese-0

You can use sung14 instead of -sun-sung-medium-r-normal--16-140-75-75-c-140-tchinese-0 to access the font set.

Table A-1 Predefined Font Set Aliases

Font Set 

Aliases 

sung12 

-sun-sung-medium-r-normal--14-120-75-75-c-120-tchinese-0

sung14 

-sun-sung-medium-r-normal--16-140-75-75-c-140-tchinese-0

sung16 

-sun-sung-medium-r-normal--18-160-75-75-c-160-tchinese-0

sung20 

-sun-sung-medium-r-normal--22-200-75-75-c-200-tchinese-0

sung24 

-sun-sung-medium-r-normal--26-240-75-75-c-240-tchinese-0

For the complete definitions of these and other font sets, see the /usr/openwin/lib/locale/zh_TW/OW_FONT_SETS/OpenWindows.fs file and XView Developer's Notes.

Traditional Chinese Scalable Fonts

The scalable fonts corresponding to CNS 11643 can be also be accessed from the X side by calling XCreateFontSet. For example, the following code creates a font set consisting of scalable Lucida fonts scaled to 33 pixels, and scalable Ming-Light Chinese fonts for planes 1, 2, and 3 scaled to 33 points.

fs = XCreateFontSet(display,
       "-b&h-lucida-medium-r-normal-sans-33-*-*-*-p-*-iso8859-1,\
       -dynalab-ming-light-r-normal--*-330-*-*-m-*-cns11643-1,\
       -dynalab-ming-light-r-normal--*-330-*-*-m-*-cns11643-2,\
       -dynalab-ming-light-r-normal--*-330-*-*-m-*-cns11643-3",
       &missing_ptr,
       &missing_count,
       &def_string);

Using a Traditional Chinese Font on the Command Line

A command line that starts an Asian OpenWindows tool can also specify its font.

When the current locale is zh_TW, the command should refer to a font-set name (explained in the following section), for example:


system% cmdtool -font sung24 

The flags -font, -Wt, and -fn all work the same in this kind of command. However, when the current locale is C (ASCII), the font name should refer only to the long XLFD name:


system% cmdtool -font -misc-fixed-medium-r-normal--9-80-100-100-c-
60-iso8859-1