The LP print service uses an interface program and the terminfo
database
to initialize each printer and establish the following:
Selected page size
Character pitch
Line pitch
Character set
Each printer is identified in the terminfo
database with
a short name. The short name required by the terminfo
database
is identical to the name used to set the TERM shell variable. This
name is also the printer type that you specify when setting up a printer. For example,
the entries for different types of PostScript printers are in the /usr/share/lib/terminfo/P
directory. The default entries provided with the SunOS software release
are PS
(for PostScript) and PSR
(for PostScript
Reverse).
If you cannot find a terminfo
entry for your printer, you
still might be able to use the printer with the LP print service without the automatic
selection of page size, pitch, and character sets. However, you might have trouble
keeping the printer set in the correct modes for each print request.
If no terminfo
entry exists for your type of printer
and you want to keep the printer set in the correct modes, you can do one of the following:
Customize the interface program used with the printer.
Add an entry to the terminfo
database.
A terminal or printer entry in the terminfo
database contains
and defines hundreds of items. The LP print service, however, uses fewer than 50 of
these items. The following table lists the required terminfo
items
for a printer.
Table 6.2. Required terminfo
Items for a Printer (Booleans)
Item |
|
Description |
---|---|---|
Booleans: |
|
|
|
|
Changing character pitch changes resolution |
|
|
Printer requires an operator to change character set |
|
|
Changing line pitch changes resolution |
Table 6.3. Required terminfo
Items
for a Printer (Numbers)
Item |
|
Description |
---|---|---|
Numbers: |
|
|
|
|
Number of bytes buffered before printing |
|
|
Number of columns in a line |
|
|
Average print rate in characters per second |
|
|
Tabs initially every |
|
|
Number of lines on a page |
|
|
Horizontal resolution, in units per character |
|
|
Horizontal resolution, in units per inch |
|
|
Vertical resolution, in units per line |
|
|
Vertical resolution, in units per inch |
Table 6.4. Required terminfo
Items
for a Printer (Strings)
Item |
|
Description |
---|---|---|
Strings: |
|
|
|
|
Changes horizontal resolution |
|
|
Changes number of characters per inch |
|
|
Carriage return |
|
|
List of character set names |
|
|
Moves carriage down one line |
|
|
Moves carriage down |
|
|
Moves carriage to the right |
|
|
Changes vertical resolution |
|
|
Ejects page |
|
|
Horizontal position absolute |
|
|
Tabs to next 8-space tab stop |
|
|
Is the name of initialization file |
|
|
Is the path name of initialization program |
|
|
Is a printer initialization string |
|
|
Is a printer initialization string |
|
|
Is a printer initialization string |
|
|
Changes number of lines per inch |
|
|
Clears all margins (top, bottom, and sides) |
|
|
Repeats a character |
|
|
Disables double-wide printing |
|
|
Selects character set |
|
|
Starts definition of a character set |
|
|
Set page length to |
|
|
Sets left margin at current column |
|
|
Set left margin |
|
|
Sets right margin at current column |
|
|
Sets right margin |
|
|
Sets both left and right margins |
|
|
Sets top margin at current line |
|
|
Sets top margin |
|
|
Sets bottom margin at current line |
|
|
Sets bottom margin |
|
|
Sets both top and bottom margins |
|
|
Enables double-wide printing |
|
|
Sets vertical position to absolute |
How to Add a terminfo
Entry
for an Unsupported Printer
Before you create a terminfo
entry for a printer,
make sure that none of the existing terminfo
entries will support
the printer. To do so, try to set up the printer with an entry for a similar printer,
if a similar printer exists.
Log in as superuser, lp
, or
assume an equivalent role on the print server.
Determine a terminfo
entry
name for the printer.
The directories in the /usr/share/lib/terminfo
directory contain all the valid terminfo
entries.
Use these entries as a guide for choosing a name for the printer.
Create a terminfo
entry file
for the printer.
Table 6–2 shows the items you must define in the terminfo entry to add a new printer to the LP print service. For more details about the structure of the terminfo database, see the terminfo ( 4 ) man page.
To help you start writing a new terminfo
entry,
use the infocmp command to save an existing terminfo
entry to a file. This command is helpful if there is a terminfo
entry that is similar to entry you want to create. For example, the following
command saves the ps
entry to the ps_cust
file,
which will become the new terminfo
entry.
infocmp ps > ps_cust
Compile the terminfo
entry
file into the terminfo
database.
#tic
terminfo_entry
where terminfo-entry
variable is the terminfo
entry file you created.
Check for the new terminfo
entry
file in the /usr/share/lib/terminfo
directory.