
% \iffalse
%
% This file is part of the NFSS2 (New Font Selection Scheme) package.
% ------------------------------------------------------------------
%
% This file was contributed. In case of error please inform the
% original author.
%
% \fi

\def\fileversion{4.2}
\def\filedate{1.11.93}
%
% This document describes an NFSS2 setup which declares PostScript
% fonts, and the associated style files
%
\def\SLiTeX{S\kern-.065em L\kern-.18em\raise.32ex\hbox{i}\kern-.03em\TeX}
% PiCTeX Documentation from the PiCTeX Files
\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
\def\PiCTeX{\PiC\kern-.11em\TeX}
\def\PS{{\sc PostScript}}
\documentstyle[]{article}
\begin{document}
\title{Notes on setup of the New Font Selection Scheme 2 to use
PostScript fonts}
\author{Sebastian Rahtz}
\date{\filedate}
\maketitle
%
\tableofcontents
\section{Introduction}

This set of files offers a complete working setup of NFSS2 for use
with \PS\ fonts; it is based on the system I created between 1989 and
1991 for Southampton Computer Science, checked and updated for NFSS2.
Style options are provided for the common PostScript fonts. You should
be familiar with the standard NFSS2 files and their use to follow this
document.  I assume that you have all the NFSS2 files and a recent
copy of the normal \LaTeX\ distribution.

Style files are offered to set documents in the common PostScript
fonts, plus exotica like Lucida Maths.  Lucida Bright is also
supported. It is assumed that the user uses a driver which understands
virtual fonts, and that Karl Berry's naming scheme is followed.

{\bf NOTE:} I have included {\em new} font metric and virtual font
files for PostScript fonts, for those who wish to use EC encoding.
These will only work if you use dvips.

\section{Portability}

My personal setup uses a \PS\ printer, Karl Berry's names for \PS\
fonts in \TeX, virtual fonts to map \PS\ to CMR layout, and I process
my \verb|.dvi| files with Rokicki's dvips. Other systems may fall
over.  

\section{Standard installation}
This distribution is provided as a set of \verb|.dtx| and \verb|.fdd|
files which need to be unpacked using {\em docstrip} to create user
files. There are two types of file which result:
\begin{enumerate}
\item \verb|.fd| files which describe a particular font
  encoding/family combination
\item \verb|.sty| files which change the font defaults to use some new
  group of fonts
\end{enumerate}
Scripts are provided for {\em docstrip} in the form of four {\tt .ins}
files, which simply need to be run through \TeX; when that has been
done, install all the {\tt .sty} and {\tt .fd} files that result in a
directory where \LaTeX\ will find them.

But wait! Before you start installing, you have an important decision
to make --- are you going to use fonts encoded in the `Cork' layout,
or the old ones which look like the CM fonts described in the \TeX\
book? This affects how you run the installation scripts you run. To get
PostScript fonts in the Cork (EC) layout, you will need to use
Rokicki's {\tt dvips} driver, which knows how to ask the PostScript
interpreter to recode the fonts.  This manual will not attempt to
explain why you should or should not use EC fonts\ldots

Run \TeX\ on the file {\tt psfonts.ins}, and answer either `c' (Cork),
`o' (Old), or `b' (Both) when asked about encoding. The latter option
will create {\em two} sets of {\tt .fd} files, one for Cork-encoding,
the other for old \TeX\ encoding.
Font description files ({\tt .fd}) will be created
for all the standard PostScript fonts, and some style files (see below
for names). 

If you follow the Cork-encoding route, you need different \TeX\ font
metric files and virtual font files. Suitable files for the standard
35 fonts are included in the {\tt psmetrics} sub-directory, where you
will also find a Unix-style `Makefile' which shows how to create
suitable metrics for extra Type1 fonts you may have. You will need to
be able to compile the program {\tt vpltovpl} to make this work. It is
written in fairly portable C.

As well as different metrics, EC-encoded fonts need slightly different
entries in the {\tt psfonts.map} file of dvips, such as:
\begin{verbatim}
pagko0 AvantGarde-BookOblique " ECEncoding ReEncodeFont " <ec.enc
pgml0 Garamond-Light <pgml.pfb " ECEncoding ReEncodeFont " <ec.enc
\end{verbatim}
Note the `0' at the end of the short name, and the inclusion of the
file {\tt ec.enc} (which you will find in the {\tt psmetrics} directory.
The Garamond font, because it is not resident, needs an additional
piece of information, the name of the Type1 font on your system which
can be downloaded. The file {\tt psfonts.dc} has a large set of
suitable entries for the map file.

{\em Important.} If you use the EC (T1 in NFSS2 scheme) encoding, you
will probably also need the `dc' CM fonts to go with them, for maths
and so on.
\section{Installation of non-standard fonts and styles}
If you want to create font files and style files for a
greater selection of faces (see Appendix for details of fonts, and table
\ref{styles} for styles), run \TeX\ again on {\tt psextra.ins}. This
is a fairly random selection of fonts which the author needs, not put
together in any rational way.

To create font and style files for Lucida and Lucida Bright (including
Lucida Bright maths), run \TeX\ on {\tt lucida.ins}. You will not be
asked about encoding in this case --- T1 is assumed.

To create an NFSS2 style file for typesetting Object Z,
run \TeX\ on {\tt oz.ins}.  

\section{Testing}
All installers should run {\tt test0.tex} through \LaTeX\ and print
the result, after installing their chosen setup, to ensure that things
are more or less working. {\tt test1.tex} will exercise your supply of
PostScript fonts. Run {\tt test2.tex} only if you have created {\tt .fd}
files for {\em both} T1 {\em and} OT1 encoding. Other test files are
for wizardettes.

{\bf Do not worry if nothing but {\tt test0.tex} works!}. {\tt
  test0.ps} is a prebuilt version of {\tt test0.tex} for you to compare.

\section{User interface}

The daily user will simply include one of the style options {\tt
  nftimes.sty}, {\tt nfnewce.sty}, {\tt nfhelve.sty}, {\tt
  nfpalat.sty} etc\footnote{The `nf' prefix (`New Font') has been
  given to clearly differentiate these styles from all the other style
  files called eg {\tt times.sty}.} to change the default text fonts
for one or more of the roman, sans-serif and typewriter faces.  Table
\ref{styles} lists the effects of the style files created in the
installation procedure.

The special style file {\tt nfpi.sty} gives access to the Dingbat and Symbol
fonts. See {\tt pitest.tex} for details.
\begin{table}
\begin{small}
  \begin{tabular}{|l|lll|}
\hline
Style option & Sans font & Roman font & Typewriter font\\
\hline
nftimes.sty & Helvetica & Times & Courier\\
nfpalat.sty & Helvetica & Palatino & Courier\\
nfhelve.sty   & Helvetica & &\\
nfavant.sty   & AvantGarde & &\\
nfnewce.sty & AvantGarde & NewCenturySchoolbook & Courier\\
nfbookm.sty &  AvantGarde & Bookman & Courier\\
\hline
nfgaram.sty & Optima & Garamond & Courier\\
nfbaske.sty & Univers & Baskerville & Courier\\
nfmtimes.sty & Univers & Monotype Times & cmtt\\
nfbembo.sty & Optima & Bembo & Courier\\
nflucid.sty & LucidaSans & Lucida & Courier\\
nflucbry.sty & LucidaSans & LucidaBright & LucidaTypewriter\\
nflucbrb.sty & LucidaSans & LucidaBright & LucidaTypewriter\\
\hline
  \end{tabular}
\end{small}
\caption{Effect of style files\label{styles}}
Note: {\tt lucidabry.sty} uses the font names defined by the suppliers, Y\&Y;
{\tt lucidabrb.sty} uses names for Lucida Bright which conform to 
Karl Berry's scheme.
\end{table}
Note that maths fonts will stay the same unless you have suitable
fonts to load. If the Lucida Maths fonts have been purchased, and
appropriate metrics obtained, loading {\tt nflucma.sty} will remove
all reference to CMR fonts in the document. Alternatively, purchase
the Lucida Bright font set and use the {\tt nflucbry.sty} style file.

\subsection{Important --- font encoding choices}
The style files assume that you have already made the choice of which
text font encoding scheme you prefer (T1 or OT1), and that it is the
default when the \LaTeX\ job starts. However, you may need to override
the defaults or make special provision for odd fonts, and for this
purpose some  utility style files are provided. 
\begin{description}
\item[nft1ot1] This reloads the T1 and OT1 encoding declarations 
with appropriate macro definitions so that you
can switch between them in mid-document, 
and have the accents, special characters etc, set up correctly.
\item[nfot1var] The set of \verb|tfm| and \verb|vf| files
  supplied with Tom Rokicki's {\em dvips} and those created by default
  with his {\em afm2tfm} do not precisely match the OT1 \TeX\ layout.
  This style option changes some macro definitions to make the necessary
  fixes.
\end{description}

\section{New fonts, and style-writers interface} 
Setting up new fonts, so as to create {\tt .fd} files, is exactly as
documented in the main NFSS2 documentation. Suitable models for a
large multifont installation can be found in {\tt psfonts.fdd}
(covering both old \TeX\ encoding and EC encoding), but an {\tt .fd}
file for a single font is easy to write by hand, once you know which
font encoding it uses. Thus the declaration file {\tt OT1ppl.fd} for
old-style \TeX-encoding Palatino (OT1) looks like this:
\begin{verbatim}
\DeclareFontFamily{OT1}{ppl}{}
\DeclareFontShape{OT1}{ppl}{m}{n}{<->pplr}{}
\DeclareFontShape{OT1}{ppl}{m}{it}{<->pplri}{}
\DeclareFontShape{OT1}{ppl}{b}{n}{<->pplb}{}
\DeclareFontShape{OT1}{ppl}{b}{it}{<->pplbi}{}
\DeclareFontShape{OT1}{ppl}{m}{sc}{<->pplrc}{}
\DeclareFontShape{OT1}{ppl}{m}{sl}{<->pplro}{}
%
\DeclareFontShape{OT1}{ppl}{b}{sc}{<->sub * ppl/m/sc}{}
\DeclareFontShape{OT1}{ppl}{b}{sl}{<->sub * ppl/b/it}{}
\DeclareFontShape{OT1}{ppl}{bx}{n}{<->sub * ppl/b/n}{}
\DeclareFontShape{OT1}{ppl}{bx}{it}{<->sub * ppl/b/it}{}
\DeclareFontShape{OT1}{ppl}{bx}{sc}{<->sub * ppl/m/sc}{}
\DeclareFontShape{OT1}{ppl}{bx}{sl}{<->sub * ppl/m/sl}{}
\endinput
\end{verbatim}
Once the font family and encoding is declared (I use the three-letter unique
combinations devised by Karl Berry for all PostScript fonts), each
combination of series and style is mapped to the name of a {\tt tfm}
file; we don't need to worry about which sizes are available, because
the PostScript fonts can be scaled to any size. The second part of the
file sets up some substitutions for situations where we may have no
font available (bold small caps, bold slanted, or bold-extended
series).

If you need to create a new style file which can be used in the same
way as the ones provided, simply use standard NFSS2 constructs. This
is {\tt nftimes.sty} (with banner information removed):
\begin{verbatim}
\@ifundefined{DeclareFontShape}
     {\@ifundefined{selectfont}
        {\@latexerr{This style option can only be used
                    with the new^^Jfont selection scheme}\@eha}
        {\@latexerr{This style option can only be used
                    with the new^^Jfont selection scheme *release 2*}
                   {Your format contains NFSS release 1, but this style
                    option was^^Jdeveloped for release 2.}
        }
      \endinput}
     {}
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}
\def\bfdefault{b}
\endinput
\end{verbatim}
Note the test to see whether we are actually using NFSS2 and  the switch
to make `b' default for bold rather than `bx'.

If appropriate you could \verb|\input| the style files described
above, and use the utility macros to tailor your environment.

\section*{Appendix: font names}

\begin{tabular}{|ll|}
\hline
Family name & Full name\\
\hline
pag&Adobe AvantGarde\\
pbb&Adobe MBembo\\
pbk&Adobe Bookman\\
pcr&Adobe Courier\\
phv&Adobe Helvetica\\
pnc&Adobe NewCenturySchoolbook\\
ppl&Adobe Palatino\\
ptm&Adobe Times Roman\\
pzc&Adobe ZapfChancery\\
psy&Adobe Symbol font\\
pzd&Adobe Zapf Dingbats\\
\hline
hlc&B\&H Lucida Bright\\
hlcs&B\&H Lucida Sans\\
hlct&B\&H Lucida Bright Typewriter\\
mgm&Monotype Garamond\\
mim&Monotype Imprint\\
mpi&Monotype Plantin\\
mnp&Monotype NewsPlantin\\
mnt&Monotype Times New Roman\\
mpp&Monotype Perpetua\\
pgm&Adobe ITC Garamond\\
pgs&Adobe MGillSans\\
plc&Adobe Lucida\\
plcs&Adobe Lucida Sans\\
pnb&NewBaskerville\\
pop&Adobe Optima\\
pun&Adobe Univers\\
\hline
\end{tabular}

\end{document}


