The Simplified Chinese Solaris operating environment supports printing Simplified Chinese output through the following types of printing facilities:
Line printer containing built-in Simplified Chinese fonts
PostScript-based printer
Before you can print Simplified Chinese, a system administrator must set up your Simplified Chinese printing support as described in Simplified Chinese Solaris System Administrator's Guide.
You can use the Simplified Chinese Solaris xetops, xutops or mp utilities to print files containing Chinese text on a PostScript printer. These printing facilities can be used directly from a command line or from within Simplified Chinese Solaris applications as discussed in the following sections.
The Simplified Chinese Solaris operating environment uses EUC code sets. Its printing applications (such as desktop tools) generate PostScript code that uses EUC. If you use different PostScript printing, make sure it has the same capabilities.
To print an EUC file, use the command in the following example:
system% lp EUC_filename |
To print a GB format file on a printer that supports this format, use the following command:
system% lp -T GB GB_filename |
For more information on setting up the GB filter, see Simplified Chinese Solaris System Administrator's Guide.
The xetops and xutops utilities produce bitmapped graphics as printed images. Simplified Chinese Solaris software includes the xetops and xutops utilities so any system can print Simplified Chinese text on a PostScript printer. The xetops utility in EUC locale and xutops Utility in UTF--8 locale may no longer be supported in the future.
xetops handles files in the EUC locale, such as zh
xutops handles files in the UTF-8 locale, such as zh.UTF-8.
A typical command line for printing a file named filename containing Simplified Chinese characters with xetops, would be as follows:
system% pr filename | xetops | lp |
system% xetops -h |
The following syntax information is returned:
xetops [-r] [-B|[-T [-t S|F|K|H] [-s [i]|m|c] [-p A3|A4|A5|B5|USLtr|USLgl] [-o length=i|c| [,width=i|c]] [filename] |
The options for xetops are as following:
-r: prints the file in landscape mode.
-B: prints the file using bitmap fonts. (The default is TrueType SongTi font.)
-t: use this option to specify up to four typefaces. S indicates SongTi, F indicates FangSongTi, K indicates KaiTi, and H indicates HeiTi.
-s: designates the size of each character. i stands for inches, m stands for millimeters, and c stands for centimeters. (The default is inches.)
-p: specifies the paper size (A3, A4, A5, B5, US Letter, or US Legal).
-o: specifies the length and width of the paper. i stands for inches, and c stands for centimeters. (The default is the number of the lines.)
Here are some examples of pr and xetops. The following command:
system% pr filename | xetops | lp |
will print the file using the SongTi TrueType font. The printed characters will be 4mm in size.
The following command:
system% pr filename | xetops -t K -s 8m | lp |
will print the file using the KaiTi TrueType font. The printed characters will be 8mm in size.
The following command:
system% xetops -t H -s 1.2 filename | lp |
will print the file using the HeiTi TrueType font. The printed characters will be 1.2 inches in size.
The following command:
system% xetops -B filename | lp |
will print the file using a bitmap font.
The syntax for xutops is similar:
system% pr filename | xutops | lp |
Make filename the name of the file to print. This file can contain ASCII/English characters as well as Simplified Chinese.
The mp utility supports all asian locales. As a printing filter, mp generates a pretitified version of contents in PostScript format. The Postscript output file contains glyph images from Solaris system-resident scalable or bitmap fonts, depending on each locale's system font configuration for mp. As a print filter, mp(1) is enhanced in the Solaris 9 environment to print either zh file in zh locale or UTF-8 files in zh.UTF-8 locales.
A typical command line for printing a file named filename containing Simplified Chinese characters with or without ASCII/English characters, would be as follows:
system% mp filename | lp -d printer |
Make filename the name of the file to print. This file can contain ASCII/English characters as well as Simplified Chinese.
To print with the mp utility, type the following:
system% mp filename | lp |
You can also use the utility as a filter, as the utility accepts stdin stream:
system% cat filename | mp | lp |
You can set the utility as a printing filter for a line printer. For example, the following command sequence tells the printer service LP that the printer lp1 accepts only mp format files. This command line also installs the printer lp1 on port /dev/ttya. See the lpadmin (1m) man page for more details.
system% lpadmin -p lp1 -v /dev/ttya -I MP system% accept lp1 system% enable lp1 |
You can add the lpfilter utility for a filter by using the lpfilter(1M) command as follows:
system% lpfilter -f filtername -F pathname |
The lpfilter command tells LP that a converter (in this case, xutops) is available through the filter description file named pathname. The pathname can be determined as follows:
Input types: simple Output types: MP Command: /usr/bin/mp |
The filter converts the default type file input to PostScript output using /usr/bin/mp.
To print a UTF-8 text file, use the following command:
system% lp -T MP UTF-8-file |
For more details on the mp(1) command, refer to the mp(1) man page.