% \iffalse
% $Id: nbaskerv.dtx,v 1.12 2008-03-21 00:01:07 boris Exp $
%
% Copyright (c) 2008, Boris Veytsman
%
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions
% are met: 
%
%    * Redistributions of source code must retain the above copyright
%    notice, this list of conditions and the following disclaimer. 
%    * Redistributions in binary form must reproduce the above
%    copyright notice, this list of conditions and the following
%    disclaimer in the documentation and/or other materials provided
%    with the distribution. 
%    * Neither the name of the original author nor the names of the
%    contributors may be used to endorse or promote products derived
%    from this software without specific prior written permission. 
%
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
% CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
% DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
% BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
% TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
% DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
% ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
% OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
% POSSIBILITY OF SUCH DAMAGE.
%
% \fi 
% \CheckSum{77}
%
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~} 
%
% \MakeShortVerb{|}
% \GetFileInfo{nbaskerv.dtx}
% \title{\LaTeX{} Support For New Baskerville Fonts From Adobe}
% \author{Boris Veytsman\thanks{%
% \href{mailto:borisv@lk.net}{\texttt{borisv@lk.net}},
% \href{mailto:boris@varphi.com}{\texttt{boris@varphi.com}}}} 
% \date{\filedate, \fileversion}
% \maketitle
% \begin{abstract}
%   This package provides \LaTeX{} support for the New Baskerville
%   fonts from Adobe
% \end{abstract}
% \tableofcontents
% \changes{v1.0}{2008/02/16}{First fully functional version} 
% \changes{v1.0a}{2008/02/19}{Documentation changes} 
% \changes{v1.0b}{2008/02/25}{Installation changes} 
% \changes{v1.0c}{2008/03/20}{Documentation update} 
%
% \clearpage
%
%
%\section{Introduction}
%\label{sec:intro}
%
% This package provides support files for the New Baskerville fonts
% from Adobe.  According to the Fontname scheme~\cite{fontname} this
% corresponds to the family |pnb|.
%
% The package is written for the set of fonts currently used by
% \emph{No Starch Press,} \url{http://www.nostarch.com}.  The
% copyright statement in the fonts refers to 1985, 1987, 1990.  It is
% possible that other versions of the fonts have slightly different
% metrics, and package should be changed to accommodate this.  To make
% this easier, I release the package under BSD-style license.  This is
% even more appropriate since most of the files is generated following
% the great course~\cite{fontinstallationguide}.
%
% The support is limited to T1 and TS1 encoding.  No VTeX support
% files are included.
%
%
%\section{Installation}
%\label{sec:install}
%
%
%
% First, you need to purchase the fonts themselves: the |pfb| files
% are \emph{not} included in the package.  If you got the fonts from
% \emph{No Starch press,} do not rename the |pfb| files.  However, if
% there are uppercase letters in your file names, downcase them.  If
% you obtained the files from another source, rename the fonts
% according to Table~\ref{tab:PFB}.  If your \TeX{} system is
% TDS-compliant, install the files into
% \path{$TEXMF/fonts/type1/adobe/nbaskerv}.  Then download
% \url{http://ctan.tug.org/install/fonts/psfonts/adobe/nbaskerv.tds.zip}
% and unzip the file in \path{$TEXMF}.  Add |+pnb.map| to the
% configuration files of dvips, pdftex and your dvi previewer.
%  
% Run updmap and texhash programs to update the configuration files
% and file names database.
%
% The included style |nbaskerv.sty| makes New Baskerville your default
% Roman family.
%
%
% \begin{table}[tp]
%   \centering
%   \caption{PFB Files}
%   \label{tab:PFB}
%
%   \begin{tabular}{ll}
%     \toprule
%    File  &  Font \\
%    \midrule
%    |newbb02.pfb| & New Baskerville Bold \\
%    |newbbi56.pfb| & New Baskerville Bold Italic \\
%    |newbi29.pfb| & New Baskerville Italic \\
%    |newbr20.pfb| & New Baskerville Roman \\
%    \bottomrule
%   \end{tabular}
%
% \end{table}
%
% \StopEventually{
%   \clearpage
% \paragraph{Acknowledgement}
% This package was written for No Starch Press,
% \url{http://www.nostarch.com}. 
%
%   \bibliography{nbaskerv}
%   \bibliographystyle{unsrt}}
%
% \clearpage
%\section{Implementation}
%\label{sec:impl}
%
%\subsection{Identification}
%\label{sec:ident}
%
% We start with the declaration who we are.  Most |.dtx| files put
% driver code in a separate driver file |.drv|.  We roll this code into the
% main file, and use the pseudo-guard |<gobble>| for it.
%    \begin{macrocode}
%<style>\NeedsTeXFormat{LaTeX2e}
%<*gobble>
\ProvidesFile{nbaskerv.dtx}
%</gobble>
%<style>\ProvidesClass{nbaskerv}
%<pnb-drv>\ProvidesFile{pnb-drv.tex}
%<pnb-map>\ProvidesFile{pnb-map.tex}
[2008/03/20 v1.0c Using New Baskerville font from Adobe in LaTeX]
%    \end{macrocode}
% And the driver code:
%    \begin{macrocode}
%<*gobble>
\documentclass{ltxdoc}
\usepackage{booktabs}
\usepackage{url}
\usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
            pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
\PageIndex
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\begin{document}
  \DocInput{nbaskerv.dtx}
\end{document}
%</gobble> 
%    \end{macrocode}
%
%
%\subsection{Fontinst Driver}
%\label{sec:pnb-drv}
%
% This follows~\cite{fontinstallationguide}.
% 
% First, the preamble
%    \begin{macrocode}
%<*pnb-drv>
\input fontinst.sty
%    \end{macrocode}
%  
%  We use bold for bold extended.  Also, the fake small for New
%  Baskerville require rather small height:
%    \begin{macrocode}
\substitutesilent{bx}{b}
\setint{smallcapsscale}{750}
\setint{slant}{167}
%    \end{macrocode}
%
%
% Starting recording transforms:
%    \begin{macrocode}
\recordtransforms{pnb-rec.tex}
%    \end{macrocode}
% A bunch of fonts:
%    \begin{macrocode}
\transformfont{pnbr8r}{\reencodefont{8r}{\fromafm{newbr20}}}
\transformfont{pnbri8r}{\reencodefont{8r}{\fromafm{newbi29}}}
\transformfont{pnbb8r}{\reencodefont{8r}{\fromafm{newbb02}}}
\transformfont{pnbbi8r}{\reencodefont{8r}{\fromafm{newbbi56}}}
%    \end{macrocode}
% Oblique fonts:
%    \begin{macrocode}
\transformfont{pnbro8r}{\slantfont{\int{slant}}%
  \reencodefont{8r}{\fromafm{newbr20}}} 
\transformfont{pnbbo8r}{\slantfont{\int{slant}}%
  \reencodefont{8r}{\fromafm{newbb02}}} 
%    \end{macrocode}
% 
% Now we install the fonts.  First T1
%    \begin{macrocode}
\installfonts
\installfamily{T1}{pnb}{}
\installfont{pnbr8t}{pnbr8r,newlatin}{t1}{T1}{pnb}{m}{n}{}
\installfont{pnbri8t}{pnbri8r,newlatin}{t1}{T1}{pnb}{m}{it}{}
\installfont{pnbro8t}{pnbro8r,newlatin}{t1}{T1}{pnb}{m}{sl}{}
\installfont{pnbrc8t}{pnbr8r,newlatin}{t1c}{T1}{pnb}{m}{sc}{}
\installfont{pnbb8t}{pnbb8r,newlatin}{t1}{T1}{pnb}{b}{n}{}
\installfont{pnbbi8t}{pnbbi8r,newlatin}{t1}{T1}{pnb}{b}{it}{}
\installfont{pnbbo8t}{pnbbo8r,newlatin}{t1}{T1}{pnb}{b}{sl}{}
\installfont{pnbbc8t}{pnbb8r,newlatin}{t1c}{T1}{pnb}{b}{sc}{}
\endinstallfonts
%    \end{macrocode}
% 
% And then TS1
%    \begin{macrocode}
\installfonts
\installfamily{TS1}{pnb}{}
\installfont{pnbr8c}{pnbr8r,textcomp}{ts1}{TS1}{pnb}{m}{n}{}
\installfontas{pnbr8c}{TS1}{pnb}{m}{sc}{}
\installfont{pnbro8c}{pnbro8r,textcomp}{ts1}{TS1}{pnb}{m}{sl}{}
\installfont{pnbri8c}{pnbri8r,textcomp}{ts1}{TS1}{pnb}{m}{it}{}
\installfont{pnbb8c}{pnbb8r,textcomp}{ts1}{TS1}{pnb}{b}{n}{}
\installfontas{pnbb8c}{TS1}{pnb}{b}{sc}{}
\installfont{pnbbo8c}{pnbbo8r,textcomp}{ts1}{TS1}{pnb}{b}{sl}{}
\installfont{pnbbi8c}{pnbbi8r,textcomp}{ts1}{TS1}{pnb}{b}{it}{}
\endinstallfonts
%    \end{macrocode}
% 
% And the end:
%    \begin{macrocode}
\endrecordtransforms
\bye
%</pnb-drv>
%    \end{macrocode}
% 
%
%
%\subsection{Fontmap Generation}
%\label{sec:fontmap}
%
% This is a standard procedure~\cite{fontinstallationguide}
%    \begin{macrocode}
%<*pnb-map>
\input finstmsc.sty
\resetstr{PSfontsuffix}{.pfb}
\adddriver{dvips}{pnb.map}
\input pnb-rec.tex
\donedrivers
\bye
%</pnb-map>
%    \end{macrocode}
%
%
%
%\subsection{Style File}
%\label{sec:style}
%
% We just use |pnb| as our default Roman family
%    \begin{macrocode}
%<*style>
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\renewcommand{\rmdefault}{pnb}
%</style>
%    \end{macrocode}
%
%
%\Finale
%\clearpage
%
%\PrintChanges
%\clearpage
%\PrintIndex
%
\endinput
