Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 7

Print Filter Enhancement With mp

This chapter describes print enhancement with mp. It discusses the following topics:

Printing for UTF-8

An enhanced mp(1) print filter is available in the Solaris 9 environment that can print various input file formats including flat text files written in UTF-8. It uses TrueType and Type 1 scalable fonts and X11 bitmap fonts available on the Solaris system. It can also make use of printer resident fonts and can act as an X print server client.

The output from the utility is standard PostScript and can be sent to any PostScript printer. mp(1) can also output any page description language when working as an X Print server client, mp is supported by the print server.

To use the utility, type the following:

system% mp filename | lp

You can also use the utility as a filter, since the utility accepts stdin stream
system% cat filename | mp | lp 
:

You can set the utility as a printing filter for a line printer. For example, the following command sequence tells the printer service LP that the printer lp1 accepts only mp format files. This command also installs the printer lp1 on port /dev/ttya. See the lpadmin(1M) man page for more details.

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

Using lpfilter(1M), you can add the utility for a filter as follows:

system# lpfilter -f lp1 -F pathname 

The command tells LP that a converter (in this case, mp) is available through the filter description file named pathname. pathname contains the following:
Input types: simple 
Output types: MP
Command: /usr/bin/mp

The filter converts the default type file input to PostScript output using /usr/bin/mp.

To print a UTF-8 text file, use the following command

system% lp -T MP UTF-8-file

Refer to the mp man page for more detail.

mp Print Filter Enhancement Overview

The mp print filter is enhanced in the Solaris 9 release. The latest mp can work internally in three different modes to produce the output file in a locale to print international text. The available modes are:

  • mp working with locale-specific font configuration file mp.conf.

  • mp working with locale-specific PostScript prolog file prolog.ps.

  • mp working as an Xprt (X Print Server ) client.

The following sections describe when to use a specific printing method and which configuration and supporting files are used by mp for these printing methods.

Using mp with the Locale Specific Font Configuration File mp.conf

If the -D or -P option is not given in the command line, this printing method is the default method, unless the prolog.ps file is present in either of the/usr/openwin/lib/locale/$LANG/print or /usr/lib/lp/locale/$LANG/mp directories. The prolog.ps file forces mp to print using PostScript embedded fonts in the file. Even if a prolog.ps exists in a locale, using the -M option ignores the prolog.ps file and uses a mp.conf file, if it exists, instead.

This method uses the /usr/lib/lp/locale/$LANG/mp/mp.conf font configuration file. You may not need to change this file unless you need to print using alternate fonts. This file can be configured with TrueType, Type 1 or .pcf fonts. /usr/lib/lp/locale/C/ contains .ps print page layout files common for this mode of printing as well as the next method. A description of how to customize these files is provided in "Customizing Existing prolog Files and Adding New prolog Files".

Using mp With the Locale-specific PostScript Prologue Files

If the -D or -P option is not given in the command line, and /usr/openwin/lib/locale/$LANG/print/prolog.ps exists, then the prolog.ps file is prepended to the output. Depending upon the print style of the .ps prolog page, the layout file is also prepended to the output.

This method of printing makes use of PostScript font files only. Customization of prolog.ps files is described in "Using mp as an Xprt (X Print Server) Client".

Using mp as an Xprt (X Print Server) Client

This support enables mp to print output for any printer connected to the network supported by an X Print Server. PostScript and many versions of PCL are also supported with this command.

If either the -D or -P command opton is used, and no XPDISPLAY variable is set in your environment, the print server startup script starts an Xprt server at port 2100 in the machine in which the client is running. The script also terminates the print server after mp completes. If XPDISPLAY is set, the mp client tries to contact the print server running at XPDISPLAY. In this case, no attempt is made to start the server if it is not running.

.The /usr/lib/lp/locale/C/mp directory contains .xpr print page layout files for mp working as the Xprt client. These are sample files created for 300 dpi printers. If the target printer has a different dpi value, the dpi value will automatically be converted to the target printer's resolution.

Localization of the Configuration File

Configuration files provide the flexibility for adding or changing font entries, or font group entries.

The system default configuration file /usr/lib/lp/locale/$LANG/mp/mp.conf where $LANG is a locale environment variable in the locale in which printing occurs. Users can have a personal configuration file that can be specified by the -u config.file path option.

A ligature or variant glyph that has been encoded as a character for compatibility is called a presentation form. The mp.conf file is used mainly for mapping the intermediate code points in a locale to the presentation forms in the encoding of the font that is used to print that code point.

Intermediate code points can either be wide characters, or output of the Portable Layout Services (PLS) layer. Complex Text Layout printing requires that the intermediate code points be PLS output. The default intermediate code generated by mp(1) is PLS output.

Font formats currently supported are Portable Compiled Format (PCF), TrueType, and Type1 format. Both system-resident and printer-resident Type1 fonts are supported. Keep in mind the following about the format and contents of the mp.conf configuration file:

  • Lines must begin with a valid keyword (directive).

  • Arguments to a keyword must appear on the same line as the keyword.

  • Lines that begin with a # character are treated as comments until the end of the line.

  • Numeric arguments that begin with 0x are interpreted as a hexadecimal number.

The different sections in the mp.conf file include:

  • Font aliasing

  • Font group definition

  • Mapping from the intermediate code ranges to the font group in a locale

  • Associating each font with the shared object that maps the intermediate code points to the presentation forms in the font encoding

 
 
 
  Previous   Contents   Next