简体中文 Solaris 用户指南

使用简体中文 PostScript 字体和 DPS 工具

简体中文 Solaris 操作系统包含下表中列出的字体。

表 9–1 简体中文 Solaris 操作系统 PostScript 字体

字体名 

说明 

宋体 

宋体 EUC 的别名;可像罗马字体一样使用。 

宋体 EUC 

宋体字体,EUC 编码,水平显示;可像罗马字体一样使用。 

楷体 

楷体 EUC 的别名;可像罗马字体一样使用。 

楷体 

楷体字体,EUC 编码,水平显示;可像罗马字体一样使用。 

仿宋体 

仿宋体 EUC 的别名;可像罗马字体一样使用。 

仿宋体 EUC 

仿宋体字体,EUC 编码,水平显示;可像罗马字体一样使用。 

黑体 

黑体 EUC 的别名;可像罗马字体一样使用。 

黑体 EUC 

黑体字体,EUC 编码,水平显示;可像罗马字体一样使用。 

下图显示了一个宋体字体的样例。

上文介绍了此图形。

创建复合的罗马和简体中文字体

可以使用任何一个罗马字体和任意简体中文字体的组合来创建复合字体。例如,下列 PostScript 代码定义了一个复合字体:Times-Italic+Kai-Medium。此复合字体用 Times 斜体显示 ASCII 字符,用楷体显示简体中文字符。

/makeEUCfont {
        /AsianFont exch def
        /WestFont  exch def
        /NewFont   exch def

        /CIDInit /ProcSet findresource 
        begin
          NewFont [ AsianFont WestFont ]
          beginrearrangedfont
            1 usefont
            1 beginbfrange
              <00> <7e>  <00>
            endbfrange
          endrearrangedfont
        end
  } bind def

  /LC_Times-Roman /Times-Roman /Kai-Medium makeEUCfont

在 DPS 编程中使用简体中文字体

在 DPS 自动换行定义中,可以像使用罗马字体那样使用简体中文字体。下列代码样例生成 Hello World 图形中的显示。

	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

可以在 C 程序中调用 PSWDisplayText(中文文本)以显示所设计的中文文本。

Window 用英文和简体中文字符显示文本 Hello World。

简体中文 Solaris 在 DPS 中提供 TrueType 支持。