Simplified Chinese Solaris User's Guide

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 code sample creates the display in the next 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
        	/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 the following figure.

Figure 7-2 Using Simplified Chinese Solaris Operating Environment DPS

Graphic

Simplified Chinese Solaris software provides TrueType support in DPS.