University of Exeter IT Services

Using PostScript Fonts with \TeX

Document/4


1. Introduction

This document is aimed towards existing TeX users who have access to a PostScript laser printer for printing their TeX documents, and who wish to take advantage of the wider range of PostScript fonts and typefaces provided with such printers. This can release TeX users from adherence to just TeX's own Computer Modern typefaces, and will allow text to be printed in Times Roman, Helvetica, Palatino, New Century Schoolbook, and so on… This facility does at present only relate to text in TeX documents — mathematical equations will still automatically print in the Computer Modern maths fonts. This is because the PostScript fonts do not include the wide range of mathematical symbols and operators needed by TeX to produce beautiful formulae.

This document also assumes familiarity with assigning fonts in TeX using the \font command, although a short resumé is included overleaf. Any users unfamiliar with the \font command, or with enlarging fonts using TeX's \magstep feature, should consult introductory TeX documentation.

2. PostScript Printers

PostScript is a ‘page description language’, which essentially provides a versatile means of printing files (coded in the PostScript language) onto a PostScript laser printer or photo-typesetter. Included with a PostScript printer are a range of PostScript fonts, which may be incorporated into a variety of text layout programs, such as PageMaker and TeX. There are many makes of PostScript laser printer on the market — all use the PostScript ‘interpreter’ as the basis for printing. Examples include the Apple LaserWriter Plus, QMS Lasergrafix 800PS, and the Hewlett-Packard Laserjet Series IIIPS.

A service is available to allow PostScript files created by a program like ptips on a microcomputer or dvips on a Silicon Graphics computer to be sent to a remote PostScript printer in the Computer Unit. Output may be collected and paid for at Computer Unit reception; no header page is written so be prepared to identify your output! This document will be updated as appropriate to reflect any new facilities. PCTeX users should refer to document Document/6 Running TeX on the Novell Network at Exeter. If you use TeX on Silicon Graphics machines refer to Document/7 instead.

3. PostScript Features

PostScript is highly versatile at producing special effects with graphic images such as illustrations, boxes and shading. These fancy effects are usually created in an appropriate paint or draw program, or by using Computer Aided Design (CAD) software. Desktop Publishing is another related area where PostScript shows its colours. This document will however concentrate on the use of PostScript fonts, and their inclusion in TeX documents. Silicon Graphics users should refer to the dvips manual, see section 5 below, for full details of how to include PostScript graphic images.

As mentioned above, all PostScript printers come provided with a range of fonts, which are stored internally in the laser printer. A sample of each of the ‘standard’ PostScript fonts is attached. There are many other PostScript fonts and styles which can be downloaded to the printer including the University font “Galliard”, but these extra fonts will not be described here.

4. Creating PostScript files with PCTeX

A file coded in the PostScript language can be produced with TeX by processing the intermediate DVI file through a PostScript printer driver program. The PCTeX version of TeX includes a PostScript driver program called PTIPS, which is available under the PCTeX site licence at Exeter (consult Document/2 the introductory notes on the site licence, available at Computer Unit reception). The output file produced by PTIPS has a .PS suffix to the filename. This file can then be printed on a PostScript printer using \PCTeX's PTISPOOL program (included with PTIPS).

Use of the PostScript fonts with PCTeX's PTIPS program requires access to a ‘font substitution’ file, to equate PCTeX's PostScript font names with the font names as stored in the laser printer. A file called INTERNAL.SUB is provided with PTIPS for this purpose, which is copied into the \pctex sub-directory of your hard disc during installation of the PTIPS program. When running PTIPS, a -F option will tell the program to locate and use this font substitution file. If drive C is your hard disc, this option to PTIPS should appear as follows

   PTIPS filename -f=c:\pctex\internal.sub
For frequent use, this command sequence can be set up as a batch file. See the PTIPS manual (available by arrangement and for a small fee from IT Services Reception) for full details of all PTIPS options and more information on font substitution.

5 Creating PostScript files with TeX on Silicon Graphics machines

The Silicon Graphics implementation of TeX includes Tom Rokicki's PostScript driver program called dvips. The output file written by dvips has a .ps suffix to the filename. Output is not sent directly to a PostScript printer, so you have the opportunity to preview it using xpsview or xv or to print it on the PostScript printer of your choice. Use the texprint command to print the PostScript file on the Computer Unit PostScript printer.

Use of the PostScript fonts with the dvips program requires access to a ‘font substitution’ file, to equate TeX's PostScript font names with the font names as stored in the laser printer. A file called psfonts.map is provided with dvips for this purpose.

Local additions have been made to enable .tex files that ran correctly through PCTeX to work unchanged on Silicon Graphics. However, PostScript font names on Silicon Graphics will almost certainly not work with PCTeX. For example, the PostScript font AvantGarde-Book is available as pagk or cmavabk on Silicon Graphics machines but only as cmavabk in PCTeX.

Note that there is an on-line manual accessible for dvips (like all other UNIX commands), by typing man dvips. The man page shows you how to print your own 47 page dvips manual which gives full details of all dvips options and more information on font substitution.

6. The Computer Modern TeX Fonts

TeX has several font change commands like \rm, \it etc.\ which are pre-assigned ready for use. These commands use TeX's own Computer Modern Roman and Computer Modern Text Italic fonts, both at the 10pt size. Other pre-assigned font commands are \bf, \sl and \tt, which access the Computer Modern 10pt fonts for boldface, slanted and typewriter type.

There are many other Computer Modern TeX fonts available, although these extra fonts do not come ‘ready-prepared’. To use them, you first have to assign a ‘name’ to each additional font that you wish to use, and equate that name with the name of a font file containing the font definition. The procedure would be something like

   \font\caps=cmcsc10
which creates a new TeX font command called \caps, and links it with the font file cmcsc10, containing the definition for the Computer Modern Caps and Small Caps font at the 10pt size. Now the \caps command can be used to change fonts in a similar way to the \bf or \sl commands.

To use the same font at a larger size, you would have to assign yet another font command name, and equate that to the same font filename, but also specifying the new size, such as

   \font\bigcaps=cmcsc10 scaled \magstep2
TeX uses preset ‘magsteps’ or magnification steps for its font sizes. The \magsteps are based on multiples of 1.2, calculated from the original size of the font. \magstep2 will multiply a 10pt font by 1.2 once to get to \magstep1, then by 1.2 again to reach \magstep2. Thus the \bigcaps font command will print the Caps and Small Caps font at 14.4pt in size (10pt x 1.2 x 1.2 = 14.4pt). The \caps font command will still print the same Caps and Small Caps font, but at its 10pt size. As an alternative, the above \bigcaps font assignment could have been written as
   \font\bigcaps=cmcsc10 at 14.4pt
The effect would be exactly the same. The Computer Modern TeX fonts are not available outside these precise \magstep sizes. It would not therefore be possible to specify the cmcsc10 font at 13pt — the TeX font file for this size just does not exist (although it could be created, given time and application). As you will see below, the PostScript fonts do not have this restriction.

One has to assign the larger sizes of the Computer Modern fonts with particular care when the whole document is being ‘enlarged’ using TeX's \magnification command, such as

   \magnification=\magstep1
The \magnification command should be placed at the {\sl very top} of your TeX source file, before any page layout or \font commands, and especially before any text. Everything in the document will then be ‘magnified’ by \magstep1 (by a factor of 1.2) — this includes dimensions such as \hsize, \baselineskip and \parindent as well as all font sizes. Thus
   \magnification=\magstep1
   \font\bigcaps=cmcsc10 at 14.4pt
would result in \bigcaps now producing the Caps and Small Caps font at 17.28pt (14.4pt x 1.2 = 17.28pt), since the 14.4pt is multiplied by yet another \magstep from the overall \magnification command. This automatic extra magnification can be pre-empted by specifying the \bigcaps font size in {\sl true points} (truept) as follows
   \magnification=\magstep1
   \font\bigcaps=cmcsc10 at 14.4truept
Now \bigcaps will always produce the font at its 14.4pt size irrespective of any overall global magnification introduced by the \magnification command.

7. Using PostScript fonts with TeX

PostScript fonts can be introduced into TeX documents in a similar way as with TeX's own Computer Modern font family. If you refer to the attached font list, you will see that the PostScript fonts for PCTeX exist under names such as cmtimer for Times Roman, or cmhelbo for Helvetica Bold Oblique.\fnote{% Each PostScript font is known to PCTeX under two separate font names. Thus cmtimer and timer both relate to the PostScript Times Roman font. Similarly cmhelbo and helbo are equivalent names for Helvetica Bold Oblique.

However, the PostScript font names with the cm prefix have been specially adapted for use with \PCTeX, to allow for the inclusion of foreign accents. Use of these more versatile PCTeX cm font names (cmtimer, cmhelbo etc) is therefore assumed in this document. See also section 7. Thus

   \font\timrom=cmtimer at 10pt
   \font\helvbolditalic=cmhelbo at 12.5pt
will allow you to use the new \timrom font command to print text in Times Roman at 10pt, and the \helvbolditalic command to produce Helvetica Bold Oblique at 12.5pt.

Note that the font filenames cmtimer and cmhelbo do not have a number to designate the font size. Instead, you must specify the font size by saying ‘cmtimer at 10pt’ etc. within each \font assignment. This is because PostScript fonts are ‘scaleable’ — they are not restricted to certain pre-defined sizes (unlike the \magsteps used by TeX's Computer Modern fonts). PostScript fonts can instead be printed at any size you like, with the only apparent limitation being the A4 paper width!

The PostScript laser printer contains just one outline definition for the Times Roman font, and another for Helvetica Bold Oblique. When a file containing text to be printed in these PostScript fonts is sent to the laser printer, the PostScript magic will automatically enlarge (or scale) the relevant PostScript outline font definition(s) to your requested size(s).

To print the Times Bold font (cmtimeb) both at 11pt within the main body text, and also at 30pt for headings, you would need two \font assignments, similar to

   \font\eleventimesbold=cmtimeb at 11pt
   \font\bigtimesbold=cmtimeb at 30pt
If there is also an overall \magnification command in play, as in
   \magnification=\magstep1
   \font\eleventimesbold=cmtimeb at 11pt
   \font\bigtimesbold=cmtimeb at 30pt
then both font sizes would be multiplied by the factor of 1.2 introduced by the \magstep1 in the \magnification command, in exactly the same way as with the Computer Modern fonts. Thus \eleventimesbold would now print Times Bold at 13.2pt (11pt x 1.2 = 13.2pt), and\hfill\break \bigtimesbold would produce Times Bold at 36pt. Again, if necessary, specifying truept in these font assignments would avoid the extra enlargement introduced by the \magnification command.

8. Disadvantages of PostScript Fonts

All these extra fonts sound like a very good thing, but PostScript fonts do have certain restrictions, particularly when used with . Some of these PostScript font caveats are listed below:
  1. A very poor range of mathematical symbols. If PostScript fonts are used for the main body text, any mathematical equations will still print in the Computer Modern maths fonts.
  2. The ligatured letters ‘ff’, ‘ffi’ and ‘ffl’ do not appear in the PostScript fonts, although the ‘fi’ and ‘fl’ ligatures will print (except in the PostScript Courier font family). Thus the word ‘difficult’ will appear as ‘{\palar difficult}’ in the Palatino font.
  3. A reduced range of foreign letters and diacritical marks. All main European accents can be produced, but there is no dotless j (\j) in any of the PostScript fonts. Also, the TeX commands \L and \l should not be used with PostScript fonts, making the Polish \L and \l unavailable (except by devious means).
  4. The PostScript Courier font family (cmcour etc) does not have any \ae or \oe dipthongs.
  5. The previewing program for PCTeX (PTIVIEW, known locally as TEXVIEW) will not display PostScript fonts as such on screen. It will however substitute Computer Modern fonts just for previewing, provided an appropriate font substitution file has been included on the system. This file will be made available with the PCTeX site licence discs for PTIVIEW, although it is not included on the discs at the time of writing this document.
These substituted Computer Modern fonts will have different character spacings, so the overall page layout and line endings may look odd on screen. The correct layout should be automatically restored however, when the file is printed on a PostScript printer using a PostScript printer driver program (see section 4 above).