forked from AllenDowney/PhysicalModelingInMatlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnbaskerv.dtx
302 lines (302 loc) · 9.48 KB
/
nbaskerv.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
% \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:[email protected]}{\texttt{[email protected]}},
% \href{mailto:[email protected]}{\texttt{[email protected]}}}}
% \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