old-www/HOWTO/TeTeX-HOWTO-7.html

126 lines
6.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The teTeX HOWTO: The Linux-teTeX Local Guide: Using Postscript fonts. </TITLE>
<LINK HREF="TeTeX-HOWTO-8.html" REL=next>
<LINK HREF="TeTeX-HOWTO-6.html" REL=previous>
<LINK HREF="TeTeX-HOWTO.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="TeTeX-HOWTO-8.html">Next</A>
<A HREF="TeTeX-HOWTO-6.html">Previous</A>
<A HREF="TeTeX-HOWTO.html#toc7">Contents</A>
<HR>
<H2><A NAME="postscript-fonts"></A> <A NAME="s7">7. Using Postscript fonts. </A></H2>
<P>
<P>It used to be that public domain, Type 1 fonts were much poorer
quality than Computer Modern bit mapped fonts. This situation has
improved in the last several years, though, but matching the fonts is
up to you. Having several different font systems on one machine can
seem redundant and an unnecessary waste of disk space. And the
Computer Modern fonts can seem, well, a little too <EM>formal</EM> to
be suitable for everyday use. It reminds me sometimes of bringing out
the good China to feed the dog. At least you don't need to spend a
bundle on professional quality fonts any longer.
<P>One of the major improvements of LaTeX2e over its predecessor was the
inclusion of the New Font Selection Scheme. (It's now called PSNFSS.)
Formerly, TeX authors would specify fonts with commands like
<PRE>
\font=bodyroman = cmr10 scaled \magstep 1
</PRE>
<P>which provides precision but requires the skills of a type designer
and mathematician to make good use of. Also, it's not very portable.
If another system didn't have the font <CODE>cmr10</CODE> (this is TeX
nomenclature for Computer Modern Roman, 10 point, with the default
medium stroke weight), somebody would have to re-code the fonts
specifications for the entire document. PSNFSS, however, allows you
specify fonts by family (Computer Modern, URW Nimbus, Helvetica,
Utopia, and so forth), weight (light, medium, bold), orientation
(upright or oblique), face (Roman, Italic), and base point size. (See
the section
<A HREF="TeTeX-HOWTO-4.html#characters">Characters and type styles</A> for a
description of the commands to specify typefaces.) Many fonts are
packaged as families. For example, a Roman-type font may come
packaged with a sans serif font, like Helvetica, and a monospaced
font, like Courier. You, as the author of a LaTeX document, can
specify an entire font family with one command.
<P>There are, as I said, several high-quality font sets available in the
public domain. One of them is Adobe Utopia. Another is Bitstream
Charter. Both are commercial quality fonts which have been donated to
the public domain.
<P>These happen to be two of my favorites. If you look around one of the
CTAN sites, you will find these and other fonts archived there. There
are enough fonts around that you'll be able to design documents the
way you want them to look, and not just English text, either. TeX was
originally designed for mathematical typesetting, so there is a full
range of mathematical fonts available, as well as Cyrillic, Greek,
Kana, and other alphabets too numerous to mention.
<P>The important thing to look for is files which have either the
<CODE>.pfa</CODE> or <CODE>.pfb</CODE> extension. They indicate that these
are the scalable fonts themselves, not simply the metrics files. Type
1 fonts use <CODE>.pfm</CODE> metric files, as opposed to the
<CODE>.tfm</CODE> metric files which bit mapped fonts use. The two font
sets I mentioned above are included in teTeX distributions, as well as
separately.
<P>What I said above, concerning the ease of font selection under PSNFSS,
is true in this instance. If we want to use the Charter fonts in our
document instead of Computer Modern bit mapped, all that is necessary
is include the LaTeX statement
<PRE>
\renewcommand{\familydefault}{bch}
</PRE>
in the document preamble, where ``bch'' is the common designation for
Bitstream Charter. The Charter fonts reside in the directory
<PRE>
/usr/lib/teTeX/texmf/fonts/type1/bitstrea/charter
</PRE>
<P>There you'll see the <CODE>.pfb</CODE> files of the Charter fonts:
<CODE>bchb8a.pfb</CODE> for Charter Bold, <CODE>bchr8a.pfb</CODE> for Charter
Roman, <CODE>bchbi8a.pfb</CODE> for Charter Bold Italic. The ``8a'' in
the font names indicates the character encoding. At this point you
shouldn't need to worry much about them, because the encodings mostly
differ for 8-bit characters, which have numeric values above 128
decimal. They mostly define accents and non-English characters. The
Type 1 font encodings generally work well for Western alphabets
because they conform to the ISO 8859 standards for international
character sets, so this is an added benefit of using them.
<P>To typeset a document which has Charter fonts selected, you would give
the command
<PRE>
pslatex document.tex
</PRE>
<CODE>pslatex</CODE> is a variant of teTeX's standard <CODE>latex</CODE>
command which defines the directories where the Type 1 fonts are, as
well as some additional LaTeX code to load. You'll see the notice
screen for <CODE>pslatex</CODE> followed by the status output of the TeX
job itself. In a moment, you'll have a <CODE>.dvi</CODE> file which
includes the Charter font requests. You can then print the file with
<CODE>dvips</CODE>, and <CODE>gs</CODE> if necessary.
<P>Installing a Type 1 font set is not difficult, as long as you follow a
few basic steps. You should unpack the fonts in a subdirectory of the
<CODE>/usr/lib/teTeX/texmf/fonts/type1</CODE> directory, where your other
Type 1 fonts are located, and then run <CODE>texhash</CODE> to let the
directory search routines know that the fonts have been added. Then
you need to add the font descriptions to the file <CODE>psfonts.map</CODE>
so <CODE>dvips</CODE> knows they're on the system. The format of the
<CODE>psfonts.map</CODE> file is covered in a couple different places in
the references mentioned above. Again, remember to run the
<CODE>texhash</CODE> program to update the teTeX directory database.
<P>It is definitely an advantage to use the X Windows System with teTeX---
XFree86 under Linux---because it allows for superior document
previewing. It's not required, but in general, anything that allows
for easier screen previewing is going to benefit your work, in terms
of the quality of the output. However, there is a tradeoff with speed
of editing, which is much quicker on character-mode displays.
<P>
<HR>
<A HREF="TeTeX-HOWTO-8.html">Next</A>
<A HREF="TeTeX-HOWTO-6.html">Previous</A>
<A HREF="TeTeX-HOWTO.html#toc7">Contents</A>
</BODY>
</HTML>