System Administration Guide: Advanced Administration

Managing Character Sets

Printers differ in the method 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, and 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, using either print wheels, font cartridges, or preprogrammed selectable character sets. Usually, only one of these printing methods applies to a given printer type.

Print wheels and font cartridges, from the perspective of the LP print service, are similar, because someone must intervene and mount the hardware on the printer, when needed. Character sets that require you to physically mount a wheel or cartridge are referred to as hardware character sets. Character sets that do not require hardware mounting, that come preprogrammed with the printer, and can be selected by a print request, 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:


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. You can repeat the command, using -1, -2, -3, and so on in place of the -0, to display the names of the other character sets. 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 used in the manufacturer's documentation for the printer. Because manufacturers do not all use the same character set names, the terminfo character set names can differ from one printer type to the next.

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.


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.


Note –

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


Hardware-Mounted 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 names you want to use for the available print wheels, and how you want to be alerted when a printer needs a different print wheel. Then, when a user requests a particular character set with the lp -S command, the scheduler sends an alert to mount the print wheel, and 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 cartridges for a printer, the LP print service assumes that the printer has a single, fixed print wheel or cartridge, and users cannot specify a special print wheel or cartridge when using the printer.

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

The names you choose for print wheels or cartridges, however, 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 or cartridges, or selectable character sets. That way, users can ask for a font style (character set) without regard to which printer—or even whether a print wheel or cartridges—or selectable character set will be used.

Of course, you and the printer users should agree on the meanings of print wheel or 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, such as print wheels or print cartridges, that provide a particular font or character set. 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 Cartridges

You request alerts for mounting print wheels or cartridges in the same way you request other alerts from the LP print service. For general information about alerts, see Setting Up Printer Fault Alerts.

How to Define a Print Wheel or Font Cartridge

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

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


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

    -p printer-name

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

    -s hard-charset

    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 quotes. 

    Define names that are meaningful to users, and inform the users of the names. 

    The print wheel or font cartridge definition is added 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 those in Step 2.

    The print wheel or font cartridge definition is added in 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 information following the Character sets heading in the following output is correct on both the print server and the print client.


    $ lpstat -p printer-name -l
    

Example—Defining a Print Wheel

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


asteroid# lpadmin -p luna -S pica

How 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 in the printer.


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

    -p printer-name

    Printer on which you are unmounting a print wheel or font cartridge. 

    -M -S none

    Specifies unmounting the current print wheel or font cartridge. 

    For more information, see lpadmin(1M).

    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

    Printer on which you are mounting a print wheel or font cartridge. 

    -M -S hard-charset

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

    The print wheel or font cartridge is added in 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 that 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—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

How 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

    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–3. 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 and includes the names of one or more printers that have been set up to use such a print wheel or 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 will occur. If you don't specify this option, the alert is sent only once. 

    For more information, see lpadmin(1M).

    The alert is added in 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
    

    Otherwise, if you have set a low number of print requests to trigger the alert, submit enough print requests to meet the minimum requirement and make sure you receive an alert to mount the print wheel or font cartridge.

Examples—Setting an Alert to Mount a Print Wheel or Font Cartridge

The following example shows how to set email alerts to occur every five minutes for the elite print wheel when there are ten print requests for elite in the print queue.


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

The following example shows how to set email alerts to occur every minute for the finnish font cartridge when there are five print requests for finnish in the print queue.


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

The following example show how to set console-window alerts to occur every 10 minutes for the elite print wheel when there are five print requests for elite in the print queue.


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

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


# lpadmin -S elite -A none

How 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

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

    n

    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 tput(1).

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


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

    -p printer-name

    Printer on which you are setting up aliases for selectable character sets. 

    -S select-charset

    Selectable character set name for which to set an alias. The name can be found in Step 2.

    alias

    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 quotes. 

    The alias is added in 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 those in Step 3.

    The alias is added in 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. Verify that the selectable character set alias is listed in the output of the following command on the print server and print clients.


    $ lpstat -p printer-name -l
    

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

Example—Setting Up an Alias for a Selectable Character Set

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


# 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