Traditional Chinese Solaris User's Guide

Chapter 9 Fonts

This chapter describes the PostScript, TrueType and bitmap fonts supported for use in the Traditional Chinese Solaris operating system. The topics in this chapter discuss how to use and to edit the fonts:

Display PostScript System (DPS)

The Traditional Chinese Solaris operating system provides PostScript fonts in the Display PostScript System (DPS). This section describes the fonts and the DPS facilities. For further details, see Programming the Display PostScript System with X, published by Adobe Systems.

Using Traditional Chinese PostScript Fonts and DPS Facilities

The Traditional Chinese Solaris operating system provides the DPS fonts listed in the following table.

Table 9–1 Traditional Chinese DPS Fonts

Font Name 

Description 

Kai-Medium 

Alias of Kai-Medium-EUC-H 

Kai-Medium-EUC-H 

Kai-Medium font, EUC encoding, horizontal display; can be used like a Roman font 

Kai-Medium-EUC-V 

Kai-Medium font, EUC encoding, vertical display; can be used like a Roman font 

Kai-Medium-H 

Kai-Medium font, horizontal display, for making a composite with a Roman font 

Kai-Medium-V 

Kai-Medium font, vertical display; for making a composite with a Roman font 

Ming-Light 

Alias of Ming-Light-EUC-H 

Ming-Light-EUC-H 

Ming-Light font, EUC encoding, horizontal display; can be used like a Roman font 

Ming-Light-EUC-V 

Ming-Light font, EUC encoding, vertical display; can be used like a Roman font 

Ming-Light-H 

Ming-Light font, horizontal display, for making a composite with a Roman font 

Ming-Light-V 

Ming-Light font, vertical display; for making a composite with a Roman font 

The following figure shows a sample of Kai-Medium and Ming-Light fonts.

 Kai-Medium and Ming-Light fonts

Creating Composite Roman and Traditional Chinese Fonts

You can create composite fonts with a Roman font and one of the following Traditional Chinese fonts.

For example, the following PostScript code defines a sample composite font, Times-Italic+Kai-Medium. The Times-Italic font is used for the ASCII characters and the Kai-Medium horizontal font is used for the Traditional Chinese characters.


/Times-Italic+Kai-Medium
13 dict begin
				/FontName 1 index def
				/FMapType 4 def
				/Encoding [ 0 1 ] def
				/WMode 0 def
				/FontType 0 def
				/FontMatrix [1.0 0.0 0.0 1.0 0.0 0.0] def
				/FDepVector [
								/Times-Italic findfont
								/Kai-Medium-H findfont
				] def
currentdict
end
definefont pop

Using Traditional Chinese Fonts in DPS Programming

You can use Traditional Chinese fonts just as you use Roman fonts in DPS wrap definitions. The following code sample creates the display in the Hello World figure.


defineps PSWDisplayText(char *text)
			/pointSize 50 def
			/Helvetica pointSize selectfont
			(Hello World) stringwidth pop 2 div neg 0 moveto
			(Hello World) show

			/cpSize 40 def
			/Kai-Medium cpSize selectfont
			(text) stringwidth pop 2 div neg pointSize neg moveto
			(text) show
endps

You can include PSWDisplayText (Chinese text) in a C program to display the designated Chinese text.

Hello World displayed with Chinese text equivalent

The Traditional Chinese Solaris software provides TrueType support in DPS.

How to Convert from BDF to PCF Format

Before Solaris applications can use a modified BDF file, the file must be converted to a PCF format file.

  1. Use a command line such as the one in the following exa,ple to convert the BDF file to PCF format.


    system% bdftopcf -o myfont14.pcf myfont14.bdf
    

    The -o option enables the matrix encoding used for Asian PCF font files.

  2. Replace the BDF file in the following directory with the converted PCF file: $OPENWINHOME/lib/locale/zh_TW/fonts

How to Install and Check the Edited Font

  1. To add a new bitmap, move the .pcf font file into your font directory.


    Tip –

    You can use a command such as the following to compress the .pcf font file before you move it:


    system% compress myfont14.pcf
    

  2. Run the following commands in your font directory.

    The .bdf file should not be in the font directory.


    system% cat >> fonts.alias
    -new-myfont-medium-r-normal--16-140-75-75-c-140-cns11643-16 
    Myfont-Medium14
    ^D
    system% mkfontdir
    system% xset +fp `pwd`
    
  3. You can use a command such as the following example to view your font.


    system% xfd -fn Myfont-Medium14
    

Changing Font Directories

The Xsession script in the /usr/dt/bin directory includes the font path /usr/openwin/lib/locale/locale/X11/fonts, where locale is either zh_ZW, zh_ZW.BIG5, or zh_ZW.UTF-8. To dynamically add a different font directory path, type the following commands:


system% xset +fp font_directory-path
system% xset fp rehash

TrueType and Bitmap Fonts

The tables in this section list the TrueType and bitmap fonts that are available for the zh_TW and the zh_HK.BIG5HK locales.

The following table shows the Traditional Chinese TrueType Fonts for the zh_TW locales.

Table 9–2 Traditional Chinese TrueType Fonts for the zh_TW Locales

Full Family Name 

Subfamily 

Format 

Vendor 

Encoding 

 Hei R TrueType Hanyi CNS11643.1992
 Kai R TrueType Hanyi CNS11643.1992
 Ming R TrueType Hanyi CNS11643.1992

The following table shows the Traditional Chinese bitmap fonts for the zh_TW locales.

Table 9–3 Traditional Chinese Bitmap Fonts for the zh_TW Locales

Full Family Name 

Subfamily 

Format 

Encoding 

 Ming R PCF (12,14,16,20,24) CNS11643.1992

The following table shows the TrueType fonts for the zh_HK.BIG5HK locale.

Table 9–4 TrueType Fonts for the zh_HK.BIG5HK Locale

Family Name 

Subfamily 

Format 

Vendor 

Encoding 

Ming 

TrueType 

FangZheng 

BIG5–HKSCS 

Hei 

TrueType 

FangZheng 

BIG5–HKSCS 

Kai 

TrueType 

FangZheng 

BIG5–HKSCS 

The following table shows the bitmap fonts for the zh_HK.BIG5HK locale.

Table 9–5 Bitmap Fonts for the zh_HK.BIG5HK Locale

Family Name 

Subfamily 

Vendor 

Format 

Ming 

PCF(12,14,16,20,24) 

BIG5–HKSCS