Asian Application Developer's Guide

Font Sets

A font set is a collection of one or more fonts needed to display characters in a language with multiple character sets. The Asian Solaris font sets are described in the following subsections. The concept of font sets is described more fully in XView Developer's Notes.

The /usr/openwin/lib/locale/locale/OW_FONT_SETS/OpenWindows.fs (locale = ko, zh, zh_TW) file defines the full Korean or Chinese OpenWindows font set and also sets the following font point size definitions:

Korean Font Sets

In the Asian OpenWindows environment, a Korean font set is composed of one Roman font (presenting codeset 0 or ASCII characters in ISO8859 standard) and one Korean font (presenting codeset 1 characters in KS C 5601).

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

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

The following is part of this file:

! (14 points, proportional)
-sun-kodig-medium-r-normal--16-140-75-75-p-140-korean-
0:definition,\
    -b&h-lucida-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1,\
    -sun-gothic-medium-r-normal--16-140-75-75-c-140-ksc5601.1987-0

The following line in the file defines a font set as follows:

"-sun-kodig-medium-r-normal--16-140-75-75-p-140-korean-0"

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

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

The following line describes the codeset 1 character display, along with the following:

"-sun-gothic-medium-r-normal--16-140-75-75-c-140-ksc5601.1987-0"

Note the following default font sets defined in the Korean OpenWindows environment:

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

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

An alias definition line in the file appears as follows:

kodig14: alias, -sun-kodig-medium-r-normal--16-140-75-75-c-140-korean-0

You can use kodig14 instead of -sun-kodig-medium-r-normal--16-140-75-75-c-140-korean-0 to access the font set.

Font Set  

Alias 

kodig12 

-sun-kodig-medium-r-normal--14-120-75-75-c-120-korean-0

kodig14 

-sun-kodig-medium-r-normal--16-140-75-75-c-140-korean-0

kodig16 

-sun-kodig-medium-r-normal--18-160-75-75-c-160-korean-0

myeongjo14 

-sun-myeongjo-medium-r-normal--16-140-75-75-c-140-korean-0

myeongjo16 

-daewoo-myeongjo-medium-r-normal--18-160-75-75-c-160-korean-0

myeongjo20  

-sun-myeongjo-medium-r-normal--22-200-75-75-c-200-korean-0

myeongjo24 

-sun-myeongjo-medium-r-normal--26-240-75-75-c-240-korean-0

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

Korean Scalable Fonts

The Korean Solaris scalable fonts are Kodig-Medium (alias Gothic-Medium) and Myeongjo-Medium (alias Myoungjo-Medium).

The Korean scalable fonts corresponding to KS C 5601-1987 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 Kodig-Medium font scaled to 33 points.

 fs = XCreateFontSet(display,
   "-b&h-lucida-medium-r-normal-sans-33-*-*-*-p-*-iso8859-1,\
    -hanyang-kodig-medium-r-normal--*-330-*-*-m-*-ksc5601.1987-0",
       &missing_ptr, &missing_count, &def_string);

Starting Windows with a Specific Korean Font Set

A command line that starts an Asian OpenWindows tool can also specify its font. There are several ways you can specify which font set an Asian OpenWindows application uses. When starting an application tool, Asian OpenWindows checks font specifiers in command line arguments (e.g., -Wt myeongjo14, or -font myeongjo14, or -fn myeongjo14). If the font is not specified in the command line, but the shell variable LANG or LC_CTYPE is set to ko, then Asian OpenWindows uses the kodig14 font specification.

The following is an example of a command line argument used to start a new Korean Solaris command tool with a specified font:


system% cmdtool -Wt myeongjo14 

The window display and UNIX processes might behave in a confusing manner if the font setting and locale are mismatched. However, when the current locale is U.S. (C, ASCII), the command uses a long XLED font name and cannot use a font set alias. Short and long font names are explained in the following section.


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

Simplified Chinese Font Sets

In the Asian OpenWindows environment, a font set is composed of one Roman font (presenting codeset 0 or ASCII characters in ISO8859 standard) and one Chinese font (presenting codeset 1 characters in GB2312).

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

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

The following is part of this file:

! (14 points, proportional)
-sun-song-medium-r-normal--16-140-75-75-p-140-chinese-
0:definition,\
    -b&h-lucida-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1,\
    -sun-song-medium-r-normal--16-140-75-75-c-140-gb2312.1980-0

The following line in the file defines a font set as follows:

"-sun-song-medium-r-normal--16-140-75-75-p-140-Chinese-0"

The following line describes the Roman font:

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

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

"-sun-song-medium-r-normal--16-140-75-75-c-140-gb2312.1980-0"

Note the following default font sets defined in the Chinese OpenWindows environment:

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

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

An alias definition line in the file appears as follows:

song14: alias, -sun-song-medium-r-normal--16-140-75-75-c-140-chinese-0

You can use song14 instead of -sun-song-medium-r-normal--16-140-75-75-c-140-chinese-0 to access the font set.

Font Set 

Aliases 

song12

-sun-song-medium-r-normal--14-120-75-75-c-120-chinese-0

song14

-sun-song-medium-r-normal--16-140-75-75-c-140-chinese-0

song16

-sun-song-medium-r-normal--18-160-75-75-c-160-chinese-0

song20

-sun-song-medium-r-normal--22-200-75-75-c-200-chinese-0

song24

-sun-song-medium-r-normal--26-240-75-75-c-240-chinese-0

songb14

-sun-song-bold-r-normal--16-140-75-75-c-140-chinese-0

songb16

-sun-song-bold-r-normal--18-140-75-75-c-160-chinese-0

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

Using a Simplified Chinese Font on the Command Line

A command line that starts a Chinese OpenWindows tool can also specify its font.

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


system% cmdtool -font song24 

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 

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