Traditional Chinese Solaris System Administrator's Guide

Chapter 3 Setting Up Traditional Chinese Solaris Printing Facilities

The Traditional Chinese Solaris operating environment supports printing Traditional Chinese output through the following types of printing facilities:

The system administrator installs printer(s) as described in the printer product documentation. Then users can print Traditional Chinese text using procedures described in this chapter.

Follow the printer documentation for physically connecting the printer. Then use the following instructions.

Line Printer Support

For the Traditional Chinese Solaris operating environment to run a line printer, the printer must recognize at least one of the appropriate code sets:

Traditional Chinese Solaris Code Filters

EUC to Big5 Filter

A printer that does not support EUC needs filters that convert EUC files for printing. For example, the following command sequence tells LP, the print service, that printer lp1 accepts only Big5 format files. This command line also installs printer lp1 on port ttya. The lpadmin(1) man page explains this command more fully.


# lpadmin -p lp1 -v /dev/ttya -I Big5
# accept lp1 
# enable lp1 

An lpfilter command line like the following can be used in the process of printing files whose format is not supported by the printer:


# lpfilter -f filter-name -F pathname 

The above command tells LP that a converter called filter-name (for example euctobig5) is available through the filter description file named pathname. This filter takes default type file input and converts it to Big5 format by using euctobig5. The content of pathname can be as follows:


Input types: simple
Output types: BIG5
Command: euctobig5 

To print an EUC format file, use the following command:


system% lp -d lp1 EUC-filename 

To print a Big5 format file, use the following command:


system% lp -d lp1 -T BIG5 Big5-filename 

Using Configuration Files for Printing With an Epson Dot Matrix Printer

Traditional Chinese Solaris software provides configurable files that allow users to configure the available built-in font ranges according to their own equipment. Traditional Chinese Solaris software provides a configuration file that defines the built-in fonts in the Epson dot matrix printers.

Modify the configuration file according to your printing equipment before using it:

Printing a CNS File to an Epson Dot Matrix Printer

For instance, the following configuration file, /usr/lib/lp/files/cns.epson.conf, is used for setting up an Epson LQ-1070C+ Chinese dot matrix printer. In the example, the Epson LQ-1070C+ is composed of built-in Traditional Chinese fonts for CNS 11643 plane 1 and plane 2. You can specify available fonts in different planes and in different directories.


# @(#)cns.epson.conf	1.5 96/04/10 SMI; ALE
# CNS Print Filter Configuration File for Epson Dot Matrix Printers
#

ACCEPT CODE RANGE:
	PLANE 1:
		0x2121 - 0x234e
		0x2421 - 0x2570
		0x4421 - 0x7d4b
	PLANE 2:
		0x2121 - 0x7244

FONT FILES:
	PLANE 1:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL1-24.pcf.Z
	PLANE 2:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL2-24.pcf.Z
	PLANE 3:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL3-24.pcf.Z
	PLANE 4:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL4-24.pcf.Z
	PLANE 5:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL5-24.pcf.Z
	PLANE 6:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL6-24.pcf.Z
	PLANE 7:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/mingL7-24.pcf.Z
	PLANE 8:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 9:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 10:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 11:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 12:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 13:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 14:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 15:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z
	PLANE 16:
		/usr/openwin/lib/locale/zh_TW/X11/fonts/75dpi/sungNotdef-24.pcf.Z

An lpfilter command line such as the following can be used to print files whose format is not supported by the printer:


# lpfilter -f filter-name -F filename 

The above command tells LP that a converter called filter-name (for example cns.epson.filter) is available through the filter description file named filename.

If you are installing an Epson dot matrix printer, the content of the filter description file, cns.epson.fd, should be as follows:


Input types: simple
Output types: EUC
Command: cns.epson.filter 

This filter takes the default type file input and converts it to a dot matrix data stream by using the cns.epson.filter.

For example, the following command sequence tells LP, the printer service, that printer lp2 accepts only EUC format files. This command line also installs printer lp2 on the bidirectional parallel port /dev/bpp0. The lpadmin(1) man page explains this command more fully.


# lpadmin -p lp2 -v /dev/bpp0 -I EUC
# accept lp2
# enable lp2

To print a file that contains Chinese characters in EUC format to an Epson dot-matrix printer, use the following command:


system% lp -d lp2 EUC-filename 

Printing a Big5 File to an Epson Dot Matrix Printer

Traditional Chinese Solaris software provides a configuration file that defines for zh_TW.BIG5 files the built-in fonts in the Epson dot matrix printers. Modify the configuration file according to your printing equipment before using it. The contents of the /usr/lib/lp/files/big5.epson.conf configuration file can be as follows:


# @(#)big5.epson.conf	1.6 96/05/06 SMI; ALE
#
# Big5 Print Filter Configuration File for Epson Dot Matrix Printers
#

ACCEPT CODE RANGE:
	PLANE 1:
		0xA140 - 0xA3E0
		0xA440 - 0xC6A1
		0xC940 - 0xF9D5

FONT FILES:
	PLANE 1:
		/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/75dpi/mingL1B5-24.pcf.Z

An lpfilter command line such as the following can be used to print files whose format is not supported by the printer:


# lpfilter -f filter-name -F filename

The above command tells LP that a converter called filter-name (for example big5.epson.filter) is available through the filter description file named filename.

If you are installing an Epson dot matrix printer, the content of the filter description file, big5.epson.fd, should be as follows:


Input types: simple
Output types: BIG5
Command: big5.epson.filter 

This filter takes the default type file input and converts it to a dot matrix data stream by using the big5.epson.filter.

For example, the following command sequence tells LP, the printer service, that printer lp2 accepts only zh_TW.BIG5 format files. This command line also installs printer lp2 on the bidirectional parallel port /dev/bpp0. The lpadmin(1) man page explains this command more fully.


# lpadmin -p lp2 -v /dev/bpp0 -I BIG5
# accept lp2
# enable lp2

To print a file that contains Chinese characters in zh_TW.BIG5 format to an Epson dot-matrix printer, use the following command:


system% lp -d lp2 BIG5-filename 

Laser Printer Support

To print Traditional Chinese characters using a PostScript-based printer, a Traditional Chinese Solaris software application must have the Traditional Chinese Solaris xetops, xutops or mp utility to print EUC, BIG5, BIG5HK or UTF-8 files.

Using xetops and xutops Utilities

The xetops and xutops utilities produce bitmapped graphics as printed images. Traditional Chinese software includes the xetops and xutops utilities so any system can print Traditional 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.

Using xetops and xutops is described in Traditional Chinese Solaris User's Guide, in the chapter "Traditional Chinese Printing Facilities," and in the xetops(1) and xutops(1) man pages.

A typical command line for printing a file named filename containing Traditional Chinese characters with xetops, would be as follows:


system% pr filename | xetops | lp 

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 Traditional Chinese.

Using the mp Utility

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 EUCfile in the zh_TW locale, BIG5 file in the zh_TW.BIG5 locale, BIG5HK file in the zh_HK.BIG5HK locale or UTF-8 files in both the zh_TW.UTF-8 and zh_HK.UTF-8 locales.

Using mp is described in Traditional Chinese Solaris User's Guide, in the chapter "Traditional Chinese Printing Facilities," and in the mp(1) man page.

A typical command line for printing a file named filename containing Traditional Chinese characters with or without ASCII/English characters, would be as follows:


system%  mp filename | ld -d printer

Make filename the name of the file to print. This file can contain ASCII/English characters as well as Traditional Chinese.