System Administration Guide: Solaris Printing

Chapter 8 Administering Character Sets, Filters, Forms, and Fonts (Tasks)

This chapter provides overview information and procedures for administering character sets, filters, forms, and fonts on a system.

This is a list of the information that is included in this chapter:

Administering Character Sets (Task Map)

Task 

Description 

For Instructions 

Define a print wheel or font cartridge. 

Define a print wheel or font cartridge that can be used with a printer. 

How to Set an Alert to Mount a Print Wheel or Font Cartridge

Unmount and mount a print wheel or font cartridge. 

Delete a current print wheel or font cartridge from the print server's configuration file. Adds a new print wheel or font cartridge to the print server's configuration file. 

How to Unmount and Mount a Print Wheel or Font Cartridge

Set up alerts to mount a print wheel or font cartridge. 

Set up email alerts for print requests. 

How to Set an Alert to Mount a Print Wheel or Font Cartridge

Set up an alias for a selectable character set. 

Set up aliases when terminfo names for the selectable character sets are inadequate.

How to Set Up an Alias for a Selectable Character Set

Administering Character Sets

Printers differ in the method that they use to print text in various font styles. For example, PostScript printers treat text as graphics. These printers can generate text in different fonts. They can also place the text in any position, size, or orientation on the page. Other types of printers support a more limited number of font styles and sizes. These printers use either print wheels, font cartridges, or preprogrammed selectable character sets. Usually, only one printing method applies to a given printer type.

From the perspective of the LP print service, print wheels and font cartridges are similar. In both cases, someone must intervene and mount the hardware on the printer, when needed. Character sets that require you to physically mount a print wheel or font cartridge are referred to as hardware character sets. Character sets that do not require hardware mounting, come preprogrammed with the printer. These character sets can be selected by a print request. They are referred to as software character sets.

When you set up a non-PostScript printer, you need to tell the LP print service which print wheels or selectable character sets are available to users. When users submit print requests, the lp -S command enables them to specify a print wheel or selectable character set to use for the print job. Users do not have to know which type of character set applies. They just refer to the font style by the name you have defined. For example, you can define a print wheel as gothic. To request the gothic print wheel, the user would use the following command:


% lp -S gothic filename

Selectable Character Sets

The selectable character sets supported by a printer are listed in the terminfo entry for that printer. For example, the entry for the ln03 printer is /usr/share/lib/terminfo/l/ln03. You can find the names of selectable character sets for any printer type in the terminfo database by using the tput command. The syntax for the tput command is as follows:


tput -T printer-type csn

The csn option is an abbreviation for character set number. The number starts with 0, which is always the default character set number after the printer is initialized. To display the names of the other character sets, you can repeat the command by using -1, -2, -3, and so on, in place of the -0. For each selectable character set, a terminfo name, for example, usascii, english, finnish, and so forth, is returned.

In general, the terminfo character set names should closely match the character set names that are used in the manufacturer's documentation for the printer. Because all manufacturers do not use the same character set names, the terminfo character set names can differ from one printer type to the next printer type.

You do not have to register the selectable character set names with the LP print service. However, you can give them more meaningful names or aliases.


Note –

If you do not specify the selectable character sets that can be used with a printer, the LP print service assumes that the printer can accept any character set name, such as cs0, cs1, or cs2, or the terminfo name known for the printer.

Character sets for PostScript printers are not listed when you use the lpstat -p -l command. The PostScript fonts are controlled by PostScript filters, not by entries in the terminfo database. For information about how to administer PostScript fonts, see Administering Fonts.


Users can use the lpstat -p -l command to display the names of the selectable character sets that you have defined for each printer on a print server.

Hardware Character Sets

Another method to obtain alternative character sets is to use removable print wheels or font cartridges that you physically attach, or mount, in a printer.

To administer hardware-mounted character sets, you inform the LP print service of the following:

Then, when a user requests a particular character set by using the lp -S command, the print scheduler sends an alert to mount the print wheel. In addition, the print request is placed in the print queue. When you mount the correct print wheel and tell the LP print service that the print wheel is mounted, the job is printed. For more information, see How to Unmount and Mount a Print Wheel or Font Cartridge.

If you do not specify multiple print wheels or font cartridges for a printer, the LP print service assumes that the printer has a single, fixed print wheel or font cartridge. As such, users cannot specify a special print wheel or font cartridge when using that printer.

Unlike selectable character sets, the names you use for print wheels or font cartridges are not tied to entries in the terminfo database. Print wheel names or font cartridge names are used only for the purpose of communicating with the LP print service and its users.

However, the names you choose for print wheels or font cartridges should have meaning to the users. The names should refer to font styles. In addition, the names should be the same across printers that have similar print wheels, font cartridges, or selectable character sets. That way, users can specify a font style (character set), without regard to which printer will be used, or whether a print wheel, font cartridges, or a selectable character set will be used.

You and the printer users should agree on the meanings of print wheel names or font cartridge names. Otherwise, what a user asks for and what you mount might not be the same character set.

Tracking Print Wheels

The procedure for tracking print wheels is similar to the procedure for tracking forms. Some printers, usually letter-quality printers, have removable print heads that provide a particular font or character set. Removable print heads include print wheels and print cartridges. A user can request a named character set. If that character set is not available, the LP print service notifies root of the request. The job is stored in the print queue until the print wheel is changed.

Alerts for Mounting Print Wheels or Font Cartridges

You request alerts for mounting print wheels or font cartridges in the same way that you request other alerts from the LP print service. For general information about alerts, see Setting Up Printer Fault Recovery by Using LP Print Commands.

ProcedureHow to Define a Print Wheel or Font Cartridge

These procedure shows how to define a print wheel or font cartridge that can be used with the printer.

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Define a print wheel or font cartridge.


    # print-server lpadmin -p printer-name -S hard-charset1[,hard-charset2...]
    -p printer-name

    Specifies the name of the printer for which you are defining a print wheel or font cartridge.

    -s hard-charset

    Specifies the hardware character set name of the print wheel or font cartridge.

    You can specify multiple hardware character sets with this command. Use commas or spaces to separate character set names. If you use spaces, enclose the list of character set names in quotation marks.

    Define names that are meaningful to users. Inform the users of these names.

    The print wheel or font cartridge definition is specified in the print server's /etc/lp/printers/printer-name/configuration file.

  3. Log in as superuser, lp, or assume an equivalent role on a print client of the print server.

  4. Define the same print wheel or font cartridge for the print client.


    # print-client lpadmin -p printer-name -S hard-charset1, hard-charset2...
    

    In this command, the variables are the same as the variables in Step 2.

    The print wheel or font cartridge definition is added to the print client's /etc/lp/printers/printer-name/configuration file.

  5. Repeat Step 3 and Step 4 for each print client that might need to use the print wheel or font cartridge.

  6. Verify that the print wheel or font cartridge is defined.

    You should see the name of the character set and the notation (mounted).


    # lpstat -p printer-name -l
    

Example 8–1 Defining a Print Wheel

The following example shows how to define the pica print wheel on the printer luna. The print client is named asteroid.


asteroid# lpadmin -p luna -S pica

ProcedureHow to Unmount and Mount a Print Wheel or Font Cartridge

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Unmount the print wheel or font cartridge that is mounted in the printer.


    # lpadmin -p printer-name -M -S none
    
    -p printer-name

    Specifies the printer on which you are unmounting a print wheel or font cartridge.

    -M -S none

    Indicates that you want to unmount the current print wheel or font cartridge.

    For more information, see the lpadmin(1M) man page.

    The current print wheel or font cartridge is deleted from the print server's /etc/lp/printers/printer-name/configuration file.

  3. Remove the print wheel or font cartridge from the printer.

  4. Put the new print wheel or font cartridge in the printer.

  5. Mount the new print wheel or font cartridge.


    # lpadmin -p printer-name -M -S hard-charset...
    
    -p printer-name

    Specifies the printer on which you are mounting a print wheel or font cartridge.

    -M -S hard-charset

    Specifies the hardware character set name of the print wheel or font cartridge you want to mount.

    The print wheel or font cartridge is added to the print server's /etc/lp/printers/printer-name/configuration file. The mounted print wheel or font cartridge remains active until it is unmounted or until a new print wheel or font cartridge is mounted.

  6. Check the information under the Print wheels or Character set heading in the output of the following command.

    You should see the name of the print wheel or character set and the notation (mounted).


    # lpstat -p printer-name -l
    

Example 8–2 Unmounting and Mounting a Print Wheel

The following example shows how to unmount the current print wheel on the printer luna and mount the pica print wheel.


# lpadmin -p luna -M -S none
# lpadmin -p luna -M -S pica

ProcedureHow to Set an Alert to Mount a Print Wheel or Font Cartridge

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Set an alert to mount a print wheel or font cartridge.


    # lpadmin -S hard-charset -A alert [-Q requests] [-W minutes]
    -S hard-charset

    Specifies the hardware character set name of the print wheel or font cartridge for which you want to set an alert.

    -A alert

    Specifies what kind of alert will occur when a print wheel or font cartridge is requested. For detailed information about the valid values for alert, see Table 5–4. Some valid values are mail, write, and quiet.

    If you specify mail or write, a predefined alert message says to mount the specified print wheel or font cartridge. The message includes the names of one or more printers that have been set up to use such a print wheel or font cartridge.

    -Q requests

    Specifies the number of print requests that require the print wheel or font cartridge that must be in the queue before an alert occurs. If you don't specify this option, only one print request in the queue triggers an alert.

    -W minutes

    Specifies how often (in minutes) the alert occurs If you don't specify this option, the alert is sent one time.

    For more information, see the lpadmin(1M) man page.

    The alert is added to the print server's /etc/lp/pwheels/charset-name/alert.sh file.

  3. Verify that the alert has been added for the print wheel or font cartridge by checking the output of the following command.


    # lpadmin -S hard-charset -A list
    

    Alternately, if you have set a low number of print requests to trigger the alert, submit enough print requests to meet the minimum requirements. Ensure that you receive an alert to mount the print wheel or font cartridge.


Example 8–3 Setting an Alert to Mount a Print Wheel

The following example shows how to set email alerts to occur every 5 minutes for the elite print wheel when the print queue contains 10 print requests for the elite.


# lpadmin -S elite -A mail -Q 10 -W 5


Example 8–4 Setting an Alert to Mount a Font Cartridge

The following example shows how to set email alerts to occur every minute for the finnish font cartridge when the print queue contains 5 print requests for the finnish.


# lpadmin -S finnish -A mail -Q 5 -W 1


Example 8–5 Setting Up No Alerts for a Print Wheel

The following example shows how to set up no alerts for the elite print wheel.


# lpadmin -S elite -A none

ProcedureHow to Set Up an Alias for a Selectable Character Set

You do not need to perform this procedure if the terminfo names for the selectable character sets are adequate. For more information on using the terminfo database, see Adding a terminfo Entry for an Unsupported Printer.

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Display the names of the selectable character sets for the specified printer type.


    # tput -T printer-type csn
    
    -T printer-type

    Specifies the printer type found in the terminfo database. For information on entries in the terminfo database, see Printer Type.

    n

    Specifies the number (0, 1, 2, 3, 4, 5, and so on) that represents a selectable character set for the specified printer type. The system displays the selectable character set name followed by the prompt symbol. For example, cs1 could cause the system to display english#.

    For more information, see the tput(1) man page.

  3. Set up an alias for a selectable character set.


    # lpadmin -p printer-name -S select-charset1=alias1,select-charset2=alias2...
    
    -p printer-name

    Specifies the printer on which you are setting up aliases for selectable character sets.

    -Sselect-charset

    Specifies the electable character set name. The name can be found in Step 2.

    alias

    Is the alias for the specified selectable character set. This alias can be used in addition to the selectable character set name.

    You can set up more than one alias with this command. Use commas or spaces to separate the aliases. If you use spaces, enclose the list of aliases in quotation marks.

    The alias is added to the print server's /etc/lp/printers/printer-name/configuration file.

  4. Log in as superuser, lp, or assume an equivalent role on a system that is a print client of the print server.

  5. Set up an alias for the selectable character set.


    # lpadmin -p printer-name -S select-charset1=alias1,select-charset2=alias2...
    

    In this command, the variables are the same as the variables in Step 3.

    The alias is added to the print client's /etc/lp/printers/printer-name/configuration file.

  6. Repeat Step 4 and Step 5 for each print client that might need to use the alias.

  7. On the print server and print clients, verify that the selectable character set alias is listed in the output of the following command.


    # lpstat -p printer-name -l
    

    Alternately, submit a print request that uses the alias for the selectable character set and check for output.


Example 8–6 Setting Up an Alias for a Selectable Character Set

The following example shows how to display the names of selectable character sets for the usascii selectable character set on the printer luna. The printer luna is a ln03 printer type. This example also shows how to specify text as an alias for the usascii selectable character set.


# tput -T ln03 cs0
usascii# tput -T ln03 cs1
english# tput -T ln03 csn2
finnish# tput -T ln03 csn3
japanese# tput -T ln03 cs4
norwegian#
# lpadmin -p luna -S usascii=text

Administering Print Filters (Task Map)

Task 

Description 

For Instructions 

Create a new print filter. 

Create a new print filter for file types that the LP print service cannot interpret. 

How to Create a New Print Filter

Add a print filter. 

Add information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. 

How to Add a Print Filter

Delete a print filter. 

Delete information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. 

How to Delete a Print Filter

View information about a print filter. 

Delete information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. 

How to View Information About a Print Filter

Creating a New Print Filter

A filter is used by the LP print service each time it has to print a type of file that the printer cannot interpret. Creating a new print filter is not easy, and it usually requires extensive experimentation.

The process of defining a new print filter consists of two steps:

A print filter can be as simple or as complex as needed. Filters contain input types, output types, and complex options that provide a language to process command-line arguments within the filter.

If you have nonPostScript printers, you have to create and add print filters as required. First, you need to understand what print filters are and the requirements that must be met by a filter program.

Writing a Print Filter Program

The LP print service provides filter programs in the /usr/lib/lp/postscript directory. These filters cover most PostScript printing situations, where the destination printer requires the data to be in PostScript format. A print filter program must be a binary executable file.

Types of Filters

There are two types of print filters: fast filters and slow filters.

Fast filters do not require much processing time to prepare a file for printing. They must have access to the printer when they run. To be capable of detecting printer faults, a print filter must be a fast filter. Any filter that uses the PRINTER keyword as a filter option must be installed as a fast filter.

Slow filters require a great deal of processing time to prepare a file for printing. They do not require access to the printer when they run. Slow filters are run in the background so they do not tie up the printer, allowing other files that do not need slow filtering to be printed.

Converting Files

The LP print service uses print filters to convert files from one content type to another content type. You can specify the accepted file content types for each printer. The user specifies the file content type when submitting a print request. Then, the LP print service finds a printer that can print files of that content type. Because many applications can generate files for various printers, this method is often sufficient. However, some applications can generate files that cannot be printed on any available printers.

Each time the LP print service receives a request to print a type of file that is in a format that cannot be accepted directly by a printer, the LP print service tries to match the content type of the print request with the content type of the available (or specified) printer. If there is a match, the file can be sent directly to the printer without filtering. If no match is found, or if the content type specifies that a filter be used, the LP print service tries to match the content type of the file with the input content type of available filters. In addition, the LP print service tries to match the output type of the filter with the content type of the printer. When an appropriate filter is found, the print request is passed through the filter.

Handling Special Printing Modes

A print filter handles special printing modes and requests to print specific pages. A special printing mode is needed to print any characteristics of print requests that require a customized filter.

Filters handle the following characteristics:

The LP print service provides default settings for these characteristics. However, a print filter can handle some characteristics more efficiently. For example, some printers can handle multiple copies more efficiently than the LP print service. So, in this case, you can provide a filter for multiple-copy page control.

Detecting Printer Faults

Each printer has its own way of detecting printer faults and transmitting fault signals to the LP print service. The LP print service only checks for hang-ups (loss of carrier) and excessive delays in printing.

Some printers provide good fault coverage and can send a message that describes the reason for a fault. Other printers indicate a fault by using signals other than the signals for loss of carrier signal or shut off of data flow. A filter is required to interpret this additional printer fault information.

A filter can also put a print request on hold, wait for a printer fault to clear, and then resume printing. With this capability, the print request that was interrupted does not need to be reprinted in its entirety. Only a filter that knows the control sequences used by a printer can determine where to break a file into pages. Consequently, only such a filter can find the place in the file where printing should start after a fault is cleared.

When a print filter generates messages, those messages are handled by the LP print service. If alerts are enabled, the LP print service sends alerts to the system administrator. For further information, see Setting Up Printer Fault Alerts by Using LP Print Commands.

Requirements for a Print Filter Program

A print filter can be simple or complex, but it has to meet the following requirements:

If you want the filter to detect printer faults, it should also meet the following requirements:

Creating a Print Filter Definition

A print filter definition tells the LP print service about the filter, what print filter program to run, what kind of conversion the print filter does, and so on. A set of filter descriptor files are provided in the /etc/lp/fd directory. These files describe the characteristics of the filters (for example, fast filter or slow filter), and point to the filter programs (for example, /usr/lib/lp/postscript/postdaisy).

When defining a new print filter, you must create a print filter definition.

A print filter definition contains the following information used by the LP print service:

You can type the characteristics as direct input to the lpfilter command. You also can create a file that specifies the filter's characteristics, and use the file name as input to the lpfilter command arguments. Such a file is called a filter descriptor file and should be located in the /etc/lp/fd directory. These files are not the filters themselves. Rather, these files point to the filters.

Whether you store the information in a file, or type the information directly on the command line, use the following format:


Command: command-pathname [options]
Input types: input-type-list
Output types: output-type-list
Printer types: printer-type-list
Printers: printer-list
Filter type: fast or slow
Options: template-list

Note –

If you provide more than one definition (that is, more than one line) for any filter characteristic other than Options, only the second definition is used by the print service.


The information can be arranged in any order, and not all the information is required. When you do not specify values, the values shown in the following table are assigned by default. These values are not very useful, which is why you should specify values.

Table 8–1 Default Values for lpfilter Command

Item 

Default Value 

Input types 

any

Output type 

any

Printer types 

any

Printers 

any

Filter type 

slow

lpfilter Command

Use the full path of the filter program. If there are any fixed options that the program always needs, include them here.

lpfilter Input Types Argument

Input types is a list of file content types that the print filter can process. The LP print service does limit the number of input types, but most filters can accept only one input type. Several file types can be similar enough, such that the filter can deal with them. You can use whatever names you prefer, with a maximum of 14 alphanumeric characters and dashes. Do not use underscores as part of the input type name.

The LP print service uses these names to match a filter to a file type, so follow a consistent naming convention. For example, if more than one filter can accept the same input type, use the same name for that input type when you specify it for each filter. Inform your users of these names so that they know how to identify the file type when submitting a file for printing.

lpfilter Output Types Argument

Output types is list of file types that the filter can produce as output. For each input type, the filter produces a single output type. The output type can vary, however, from job to job. The name of the output type is restricted to 14 alphanumeric characters and dashes.

The output type names should either match the types of available (local or remote) printers, or match the input types handled by other filters. The LP print service groups filters in a shell pipeline if it finds that several passes by different filters are needed to convert a file. You will unlikely need this level of sophistication, but the LP print service allows it. Try to find a set of filters that takes as input types all the different files the users might want printed, and that converts those files directly into file types the printer can handle.

lpfilter Printer Types Argument

Printer types is a list of the types of printers into which the print filter can convert files. For most printers and filters, you can leave this part of the filter definition blank, because this list is identical to the list of output types. However, this list can be different. For example, you could have a printer with a single printer type for purposes of initialization. However, that printer can recognize several different file content types. Essentially, this printer has an internal filter that converts the various file types into a filter type that it can handle. Thus, a filter might produce one of several output types that match the file types that the printer can handle. The print filter should be marked as working with that printer type.

As another example, you might have two different models of printers that are listed as accepting the same file types. Due to slight differences in manufacture, however, one printer deviates in the results it produces. You label the printers as being of different printer types, say A and B, where B is the printer that deviates. You create a filter that adjusts files to account for the deviation produced by printers of type B. Because this filter is needed only for those printer types, you would list this filter as working only on type B printers.

lpfilter Printers Argument

A print filter normally can work with all printers that accept its output, so you can usually skip this part of the filter definition.

You might, however, have some printers that are inappropriate for the output that the filter produces. For example, you might want to dedicate one printer for fast turnaround, only sending files that require no filtering to that printer. Other printers of identical type can be used for files that need extensive filtering before they can be printed.

lpfilter Filter Type Argument

The LP print service recognizes fast filters and slow filters, as described in Types of Filters.

Slow filters that are invoked by printing modes, by using the lp -y command, must be run on the system from which the print request originated. The LP print service cannot pass values for modes to print servers. It can, however, match a file content type (specified after the -T option of the lp command) to a content type on a print server. Therefore, if you want to activate special modes on a print server, you must specify content types that permit the LP print service to match input types and output types.

lpfilter Options Argument

Options specify how different types of information are converted into command-line arguments to the filter command. This information can include specifications from a user (with the print request), the printer definition, and the specifications implemented by any filters that are used to process the request.

Defining Print Filter Options With Templates

There are 13 sources of information for defining print filter options, each of which is represented by a keyword. Each option is defined in a template. A template is a statement in a filter definition that defines an option to be passed to the filter command, based on the value of one of the filter characteristics

The options specified in a filter definition can include none, all, or any subset of the 13 keywords. In addition, a single keyword can be defined more than once, if multiple definitions are required for a complete filter definition. The following table contains descriptions of the 13 keywords available for defining options in a print filter definition.

Table 8–2 Keywords for Print Filter Options

Option Characteristic

Keyword 

Patterns 

Example 

Content type (input) 

INPUT

content-type

troff

Content type (output) 

OUTPUT

content-type

postscript, impress

Printer type 

TERM

printer-type

att495

Printer name 

PRINTER

printer-name

lp1

Character pitch 

CPI

scaled-decimal

10

Line pitch 

LPI

scaled-decimal

6

Page length 

LENGTH

scaled-decimal

66

Page width 

WIDTH

scaled-decimal

80

Pages to print 

PAGES

page-list

1-5,13-20

Character set 

CHARSET

character-set

finnish

Form name 

FORM

form-name

invoice2

Number of copies 

COPIES

integer

3

Special modes

MODES

mode

landscape

A print filter definition can include more than one template. Multiple templates are entered on a single line and separated with commas, or they are entered on separate lines, preceded by the Options: prefix.

The format of a template is as follows: keywordpattern = replacement

The keyword identifies the type of option being registered for a particular characteristic of the filter.

The pattern is a specific option for the keyword.

The replacement is what happens when the keyword has the noted value.

For an example of how an option is defined for a particular filter, suppose you want to have the print service scheduler assign print requests to filters following this criteria:

To specify these criteria, provide the following templates as options to the lpfilter command:


Options: OUTPUT impress=-I, OUTPUT postscript=-P

If the Options line becomes too long, put each template on a separate line, as follows:


Options: OUTPUT impress=-I
Options: OUTPUT postscript=-P 

In both templates, the keyword is defined as OUTPUT. In the first template, the pattern is impress, and the value of the replacement is --I. In the second template, the value of pattern is postscript, and the value of replacement is -P.

To determine which values to supply for each type of template (that is, for the pattern and replacement arguments for each keyword), consider the following:

The replacement option shows how the value of a template should be given to the filter program. This part typically a literal option, sometimes with the placeholder asterisk (*) included to show where the value goes. The pattern and replacement options also can use the regular expression syntax of the ed command for more complex conversion of user input options into filter options. All regular expression syntax of ed is supported, including the \( ... \) and \n constructions. These constructions can be used to extract portions of the pattern option for copying into the replacement option, and the & option, which can be used to copy the entire pattern option into the replacement option. For more information, see the ed(1) man page.


Note –

If a comma or an equal sign (=) is included in a pattern or a replacement option, precede it with a backslash (\). A backslash in front of any of these characters is removed when the pattern or replacement option is used.


ProcedureHow to Create a New Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Create a print filter program.

    For information on print filter programs, see Writing a Print Filter Program. By convention, filter programs for PostScript printers are located in the /usr/lib/lp/postscript directory. You should put programs you create under the /usr/lib/lp directory in a directory of your choosing.

  3. Create a print filter definition.

    For information on print filter definitions, see Creating a Print Filter Definition. You should save the print filter definition in a text file. By convention, filter definitions are located in the /etc/lp/fd directory and are identified with the .fd suffix.

  4. Add the print filter to a print server.

    For instructions, see How to Add a Print Filter.


Example 8–7 Creating a New Print Filter

This example shows a print filter definition that is used to convert N37 or Nlp to simple.


Input types: N37, Nlp, simple
Output types: simple
Command: /usr/bin/col
Options: MODES expand = -x
Options: INPUT simple = -p -f

In this example, the print filter program is named col. Once you add the new print filter to a print server, a user's print requests are handled as follows:

When a user types the following command:


$ lp -y expand report.doc

The print filter program is run with the following arguments to convert the file:


/usr/bin/col -x -p -f

When a user types the following command:


$ lp -T N37 -y expand report.doc

The print filter program is run with the following arguments to convert the file:


/usr/bin/col -x


Example 8–8 Creating a New Print Filter by Converting One Input Type to Another Output Type

This example shows a print filter definition that is used to convert from troff to a PostScript file.


Input types: troff
 Output types: postscript
 Printer types: PS
 Filter type: slow
 Command: /usr/lib/lp/postscript/dpost
 Options: LENGTH * = -l*
 Options: MODES port = -pp, MODES land = -pl
 Options: MODES group \=\([1-9]\) = -n\l

In this example, the filter program is named dpost. The filter program takes one input type, troff, produces a postscript output, and works with any printer of type PS (PostScript). Users need to give just the abbreviation port or land when they ask for the paper orientation to be in either portrait mode or landscape mode. Because these options are not intrinsic to the LP print service, users must specify them by using the lp -y command.

After you add the new print filter to a print server, print requests will be handled as follows:


Administering Print Filters

Print filters are programs that convert the content type of a file to a content type that is acceptable to the destination printer.

The LP print service uses filters to complete the following tasks:

Not every print filter can perform all these tasks. Because each task is printer-specific, the tasks can be implemented separately.

The LP print service provides the PostScript filters listed in Table 8–3. The filter programs are located in the /usr/lib/lp/postscript directory. For PostScript printing, you usually only need to install the filter programs when setting up a print server. Solaris Print Manager automatically enables the supplied filters. However, if you administer other printers, you might need to administer print filters for them.

Creating Print Filters

To create a new print filter, you must write a print filter program and create a print filter definition. Filters contain input types, output types, and complex options that provide a language to process command-line arguments within the filter. For more information and step-by-step instructions, see Creating a New Print Filter.

Adding, Changing, Deleting, and Restoring Print Filters

Print filters are added, changed, deleted, or restored on the print server only.

You can use the lpfilter command to manage the list of available filters. System information about filters is stored in the /etc/lp/filter.table file. The lpfilter command gets the information about filters to write to the table from filter descriptor files. The filter descriptor files that are supplied (PostScript only) are located in the /etc/lp/fd directory. The actual filter programs are located in the /usr/lib/lp directory.

The LP print service imposes no fixed limit on the number of print filters you can define. You can remove filters that are no longer used to avoid extra processing by the LP print service. (LP examines all filters to find a filter that works for a specific print request.) If in doubt, do not remove a filter.

As you add, change, or delete filters, you can overwrite or remove some of the original filters provided by the LP print service. You can restore the original set of filters, if necessary. You can also remove any filters you have added.

SunOS software provides a default set of PostScript filters. Solaris Print Manager automatically adds these filters to a print server. Some of the TranScript filters used with LPD-based print services have SunOS equivalents, but other TranScript filters do not. The following table lists the default PostScript filters and identifies the equivalent TranScript filters, where applicable.

Table 8–3 Default PostScript Filters

PostScript Filter 

Action 

TranScript Equivalent 

download

Used to download fonts 

 

dpost

Changes ditroff to PostScript

psdit

postdaisy

Changes daisy to PostScript

 

postdmd

Changes dmd to PostScript

 

postio

Used for serial interface for PostScript printer 

pscomm

postior

Used to communicate with printer 

 

postmd

Changes matrix gray scales to PostScript 

 

postplot

Changes plot to PostScript

psplot

postprint

Changes simple to PostScript

enscript

postreverse

Used to reverse or select pages 

psrev

posttek

Changes TEK4014 to PostScript

ps4014

The SunOS software does not provide the following filters:

The postreverse, postprint, postio, and dpost filters are provided in place of Enscript.

Solaris Print Manager adds the default PostScript filters to a print server. If you have printing needs that are not met by these filters, see How to Create a New Print Filter. This section provides information about writing a custom print filter.

ProcedureHow to Add a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Add a print filter that is based on a print filter definition.


    # lpfilter -f filter-name -F filter-definition
    
    -f filter-name

    Specifies the name you choose for the print filter.

    -F filter-definition

    Specifies the name of the print filter definition.

    For more information, see the lpfilter(1M) man page.

    The print filter is added in the print server's /etc/lp/filter.table file.

  3. Verify that the print filter was added.


    # lpfilter -f filter-name -l
    

Example 8–9 Adding a Print Filter

The following example shows how to add the daisytroff print filter that has the daisytroff.fd print filter definition.


# lpfilter -f daisytroff -F /etc/lp/fd/daisytroff.fd

ProcedureHow to Delete a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Delete the print filter.


    # lpfilter -f filter-name -x
    
    -f
    filter-name

    Specifies the name of the print filter to be deleted.

    -x

    Deletes the specified filter.

    The print filter is deleted from the print server's /etc/lp/filter.table file.

  3. Verify that the filter was deleted.


    # lpfilter -f filter-name -l
    

    You should receive an error indicating that no filter by the specified name exists.


Example 8–10 Deleting a Print Filter

The following example shows how to delete the daisytroff print filter.


# lpfilter -f daisytroff -x

ProcedureHow to View Information About a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Request information about a print filter.


    # lpfilter -f filter-name -l
    
    -f

    Specifies the print filter for which you want to view information. Specify all for filter-name to view information about all available print filters.

    -l

    Displays information about the specified filter.

    Information about the specified print filter or filters is displayed.


Example 8–11 Viewing Information About a Print Filter

This example shows how to request information for the postdaisy print filter. Sample command output follows.


# lpfilter -f postdaisy -l
Input types: daisy
Output types: postscript
Printer types: any
Printers: any
Filter type: slow
Command: /usr/lib/lp/postscript/postdaisy
Options: PAGES * = -o*
Options: COPIES * = -c*
Options: MODES group = -n2
Options: MODES group\=\([2-9]\) = -n\1
Options: MODES portrait = -pp
Options: MODES landscape = -pl
Options: MODES x\=\(\-*[\.0-9]*\) = -x\1
Options: MODES y\=\(\-*[\.0-9]*\) = -y\1
Options: MODES magnify\=\([\.0-9]*\) = -m\1


Example 8–12 Viewing Information About All Print Filters on a System

This example shows how to display all the print filters that have been added to the system. Sample command output follows.


# lpfilter -f all -l | grep Filter
(Filter "download")
Filter type: fast
(Filter "postio")
Filter type: fast
(Filter "postior")
Filter type: fast
(Filter "postreverse")
Filter type: slow


Example 8–13 Redirecting Information About a Print Filter

This example shows how to redirect information about the daisytroff filter to a file. This task is useful if a filter definition is removed unintentionally.


# lpfilter -f daisytroff -l > daisytroff.fd

Administering Forms (Task Map)

Task 

Description 

For Instructions 

Create a new form definition. 

Provide a new form definition by specifying information for nine required printer characteristics. 

How to Create a New Printer Form Definition

Limit user access to a form. 

Control user access to printers and forms that are available on the network. 

How to Limit User Access to a Form

Add a form. 

Add the definition of a form to the list of available forms, so that the LP print service can recognize the form. 

How to Add a Form

Delete a form. 

Remove the definition of a form from the list of available forms that are recognized by the LP print service. 

How to Delete a Form

Mount a form. 

Use the mount command to notify the LP print service to accept print requests for a form with a specific definition.

How to Unmount and Mount a Form

Set an alert to mount a form. 

Set alerts for forms that are mounted to a printer. 

How to Set an Alert to Mount a Form

View information about a form. 

View form names and other form information by listing the contents of the /etc/lp/forms directory.

How to View Information About a Form

View the current status of a form. 

Use the lpforms command to display the current status of a form.

How to View the Current Status of a Form

Limit printer access to a form. 

Control what forms printers have access to. 

How to Limit Printer Access to a Form

Creating a New Printer Form

When you want to provide a new form, you must define its characteristics by specifying information for nine required printer characteristics (such as page length and page width) as input to the lpforms command.

The LP print service uses this information to perform the following tasks:

The form name can be anything you choose, as long as it does not contain more than 14 alphanumeric characters or any underscores. The information must use the following format:


Page length: scaled-number
Page width: scaled-number
Number of pages: integer
Line pitch: scaled-number
Character pitch: scaled-number
Character set choice: character-set-name [,mandatory]
Ribbon color: ribbon-color
Comment:
informal notes about the form
Alignment pattern: [content-type] alignment pattern

The optional word [,mandatory], means that the user cannot override the character set choice in the form. The content-type can be given, although this information is optional, with an alignment pattern. If this value is given, the print service uses it to determine, as necessary, how to filter and print the file.

Aside from following two exceptions, the information can appear in any order:

Not all of the information must be given. When you do not specify values, the default values in the following table are assigned. Before running the lpforms command, gather the following information about the new form that is described in this table.

Table 8–4 Default Values for Printer Forms

Value 

Default 

Description 

Page length 

66 lines 

The length of the form, or the length of each page in a multipage form. This information can be the number of lines, or the size in inches or centimeters. 

Page width 

80 columns 

The width of the form, in characters, inches, or centimeters. 

Number of pages 

The number of pages in a multipage form. The LP print service uses this number with a print filter (if available) to restrict the alignment pattern to a length of one form. See the description of alignment pattern below. If no filter is available, the LP print service does not truncate the output. 

Line pitch 

6 lines per inch 

A measurement of how close lines appear on the form. Line pitch is also called leading. Character pitch is the distance between two lines, from baseline to baseline, measured by either lines per inch or lines per centimeter.

Character pitch 

10 characters per inch 

A measurement of how close together characters appear on the form. It is the distance between characters, measured by either characters per inch or characters per centimeter. 

Character set choice 

Any 

The character set, print wheel, or font cartridge that should be used when this form is used. Users can choose a different character set for their own print requests when using this form. Or, you can require that only one character set be used. 

Ribbon color 

Any 

If the form should always be printed using a certain color ribbon, the LP print service can give a mount alert message indicating which color to use. 

Comment  

(No default) 

Any remarks that might help users understand the form. For example, the remarks could indicate the name of the form, its revision, its purpose, or restrictions on its use. 

Alignment pattern

(No default) 

A sample file that the LP print service uses to fill one blank form. When mounting the form, you can print this pattern on the form to align it properly. You can also define a content type for this pattern so that the print service knows how to print it. 


Note –

The LP print service does not try to mask sensitive information in the alignment pattern. If you do not want sensitive information printed on sample forms, for example when you align checks, then you should mask the appropriate data. The LP print service keeps the alignment pattern stored in a safe place, where only users logged in as superuser or lp user can read it.


When you have gathered the information for the form, specify it as input to the lpforms command. You should record this information first in a separate file so that you can edit it before specifying it with the lpforms command. You can then use the file as input instead of typing each piece of information separately after a prompt.

ProcedureHow to Create a New Printer Form Definition

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Create a form definition file.

    For a description on creating printer forms, see Creating a New Printer Form. You should save the printer definition in a text file.

  3. Add the form to the LP print service.


    # lpadmin -p printer-name -M -f form-name
    
  4. Add the form to a print server.

    For instructions, see How to Add a Form.

Administering Forms

A form is a sheet of paper on which information is printed in a predetermined format. Unlike plain paper stock, forms usually have text or graphics preprinted on them. Common examples of forms are company letterhead, invoices, blank checks, receipts, and labels.

The term form has two meanings: the physical medium (the paper) and the software that defines a form to the LP print service.

The LP print service allows you to control the use of forms. This section provides information about adding, changing, deleting, mounting, and limiting access to forms.

Adding, Changing, or Deleting Forms

When you add a form, you tell the LP print service to include the form in its list of available forms. You also have to supply the information required to describe or define the form. Although you can specify such definitions when you add the form, it helps to create the definitions first and save them in files. You can then change the form definition by editing the file.


Note –

No form definitions are supplied with the LP print service.


To change a form, you must re-add the form with a different definition.

The LP print service imposes no limit on the number of forms you can define. However, you should delete forms that are no longer appropriate. Obsolete forms can result in unnecessary processing by the print service.

ProcedureHow to Add a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Add a form that is based on a form definition.


    # lpforms -f form-name -F /etc/lp/forms/form
    
    -f

    Specifies the name you choose for the form

    -F /etc/lp/forms/ form

    Specifies the name of the form definition.

    For more information, see the lpforms(1M) man page.

    The form is added to the print server's /etc/lp/forms/form-name/describe file.

  3. Verify that the form was added by checking the output of the following command:


    # lpforms -f form-name -l
    

Example 8–14 Adding a Form

The following example shows how to add the medical form that uses the medical.fmd form definition.


# lpforms -f medical -F /etc/lp/forms/medical.fmd

See Also

Before the form can be used, one or more printers must be given access to the form. For more information, see How to Limit Printer Access to a Form.

ProcedureHow to Delete a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Delete the form.


    # lpforms -f form-name -x
    
    -f

    Is the form to be deleted.

    -x

    Deletes the specified form

    The form is deleted from /etc/lp/forms/form-name file.

    For more information, see the lpforms(1M) man page.

  3. Verify that the form was deleted.


    # lpforms -f form-name -l
    

    You should receive an error indicating that a form by the specified name does not exist.


Example 8–15 Deleting a Form

The following example shows how to delete the medical form.


# lpforms -f medical -x

Mounting Forms

To print a form, you must load the paper in the printer and use a command to mount the form. This command notifies the LP print service that print requests submitted to the printer are to be printed using the form definition.

If you use one printer for different types of printing, including forms, you should do the following:

When you mount a form, ensure that it is aligned properly. If an alignment pattern has been defined for the form, you can request that the pattern print repeatedly after you have mounted the form. Let the pattern print repeatedly until you have adjusted the printer so the alignment is correct.

When you want to change or discontinue using a form on a printer, you must notify the LP print service by unmounting the form.

ProcedureHow to Unmount and Mount a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Stop accepting print requests on the printer on which you are unmounting the current form.


    # reject printer-name
    

    printer-name is the name of the printer on which you are unmounting a form.

    New print requests (which might not require the form) are not allowed to enter the printer's queue.

  3. Unmount the current form.


    # lpadmin -p printer-name -M -f none
    

    In this command, the variable printer-name is the same variable that is used in Step 2.

    The current form is deleted from the print server's /etc/lp/printers/printer-name/configuration file.

  4. Remove the form paper from the printer.

  5. Load the new form paper for the next print request.

  6. Mount the form.


    # lpadmin -p printer-name -M -f form-name[-a -o filebreak]
    -p

    Specifies the printer on which you are mounting a form.

    -M

    Specifies the name of the form to be mounted.

    -a -o filebreak

    Optionally enables you to print a copy of the alignment pattern defined for the form, if this definition exists.

    -p printer-name

    Printer on which you are mounting a form.

    -M -f form-name

    Name of the form to be mounted.

    The specified form is added in the print server's /etc/lp/printers/printer-name/configuration file.

  7. Start accepting print requests on the printer.


    # accept printer-name
    

    The printer is ready to print the form you just mounted.

  8. Verify that the form has been mounted.


    # lpstat -p printer-name -l
    

    Otherwise, submit a print request that requires the new form and check the printer for output.


Example 8–16 Unmounting a Form

The following example shows the process of unmounting the currently mounted form on the printer luna.


# reject luna
destination "luna" will no longer accept requests
# lpadmin -p luna -M f none
# accept luna
destination "luna" now accepting requests


Example 8–17 Mounting a Form

The following example shows the process of mounting the medical form on the printer luna.


# reject luna
destination "luna" will no longer accept requests
# lpadmin -p luna -M f medical -a -o filebreak
# accept luna
destination "luna" now accepting requests

Tracking Forms

The LP print service helps you track which forms are mounted on each printer. The print service also notifies you when it cannot find a description it needs to print a form. You are responsible for creating form descriptions, and mounting and unmounting form paper in each printer. You complete this task either as part of setting up a printer or in response to alerts from the LP print service.

Users can specify the form on which they want a job to print. As superuser, you can mount a specific form, then tell the LP print service that the form is available and on which printer it is mounted. Users can submit print requests specifying a particular form. When the LP print service receives the request, it sends an alert message to root requesting that you mount the form.

Defining Alerts for Mounting Forms

You request alerts for mounting forms in the same way that you request other alerts from the LP print service. For general information about alerts, see Setting Up Printer Fault Recovery by Using LP Print Commands.

ProcedureHow to Set an Alert to Mount a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Set a request alert for mounting a form.


    # lpforms -f form-name -A alert [-Q requests] [-W minutes]
    -f

    Specifies the form for which you want to set a request alert.

    -A alert

    Specifies what kind of alert will occur when a form is requested. Some valid values are mail, write, and quiet. If you choose mail or write, a predefined alert message says to mount the specified form. The message includes names of one or more printers that have been set up to use the form.

    -Q requests

    Specifies how many print requests that require the form must be in the queue to trigger an alert. If you don't specify this option, an alert occurs with just one print request in the queue.

    -W minutes

    Specifies how often (in minutes) the alert will occur. If you don't specify this option, the alert is sent one time.

    The request alert is added to the print server's /etc/lp/forms/form-name/alert.sh file.

  3. Verify that the alert has been added for the form.


    # lpforms -f form-name -A list
    

    Alternately, if you have set a low number of print requests to trigger the alert, submit print requests to meet the minimum requirement. Ensure that you receive an alert to mount the form.


Example 8–18 Setting an Alert to Mount a Form

This example shows how to set email alerts to occur every 5 minutes for the letterhead form when 10 print requests for letterhead reside in the print queue.


# lpforms -f letterhead -A mail -Q 10 -W 5


Example 8–19 Setting a Console Window Alert

This example shows how to set console window alerts to occur every 10 minutes for the letterhead form when 5 requests for letterheadreside in the print queue.


# lpforms -f letterhead -A write -Q 5 -W 10


Example 8–20 Setting up No Request Alerts

This example shows how to set no request alerts for the invoice form.


# lpforms -f invoice -A none

Checking Forms

When you have defined a form for the LP print service, you can check the form with either of two commands. Which command you choose depends on the type of information you want to check.

If you are not sure about the name of an existing form, you can view the form names by listing the contents of the /etc/lp/forms directory.

ProcedureHow to View Information About a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Request information about a form.


    # lpforms -f form-name -l
    
    -f

    Specifies the form for which you want to view information. Specify all for form-name to view information about all the available forms.

    -l

    Lists the specified form.

    Information about the specified form or forms is displayed.


Example 8–21 Viewing Information About a Form

The following example shows how to display information about the medical form.


# lpforms -f medical -l
Page length: 62
Page width: 72
Number of pages: 2
Line pitch: 6
Character pitch: 12
Character set choice: pica
Ribbon color: black
Comment:
Medical claim form

The following example shows how to redirect the information about the medical form to a file. This command creates the form definition for the form. This command is useful if a form definition is removed unintentionally.


# lpforms -f medical -l > medical.fmd

ProcedureHow to View the Current Status of a Form

  1. Log in on the print server.

  2. Request information about the current status of a form.


    $ lpstat -f form-name
    

    The -f option specifies the form for which you want to view the current status. Specify all for form-name to view the current status of all the forms.

    Information about the current status of the specified form or forms is displayed.


Example 8–22 Viewing the Current Status of a Form

This example shows how to display the status of the medical form.


$ lpstat -f medical
form medical is available to you

Limiting Access to Forms

You can control which printers and which users have access to some or all of the forms available on the network. For example, you might want only the people in the payroll or accounts payable department to be able to print check forms. In addition, you might want the check forms to be available only on certain printers.

For more information, see How to Limit User Access to a Form. To limit printer access to a form, see How to Limit Printer Access to a Form.

ProcedureHow to Limit User Access to a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Allow or deny users access to a form.


    # lpforms -f form-name -u allow:user-list | deny:user-list
    
    -f

    Specifies the name of the form for which the allow user access lists or the deny user access list is being created.

    -u allow:user-list

    Represents users to be added to the allow user access list. Use a comma or a space to separate user login IDs. If you use spaces, enclose the list of IDs in quotation marks.

    Table 5–5 provides the valid values for user-list.

    -u deny:user-list

    Represents users to be added to the deny user access list. Use a comma or a space to separate user login IDs. If you use spaces, enclose the list of IDs in quotation marks. Table 5–5 provides the valid values for user-list.

    The specified users are added to the appropriate user access list for the specified form in one of the following files on the print server:

    • /etc/lp/forms/form-name/allow

    • /etc/lp/forms/form-name/deny

  3. Verify that the allow user access list and deny user access list are set up correctly.


    # lpforms -f form-name -l
    

Example 8–23 Allowing User Access to a Form

This example shows how to allow only the users nathan and marcia access to the check form.


# lpforms -f check -u allow:nathan,marcia


Example 8–24 Denying User Access to a Form

This example shows how to deny users jones and smith access to the dental form.


# lpforms -f dental -u deny:jones,smith

ProcedureHow to Limit Printer Access to a Form

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Allow or deny use of forms on a printer.


    # lpadmin -p printer-name -f allow:form-list | deny:form-list
    
    -p

    Specifies the name of the printer for which the allow forms list or deny forms list is being created.

    -f allow: form-list

    Specifies the form name to be added to the allow list. Use a space or a comma to separate multiple form names. If you use spaces to separate form names, enclose the list of form names in quotation marks.

    -f deny: form-list

    Is the form name to be added to the deny list. Use a space or a comma to separate multiple form names. If you use spaces to separate form names, enclose the list of form names in quotation marks.

    The specified form or forms are added to the allow forms list or the deny forms list in one of the following files on the print server:

    • /etc/lp/printers/printer-name/form.allow

    • /etc/lp/printers/printer-name/form.deny

  3. Verify that the allow forms list and the deny forms list are set up correctly.


    # lpstat -p printer-name -l
    

Example 8–25 Allowing Printer Access to a Form

This example shows how to allow the printer luna to access only the medical, dental, and check forms.


# lpadmin -p luna -f allow:medical,dental,check


Example 8–26 Limiting Printer Access to a Form

This example shows how to deny the printer luna from accessing the medical, dental, and check forms.


# lpadmin -p luna -f deny:"medical dental check"

Administering Fonts (Task Map)

Task 

Description 

For Instructions 

Install downloaded PostScript fonts. 

Permanently download a font if most print requests serviced by the printer use that font. To avoid transmitting fonts across the network, add all the printer-resident fonts. 

How to Install Downloaded PostScript Fonts

Install host-resident PostScript fonts. 

Install host-resident fonts on a system that is shared by many users. Use this method when numerous fonts are available, or when these fonts are not used by all print requests. 

How to Install Host-Resident PostScript Fonts

Administering Fonts

If you have a laser printer, you might need to install and maintain PostScript fonts. For many printers, the fonts are set up as part of the printer installation process.

PostScript fonts are stored in outline form, either on the printer or on a system that communicates with the printer. When a document is printed, the PostScript interpreter generates each character as needed in the appropriate size from the outline description of it. If a font required for a document is not stored on the printer being used, the font must be transmitted to that printer before the document can be printed. This transmission process is called downloading fonts.

Fonts are stored and accessed in several ways:

Managing Printer-Resident Fonts

Most PostScript printers come equipped with fonts that are resident in the printer ROM. Some printers have a disk on which additional fonts are stored. When a printer is installed, you should add the list of printer-resident fonts to the font list for that printer. By identifying printer-resident fonts, you prevent fonts from being transmitted unnecessarily across a network. Each printer has its own list of resident fonts, which is contained in this file:


/etc/lp/printers/printer-name/residentfonts

When the printer is attached to a print server, ensure that the list in the residentfonts file includes fonts that are on the print server. The file must also include fonts that are available for downloading to the printer.

You must edit the files that contain the list of printer-resident fonts by using a text editor such as vi.

Downloading Host-Resident Fonts

When a PostScript document contains a request for fonts not loaded on the printer, the download filter manages this request. The download filter uses PostScript document structuring conventions to determine which fonts to download.

LP print filters are either fast or slow. A fast filter quickly prepares a file for printing. Also, a fast filter must have access to the printer while the filter is processing. A slow filter takes longer to convert a file. However, a slow filter does not need to access the printer while the filter is processing. An example of a slow filter is a filter that converts an ASCII document to a PostScript document.

The download filter is a fast filter. This filter downloads fonts automatically if the fonts are on the print server. The download filter can also be used to send fonts to a print server. To do so, you can create a new filter table entry that calls the download filter as a slow filter by using the lp -y command. Alternatively, you can force selection of this filter by changing the input type.

The download filter performs five tasks:

  1. The filter searches the PostScript document to determine which fonts are requested. These requests are documented with the following PostScript structuring comments: %%DocumentFonts: font1 font2 … in the header comments.

  2. The download filter searches the list of printer-resident fonts to determine if the requested font must be downloaded.

  3. If the font is not resident on the printer, the download filter searches the host-resident font directory table to determine if the requested font is available. This filter performs this search by getting the appropriate file name from the map.

  4. If the font is available, the download filter takes the file for that font and appends it to the file to be printed.

  5. The download filter sends the font definition file and the source file to the PostScript printer. The source file is the file to be printed.

Installing and Maintaining Host-Resident Fonts

Some fonts reside on the host system and are transmitted to the printer as needed for particular print requests. As the administrator, you make PostScript fonts available to all users on a system. To do so, you must know how and where to install these fonts. Because fonts are requested by name and stored in files, the LP print service keeps a map file. A map file shows the correspondence between the names of fonts and the names of the files that contain those fonts. Both the map file and the font list must be updated when you install host-resident fonts.

The fonts available for use with PostScript printers are stored in directories that you create. These directories are called /usr/share/lib/hostfontdir/typeface/font. The variable typeface is replaced by a name, such as palatino or helvetica. The variable font is replaced by a an attribute name, such as bold or italic.

ProcedureHow to Install Downloaded PostScript Fonts

  1. Log in as superuser, lp user, or assume an equivalent role on the print server or print client.

  2. Change directory to the /etc/lp/printers/printer-name directory.


    # cd /etc/lp/printers/printer-name
    

    The variable printer-name specifies the name of the printer on which you want to install downloaded PostScript fonts.

  3. Create the residentfonts file, if this file does not already exist.


    # touch residentfonts
    

    This file might not exist if you are adding permanently downloaded fonts for the first time.

  4. Edit the residentfonts file. Add all the printer-resident fonts and the fonts to be permanently downloaded.

ProcedureHow to Install Host-Resident PostScript Fonts

  1. Log in as superuser, lp, or assume an equivalent role on the print server or print client.

  2. Create the hostfontdir directory.


    # cd /usr/share/lib
    
    1. Change to the /usr/share/libdirectory.


      # cd /usr/share/lib
      
    2. Create the hostfontdir directory, if this directory does not already exist.


      # mkdir hostfontdir
      
    3. Change the permissions on the hostfontdir directory to 775.


      # chmod 775 hostfontdir
      
  3. Create a directory for a new typeface, if the directory does not already exist.


    # mkdir typeface
    
  4. Copy the font file to the appropriate directory.


    # cp filename /usr/share/lib/hostfontdir/typeface/font
    
  5. Add to the map file the name of the font and the name of the file in which it resides.

    1. Change to the /usr/share/lib/hostfontdir directory.

    2. Edit the map file by using a text editor such as the vi editor.

      Add a one-line entry for each font that you want to add to the file. Put the font name first, followed by a space, followed by the name of the file where the font resides. For example:


      Palatino-Bold /usr/share/lib/hostfontdir/palatino/bold
      
    3. Save the file.

      When an example entry exists in the map file on the appropriate system, users can apply the font (for example, Palatino Bold) to their print jobs. When users submit a print request that contains this font, the LP print service appends a copy of the /usr/share/lib/hostfontdir/palatino/bold file to that file before sending it to the printer.

  6. If you are using the troff program, you must create new width tables for this font in the standard troff font directory.