How do print a dvi files using PS fonts rather than TeX's PK fonts? I
think I have to edit the psfonts.map file, but what do I change?
Thanks in advance.
Koon T. Tang, e-mail: K.T....@bton.ac.uk
Department of Mathematical Sciences, fax: +44 (0)1273 642405
Univesity of Brighton,
UK.
>How do print a dvi files using PS fonts rather than TeX's PK fonts? I
>think I have to edit the psfonts.map file, but what do I change?
Here is a document I wrote which may help.
============================================
psnfss-howto (v1)
Timothy Murphy <t...@maths.tcd.ie>
1 September 1995
Any comments or suggestions gratefully received.
1. What is psnfss?
Psnfss is a LaTeX2e package
created by Sebastian Rahtz <s.r...@elsevier.co.uk>
which allows the use of PostScript fonts
in place of Knuth's CM fonts,
when using the dvips output driver.
2. How does psnfss work?
Psnfss substitutes virtual (*.vf) fonts for Knuth's CM fonts.
These virtual fonts point to the PostScript fonts.
The use of virtual fonts allows the encoding to be changed
from TeX encoding to PostScript encoding.
2.1 Can you give an example?
The times.sty package (which comes as part of psnfss)
replaces the standard font cmr10
by the Times-Roman virtual font ptmr7t.vf .
This virtual font points to the "real" font ptmr8r.
Finally, an entry in .../dvips/psfonts.map specifies
that ptmr8r is an alias for "Times-Roman".
2.2 OT1 and T1 encoding.
The psnfss package works equally well
with the standard Knuth OT1 7-bit text encoding
and with the new Cork T1 8-bit text encoding,
invoked by \usepackage{t1enc} or \usepackage[T1]{fontenc}.
The virtual font name will end in 7t or 8t,
according as the encoding is OT1 or T1.
Both these virtual fonts "point" to the same real font
whose name probably ends in "8r" ("r" for "raw").
In the example above, the virtual fonts ptmr7t.vf and ptmr8t.vf
both point to ptmr8r.
3. What are the standard PostScript fonts?
All (or irtually all) PostScript printers come with 35 inbuilt Adobe fonts
(in 11 families): AvantGarde, Bookman, Courier, Helvetica,
NewCentury, Palatino, Schoolbook, Symbol, Times,
ZapfChancery, ZapfDingbats.
I shall refer to these as the "standard" PS fonts.
There are of course a large number of commercial PS fonts.
There are also a small number of freely available PS fonts
apart from the standard 35, eg the BaKoMa fonts,
and some fonts that come with X Windows.
In this document I shall only discuss the use of psnfss
with the 35 standard PS fonts.
(Note though that psnfss and psfonts contains code
allowing use of several commercial PS fonts with LaTeX.)
4. What files do I need for psnfss?
You need the contents of 2 directories at the CTANs
(ftp.shsu.edu, ftp.tex.ac.uk, ftp.dante.de), namely
(a) /tex-archive/macros/latex/packages/psnfss
(b) /tex-archive/fonts/psfonts/adobe
Note that the CTANs allow whole directories to be retrieved
in .tar.gz or .zip form, eg
% ftp ftp.tex.ac.uk
ftp> binary
ftp> cd /tex-archive/macros/latex/packages
ftp> get psnfss.tar.gz
ftp> cd /tex-archive/fonts/psfonts
ftp> get adobe.tar.gz
5. Where is psnfss documented?
There is a file psnfss2e.tex in the package
(in .../latex/packages/psnfss)
which contains a short description of psnfss.
There is also a rather too brief account of the package
in the LaTeX Companion (Goossens, Mittelbach and Samarin).
5. What does psnfss contain?
There are 5 kinds of file in psnfss, namely
(a) *.tfm files
(b) *.vf files
(c) *.fd files
(d) *.sty files
(e) *.map files
(There are other files in the package, eg .afm files,
but these do not play an active role.)
6. How do I install psnfss?
To install psnfss you must ensure that
the files in classes (a-d) are in the appropriate place
for your system,
This differs according to your TeX implementation,
so cannot be specified precisely.
Generally, the appropriate directory or directories
for the 4 types of file are determined either
(i) at compilation, or
(ii) in a configuration file (probably texmf.cfg), or
(iii) by environment variables.
In cases (ii) and (iii), the appropriate places for the first 4 types of file
are probably determined by the following variables:
(a) .tfm files -- TEXFONTS or TEXTFMS
(b) .vf files -- VFFONTS
(c) .fd files -- TEXINPUTS
(d) .sty files -- TEXINPUTS
Note that LaTeX itself (ie "latex myfile") only requires the .tfm files.
If in doubt you can always put these where other .tfm files live.
Now for the 5th type, the .map files.
These give the aliases of the PostScript fonts
(eg ptmr8r for Times-Roman),
which must be listed in the file .../dvips/psfonts.map,
so that dvips knows of them.
Fortunately this has already been done
in the latest version (5.58f) of dvipsk,
so nothing requires to be changed in this case.
But if they are not in this file, they must be appended.
Eg under Unix one might say
% cd /usr/local/lib/texmf/dvips
% cp psfonts.map psfonts.bak
% cp ../fonts/psfonts/adobe/*/dvips/*.map >> psfonts.map
7. How can I use psnfss?
The simplest way to use psnfss is to use one of the packages provided, eg
\documentclass[a4paper,12pt]{article}
\usepackage{times}
\begin{document}
...
\end{document}
This has the effect of using Times-Roman in place of cmr,
Courier in place of cmtt (eg \texttt{typewriter}),
and Helvetica in place of cmss (eg \textsf{sans serif}).
7.1 Can I use the families directly?
Of course. You can say eg
{\fontfamily{ptm}\selectfont ...}
This will change the current font to Times-Roman.
The names of the families are readily found from the *.sty files,
or from the file psnfss2e.tex.
8. Can I use psnfss for maths?
Psnfss is intended primarily for text, not maths.
Unfortunately the standard fonts do not contain
a complete set of maths symbols.
The mathptm package makes the best possible job
of using the standard fonts within maths.
You may well find it is sufficient for your purpose.
To try it, just say eg
\documentclass[a4paper,12pt]{article}
\usepackage{times}
\usepackage{mathptm}
\begin{document}
As Einstein said,
\[
E = \rho mc^2,
\]
where $\rho = 1$.
\end{document}
9. Can I see psnfss output with xdvi?
Xdvi does not use PostScript fonts directly;
rather it converts them to PK files,
by invoking the program gsftopk.
(There is an alternative program, ps2pk,
which can be used instead of gsftopk,
if one makes the appropriate change
in the script MakeTeXPK.)
What happens if this is done is the following:
when dvips does not find a PK file it is looking for,
it calls on MakeTeXPK to create it if possible.
MakeTeXPK will first look to see if the PK file
has an alias listed in psfonts.map.
If it does find such an alias,
then MakeTeXPK will call on gsftopk to create the PK file.
In effect gsftopk invokes Ghostscript (gs) to make the font,
which is then converted to PK format.
9.1 What do I need to do to use gsftopk?
(a) You must have Ghostscript (gs) before you can use gsftopk,
together with the .gsf fonts which come with gs.
(There are gs's version of the standard PostScript fonts.)
Ghostscript is a GNU program,
and can be obtained from prep.ai.mit.edu and other GNU sites.
(b) Next you must get and compile gsftopk.
This can be found at the CTANs (see above) in
/tex-archive/fonts/utilities/gsftopk.
There is also a version gsftopkk intended for use with xdvik
(the UnixTeX version of xdvi)
available from ftp.cs.umb.edu/pub/tex.
Note that you must specify when compiling gsftopk
where the .gsf fonts are to be found.
10.1 Why does dvips say, "Cannot find ptmr*.mf"?
There is no such .mf file.
It is no good looking at the CTANs for it.
The error message indicates that dvips has not realised
that you are using a PostScript font,
There are 2 reasons why this may be the case.
(a) Because dvips does not find the appropriate .vf file,
and therefore assumes it must make a PK file.
(b) Because dvips does not realise that the font
is an alias for a PostScript font.
You can distinguish between these 2 cases by looking at the message.
In case (a) the message will say "Cannot find ptmr7t.mf"
or "Cannot find ptmr8t.mf".
In case (b) it will say "Cannot find ptmr8r.mf".
In case (a) you either don't have the .vf file (eg ptmr7t.vf),
in which case your psnfss system is incomplete;
or else you have the .vf file by dvips does not find it,
because it is not where dvips is looking for it.
In this case you can either try to discover where dvips is looking,
or else edit texmf.cnf (if you have this) to let VFFONTS
point to the appropriate place,
or else set the environment variable VFFONTS to point there.
In case (b) the appropriate entry is missing from .../dvips/psfonts.map.
Append the *.map files in .../fonts/psfonts/adobe to psfonts.map,
as explained above.
============================================
--
Timothy Murphy
e-mail: t...@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland