Asian Application Developer's Guide

Chapter 6 Display PostScript System (DPS)

The Asian Solaris operating environment provides PostScript fonts in the Display PostScript System (DPS). This chapter describes what you need to use DPS in Asian Solaris software. For further details on DPS, see Programming the Display PostScript System with X, published by Adobe® Systems.

This chapter is grouped in three main sections for the three localized environments.

Using Korean PostScript Fonts and DPS Facilities

The Korean Solaris operating environment provides the Korean fonts listed in Table 6-1.

Table 6-1 Korean Solaris Operating Environment DPS PostScript Fonts

Font Name 

Description 

Kodig-Medium-COMB-H 

Kodig-Medium font, 9/7 composite font encoding for horizontal display of EUC encoded Hangul and Roman text.  

Kodig-Medium-COMB-V 

Kodig-Medium font, 9/7 composite font encoding for vertical display of EUC encoded Hangul and Roman text. 

Kodig-Medium  

Kodig-Medium font, an alias of Kodig-Medium-EUC-H font; can be used like a Roman font. 

Kodig-Medium-EUC-H 

Kodig-Medium font, 9/7 composite font encoding for horizontal display of EUC text; can be used like a Roman font. 

Kodig-Medium-EUC-V  

Kodig-Medium font, 9/7 composite font encoding for vertical display of EUC text; can be used like a Roman font. 

Kodig-Medium-H 

Kodig-Medium font, 8/8 composite font encoding for horizontal display of shifted out ISO2022 text. 

Kodig-Medium-V 

Kodig-Medium font, 8/8 composite font encoding for vertical display of shifted out ISO2022 text.  

Myeongjo-Medium-COMB-H 

Myeongjo-Medium font, 9/7 composite font encoding for horizontal display of EUC encoded Hangul and Roman text. 

Myeongjo-Medium-COMB-V 

Myeongjo-Medium font, 9/7 composite font encoding for vertical display of EUC encoded Hangul and Roman text. 

Myeongjo-Medium  

Myeongjo-Medium font, an alias of Myeongjo-Medium-EUC-H font; can be used like a Roman font. 

Myeongjo-Medium-EUC-H 

Myeongjo-Medium font, 9/7 composite font encoding for horizontal display of EUC text; can be used like a Roman font. 

Myeongjo-Medium-EUC-V 

Myeongjo-Medium font, 9/7 composite font encoding for vertical display of EUC text; can be used like a Roman font. 

Myeongjo-Medium-H 

Myeongjo-Medium font, 8/8 composite font encoding for horizontal display of shifted out ISO2022 text. 

Myeongjo-Medium-V 

Myeongjo-Medium font, 8/8 composite font encoding for vertical display of shifted out ISO2022 text. 

Figure 6-1 Display PostScript Output (Korean)

GraphicGraphic

Of these fonts, you can use the following just as you would use Roman fonts:

Figure 6-1 shows a sample of Kodig-Medium and Myeongjo-Medium text.

You can also use the following Korean fonts just like Roman fonts for an ISO2022 encoded Hangul string, that is, for a pure Hangul string between SO and SI characters with no intermediate ASCII space (0x20) characters:

Creating Composite Fonts for Korean DPS

You can create composite fonts using any one Roman font with one of the following Korean fonts:

For example, the following PostScript code defines a composite font, Times-Italic+Kodig-Medium, which uses Times-Italic for ASCII characters and Kai-Medium horizontal font for Korean 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
                	/Kodig-Medium-COMB-H findfont
        	] def
	currentdict
	end
	definefont pop

Using Korean Fonts in DPS Programming

You can use some Korean fonts just as you use Roman fonts in DPS wrap definitions. The following sample code was used to create the display in Figure 6-2:

	defineps PSWDisplayText(char *text)
        	/pointSize 50 def
        	/Helvetica pointSize selectfont
        	(Hello World) stringwidth pop 2 div neg 0 moveto
        	(Hello World) show
	
        	/kpSize 40 def
        	/Kodig-Medium-KO kpSize selectfont
        	(text) stringwidth pop 2 div neg pointSize neg moveto
        	(text) show
	endps

You can call PSWDisplayText(Korean text) in a C program to display the designated Korean text; for example, as shown in Figure 6-2.

Figure 6-2 Solaris Operating Environment DPS (Korean)

GraphicGraphic

Using Simplified Chinese PostScript Fonts and DPS Facilities

Simplified Chinese Solaris operating environment DPS provides the Simplified Chinese fonts listed in Table 6-2.

Table 6-2 Simplified Chinese Solaris Operating Environment PostScript Fonts

Font Name 

Description 

Song-Medium 

Alias of Song-Medium-EUC; can be used like a Roman font 

Song-Medium-EUC 

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

Song-Medium-H 

Song-Medium font, horizontal display, to make a composite font with a Roman font 

You can use the following two Simplified Chinese fonts just as you would use Roman fonts:

Figure 6-3 Sample Simplified Chinese Text Display PostScript Output

Graphic

Creating Composite Roman and Simplified Chinese Fonts

You can create composite fonts using any one Roman font and the Simplified Chinese Song-Medium-H font. For example, the following PostScript code defines a composite font, Times-Italic+Song-Medium, which uses Times-Italic for ASCII characters and Song-Medium horizontal font for Simplified Chinese characters:

/Times-Italic+Song-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
                	/Song-Medium-H findfont
        	] def
	currentdict
	end
	definefont pop

Using Simplified Chinese Fonts in DPS Programming

You can use Simplified Chinese fonts just as you use Roman fonts in DPS wrap definitions. The following sample code creates the display in Figure 6-4:

	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
        	/Song-Medium cpSize selectfont
        	(text) stringwidth pop 2 div neg pointSize neg moveto
        	(text) show
	endps

You can call PSWDisplayText(Chinese text) in a C program to display the designated Chinese text. For an example see Figure 6-4.

Figure 6-4 Using Simplified Chinese Solaris Operating Environment DPS

Graphic

Simplified Chinese Solaris software provides TrueType support in DPS.

Using Traditional Chinese PostScript Fonts and DPS Facilities

The Traditional Chinese Solaris operating environment provides the Chinese PostScript fonts listed in Table 6-3.

Table 6-3 Traditional Chinese Solaris Operating Environment PostScript 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, to composite with a Roman font. 

Kai-Medium-V 

Kai-Medium font, vertical display, to 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, to composite with a Roman font.  

Ming-Light-V 

Ming-Light font, vertical display, to composite with a Roman font.  

Of the fonts in this table, you can use the following just as you use Roman fonts:

Figure 6-5 Display PostScript Output Showing Traditional Chinese Text Sample

Graphic

Creating Composite Roman and Traditional Chinese Fonts

You can create composite fonts using one Roman font and one of the following Traditional Chinese fonts:

/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 sample code creates the display in Figure 6-6:

	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 call PSWDisplayText(Chinese text) in a C program to display the designated Chinese text; for example, as shown in Figure 6-6.

Figure 6-6 Using Traditional Chinese Solaris DPS

Graphic

Simplified Chinese Solaris software provides TrueType support in DPS.