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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
% \iffalse
% $Id: divine.dtx,v 1.2 2013-03-08 18:13:46 boris Exp $
%
% Copyright (c) 2013, 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{0}
%
%
%% \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{divine.dtx}
% \title{\LaTeX{} Support For T-26 Divine Font}
% \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 T-26 Divine Font. It has
% everything you need to typeset in this font - except the fonts
% themselves.
% \end{abstract}
% \tableofcontents
%
% \clearpage
%
%
%\section{Introduction}
%\label{sec:intro}
%
% While such engines as \texttt{xetex} and \texttt{luatex} can use
% native system fonts, the installation base of \texttt{pdftex} is
% large enough to justify its continuing support with new fonts.
%
%
% This package provides support files for the Divine Font Family from
% T-26. According to the Fontname scheme~\cite{fontname}, this
% corresponds to the family |lsb|. We provide the necessary font
% files---everything but the fonts.
%
% Divine is a calligraphic font designed by Frank Heine and Marilyn
% Devedjiev in 1995 (\url{http://www.t26.com/fonts/207-Divine}) and
% distributed by T-26 foundry.
%
%
%\section{Installation}
%\label{sec:install}
%
%
%
% First, you need to purchase the font itself: the |pfb| files are
% \emph{not} included in the package. You need just one file
% |divine.pfb| If your \TeX{} system is TDS-compliant, install the
% file into \path{$TEXMF/fonts/type1/t26/divine}. Download
% \url{http://ctan.tug.org/install/fonts/psfonts/divine.tds.zip} and
% unzip this file in \path{$TEXMF}. Add |+fdv.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 style |divine.sty| provides a number of commands for using the
% font family (see Section~\ref{sec:divine.sty})
%
%
%\section{Using \LaTeX{} Style }
%\label{sec:divine.sty}
%
% To use the package, add to the preamble of your document the usual
% incantation \cmd{\usepackage}\oarg{options}|{divine}|.
%
%
% The options |scaled=...| scales divine fonts to
% the given scale.
%
% The font can be selected in the usual way:
% \begin{verbatim}
% \fontfamily{fdv}\selectfont
% \end{verbatim}
%
% \DescribeMacro{\divinefamily}
% \DescribeMacro{\textdivine}
% Alternatively you can use a declaration |\divinefamily| and a
% command |\textdivine| to set the family.
%
% \StopEventually{
% \clearpage
%
% \bibliography{divine}
% \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{divine.dtx}
%</gobble>
%<style>\ProvidesClass{divine}
%<fdv-drv>\ProvidesFile{fdv-drv.tex}
%<fdv-map>\ProvidesFile{fdv-map.tex}
[2013/03/07 v1.0 Using T26 Divine Font in LaTeX]
% \end{macrocode}
% And the driver code:
% \begin{macrocode}
%<*gobble>
\documentclass{ltxdoc}
\usepackage{booktabs}
\usepackage{url}
\usepackage[tableposition=top]{caption}
\usepackage{hypdoc}
\PageIndex
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\begin{document}
\DocInput{divine.dtx}
\end{document}
%</gobble>
% \end{macrocode}
%
%
%
%\subsection{Fontinst Driver}
%\label{sec:fdv-drv}
%
% This follows~\cite{fontinstallationguide}.
%
% First, the preamble
% \begin{macrocode}
%<*fdv-drv>
\input fontinst.sty
\substitutesilent{bx}{b}
% \end{macrocode}
%
%
% Starting recording transforms:
% \begin{macrocode}
\recordtransforms{fdv-rec.tex}
% \end{macrocode}
% A bunch of fonts:
% \begin{macrocode}
\transformfont{fdvr8r}{\reencodefont{8r}{\fromafm{divine}}}
% \end{macrocode}
%
% There is no hook in |fontinst.sty| for writing our own preamble to
% |.fd| file. However, we need to add scaling commands to the
% preamble. OK, we will patch fontinst:
% \begin{macrocode}
\fontinstcc
\def\fd_family#1#2#3{
\a_toks{#3}
\edef\lowercase_file{\lowercase{
\edef\noexpand\lowercase_file{#1#2.fd}}}
\lowercase_file
\open_out{\lowercase_file}
\out_line{\percent_char~Filename:~\lowercase_file}
\out_line{\percent_char~Created~by:~tex~\jobname}
\out_line{\percent_char~Created~using~fontinst~v\fontinstversion}
\out_line{}
\out_line{\percent_char~THIS~FILE~SHOULD~BE~PUT~IN~A~TEX~INPUTS~
DIRECTORY}
\out_line{}
\out_line{\string\ProvidesFile{\lowercase_file}}
\out_lline{[
\the\year/
\ifnum10>\month0\fi\the\month/
\ifnum10>\day0\fi\the\day\space
Fontinst~v\fontinstversion\space
font~definitions~for~#1/#2.
]}
\out_line{}
% \end{macrocode}
% Here is our patch:
% \begin{macrocode}
\out_line{\string\expandafter\string\ifx\string\csname\space
FDV@scale\string\endcsname\string\relax}
\out_line{\space\string\let\string\FDV@@scale\string\@empty}
\out_line{\string\else}
\out_line{\space\string\edef\string\FDV@@scale\left_brace_char
s*[\string\csname\space FDV@scale\string\endcsname]
\right_brace_char\percent_char}
\out_line{\string\fi\percent_char}
\out_line{}
% \end{macrocode}
% End of the patch.
% \begin{macrocode}
\out_line{\string\DeclareFontFamily{#1}{#2}{\the\a_toks}}
{
\csname #1-#2\endcsname
\out_line{}
\let\do_shape=\substitute_shape
\csname #1-#2\endcsname
\let\do_shape=\remove_shape
\csname #1-#2\endcsname
}
\x_cs\g_let{#1-#2}\x_relax
\out_line{}
\out_line{\string\endinput}
\close_out{Font~definitions}
}
\normalcc
% \end{macrocode}
%
%
% Now we install the fonts. First T1
% \begin{macrocode}
\installfonts
\installfamily{T1}{fdv}{}
\installfont{fdvr8t}{fdvr8r,newlatin}{t1}{T1}{fdv}{m}{n}{
<->\string\FDV@@scale}
\endinstallfonts
% \end{macrocode}
%
%
% Then TS1
% \begin{macrocode}
\installfonts
\installfamily{TS1}{fdv}{}
\installfont{fdvr8c}{fdvr8r,textcomp}{ts1}{TS1}{fdv}{m}{n}{
<->\string\FDV@@scale}
\endinstallfonts
% \end{macrocode}
%
%
% And OT1
% \begin{macrocode}
\installfonts
\installfamily{OT1}{fdv}{}
\installfont{fdvr7t}{fdvr8r,newlatin}{ot1}{OT1}{fdv}{m}{n}{
<->\string\FDV@@scale}
\endinstallfonts
% \end{macrocode}
%
%
% And the end:
% \begin{macrocode}
\endrecordtransforms
\bye
%</fdv-drv>
% \end{macrocode}
%
%\subsection{Fontmap Generation}
%\label{sec:fontmap}
%
% This is a standard procedure~\cite{fontinstallationguide}
% \begin{macrocode}
%<*fdv-map>
\input finstmsc.sty
\resetstr{PSfontsuffix}{.pfb}
\adddriver{dvips}{fdv.map}
\input fdv-rec.tex
\donedrivers
\bye
%</fdv-map>
% \end{macrocode}
%
%
%
%\subsection{Style File}
%\label{sec:style}
%
%
% The scaling code is from the |helvet| package:
% \begin{macrocode}
%<*style>
\newif\ifFDV@default
\FDV@defaultfalse
\RequirePackage{keyval}
\define@key{FDV}{scaled}[1.00]{%
\def\FDV@scale{#1}}
\def\ProcessOptionsWithKV#1{%
\let\@tempc\relax
\let\FDV@tempa\@empty
\ifx\@classoptionslist\relax\else
\@for\CurrentOption:=\@classoptionslist\do{%
\@ifundefined{KV@#1@\CurrentOption}%
{}%
{%
\edef\FDV@tempa{\FDV@tempa,\CurrentOption,}%
\@expandtwoargs\@removeelement\CurrentOption
\@unusedoptionlist\@unusedoptionlist
}%
}%
\fi
\edef\FDV@tempa{%
\noexpand\setkeys{#1}{%
\FDV@tempa\@ptionlist{\@currname.\@currext}%
}%
}%
\FDV@tempa
\let\CurrentOption\@empty
}
\ProcessOptionsWithKV{FDV}
\AtEndOfPackage{%
\let\@unprocessedoptions\relax
}
% \end{macrocode}
%
%
% Some new commands:
% \begin{macrocode}
\DeclareRobustCommand\divinefamily{\fontfamily{fdv}\selectfont}
\DeclareTextFontCommand{\textdivine}{\divinefamily}
%</style>
% \end{macrocode}
%
%
%\Finale
%\clearpage
%
%\PrintChanges
%\clearpage
%\PrintIndex
%
\endinput
|