<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%%%%%%%%%%%%%%%%%%%%% Start of asciisty.tex %%%%%%%%%%%%%%%%%%%%%%
%%
%% ASCIIsty.TEX
%% this is the documentation for ASCII.STY
%%
\documentstyle[a4,ascii]{article}
%%
\oddsidemargin=0mm
\evensidemargin=\oddsidemargin
\textwidth=160mm
\skip\footins=20pt plus 5pt
\parindent=1em
%%
\pagestyle{myheadings}
\markright{\underline{R. Ramasubramanian, R.W.D. Nickalls \&amp; M.A. Reed \hspace{4cm} ASCII.sty (v.1)}}
%%
\begin{document}
%%
\title{
       {{\bf ASCII.sty} {\small (version 1)}\\
        A new  style-option
       and encoded font with  IBM graphics control
characters for use with \TeX\ \&amp; \LaTeX.}
       \thanks{This document is {\sc asciisty.tex}}
      }
\author{ \\
        \\
        \\
        \\
        \\
        R. Ramasubramanian {\small MBBS, FRCAnaes.}
        \thanks{E-mail: 10016.3245@CompuServe.com}\\
        {\small \it Department of Anaesthesia,} \\
        {\small \it University Hospital,} \\
        {\small \it Queen's Medical Centre,} \\
        {\small \it Nottingham, UK.}\\
        {\small \it NG7 2UH}\\
    \and \\
         \\
         \\
         \\
         \\
        R.W.D. Nickalls {\small BSc, PhD, MBBS, FRCAnaes.}
        \thanks{E-mail: mtzrwn@uk.ac.nottingham.ccc.vax}\\
        {\small \it Senior Lecturer and Consultant,}\\
        {\small \it Department of Anaesthesia,} \\
        {\small \it University Hospital,} \\
        {\small \it Queen's Medical Centre,} \\
        {\small \it Nottingham, UK.}\\
        {\small \it NG7 2UH}\\
     \and
        M.A. Reed,
       \thanks{E-mail: rm111@uk.ac.cambridge.phoenix }\\
        {\small \it Cambridge University Press,} \\
        {\small \it Technical Applications Group,} \\
        {\small \it Printing Division,} \\
        {\small \it University Printing House,} \\
        {\small \it Shaftesbury Road,} \\
        {\small \it Cambridge, UK.}\\
        {\small \it CB2 2BS} \\
        }
\date{\vspace{1.5cm} July 10$^{th}$ 1993}
\maketitle

\newpage
{\ }
\vspace*{4cm}
\section{The files}

The files (and byte size) contained in the {\sc ascii.sty} distribution disc are as follows:

\begin{table}[h]
\begin{center}
\begin{tabular}{|l|r|l|}
\hline
\multicolumn{1}{|c|}{File name} &amp; \multicolumn{1}{|c|}{Size$^{\ast}$}
&amp; \multicolumn{1}{|c|}{Description}\\
\hline
\sc ascii.sty    &amp; 5805   &amp; The {\sc ascii} style option. \\

\sc asciisty.tex &amp; 27437  &amp; This document. \\

\sc asciisty.dvi &amp; 38796  &amp; Device Independent file for printing this document. \\

\sc ascii-10.tfm &amp; 772    &amp; \TeX\ Font Metric file for {\sc ascii-10} font. \\

\sc ascii.enc    &amp; 2459   &amp; The {\sc ascii-10} Postscript encoding vector used by {\sc afm2tfm} \\
                 &amp;        &amp; and {\sc ps2pk} to rearrange the font. \\

\sc ascii.fli    &amp; 55121   &amp; Font library containing all the {\sc ascii.pk} fonts.\\

\sc ascii300.pk  &amp; 5140   &amp; 10-point {\sc ascii-10} font file. \\

\sc ascii329.pk  &amp; 5588   &amp; 11-point {\sc ascii-10} font file. \\

\sc ascii360.pk  &amp; 6016   &amp; 12-point {\sc ascii-10} font file. \\

\sc ascii432.pk  &amp; 7068   &amp; 14-point {\sc ascii-10} font file. \\

\sc ascii518.pk  &amp; 8596   &amp; 17-point {\sc ascii-10} font file. \\

\sc ascii622.pk  &amp; 10188  &amp; 21-point {\sc ascii-10} font file. \\

\sc ascii746.pk  &amp; 12336  &amp; 25-point {\sc ascii-10} font file. \\

\sc uktexdig.doc &amp; 1783   &amp; A short note by Sebastian Rahtz. \\

\sc cour.afm     &amp; 29886  &amp; Adobe Font Metric file for {\sc ibm courier} font. \\

\sc cour.pfa     &amp; 128018 &amp; Postscript Font Ascii file for {\sc ibm courier} font. \\

\sc copyrigh.doc &amp; 523    &amp; The copyright notice by IBM. \\

\sc a4.sty       &amp; 11070  &amp; Style option needed for printing this document. \\

\sc readme.doc   &amp; 2987   &amp; Information for unpacking {\sc ascii.sty}. \\
\hline
\end{tabular}
\caption{List of all files.}
\label{listoffiles}
\end{center}
\end{table}

\vfill

\strut\makebox[2in]{\hrulefill}

{\footnotesize
${\ast}$ The size given here relates to the file size in bytes on IBM compatible PCs.}

\newpage



\begin{table}[h,t]
\begin{center}
\begin{tabular}{c|c|c|c|c|c|c|c|c|c}
\rule{0pt}{11pt}  &amp; {\it {\char'023}0} &amp; {\it {\char'023}1} &amp; {\it {\char'023}2} &amp; {\it {\char'023}3} &amp; {\it {\char'023}4} &amp; {\it {\char'023}5} &amp;{\it {\char'023}6} &amp;  {\it {\char'023}7} &amp;  \\
  \hline
 \rule{0pt}{11pt} {\it {\char'023}00x} &amp;  &amp; {\ascii \SOH} &amp; {\ascii \STX} &amp; {\ascii \ETX} &amp; {\ascii \EOT} &amp; {\ascii \ENQ} &amp; {\ascii \ACK} &amp; {\ascii \BEL} &amp;{\it{\char'175}0x} \\
  \cline{1-9}
\rule{0pt}{11pt}  {\it {\char'023}01x} &amp; {\ascii \BS} &amp; {\ascii \HT} &amp; {\ascii \LF} &amp; {\ascii \VT} &amp; {\ascii \FF} &amp; {\ascii \CR} &amp; {\ascii \SO} &amp; {\ascii \SI} &amp; \\
  \hline
 \rule{0pt}{11pt} {\it {\char'023}02x} &amp;   {\ascii \DLE} &amp; {\ascii \DCa} &amp; {\ascii \DCb} &amp; {\ascii \DCc} &amp; {\ascii \DCd} &amp; {\ascii \NAK} &amp; {\ascii \SYN} &amp; {\ascii \ETB} &amp;  {\it {\char'175}1x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}03x} &amp; {\ascii \CAN} &amp; {\ascii \EM} &amp; {\ascii \SUB} &amp; {\ascii \ESC} &amp; {\ascii \FS} &amp; {\ascii \GS} &amp; {\ascii \RS} &amp; {\ascii \US} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}04x} &amp;  &amp; {\ascii !} &amp; {\ascii "} &amp; {\ascii \#} &amp; {\ascii \$} &amp; {\ascii \%} &amp; {\ascii \&amp;} &amp; {\ascii '} &amp; {\it {\char'175}2x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}05x} &amp; {\ascii (} &amp; {\ascii )} &amp; {\ascii *} &amp; {\ascii +} &amp; {\ascii ,} &amp; {\ascii -} &amp; {\ascii .} &amp; {\ascii /} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}06x} &amp; {\ascii 0} &amp; {\ascii 1} &amp; {\ascii 2} &amp; {\ascii 3} &amp; {\ascii 4} &amp; {\ascii 5} &amp; {\ascii 6} &amp; {\ascii 7} &amp; {\it {\char'175}3x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}07x} &amp; {\ascii 8} &amp; {\ascii 9} &amp; {\ascii :} &amp; {\ascii ;} &amp; {\ascii &lt;} &amp; {\ascii =} &amp; {\ascii &gt;} &amp; {\ascii ?} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}10x} &amp; {\ascii @}  &amp; {\ascii A} &amp; {\ascii B} &amp; {\ascii C} &amp; {\ascii D} &amp; {\ascii E} &amp; {\ascii F} &amp; {\ascii G} &amp; {\it {\char'175}4x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}11x} &amp; {\ascii H} &amp; {\ascii I} &amp; {\ascii J} &amp; {\ascii K} &amp; {\ascii L} &amp; {\ascii M} &amp; {\ascii N} &amp; {\ascii O} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}12x} &amp; {\ascii P}  &amp; {\ascii Q} &amp; {\ascii R} &amp; {\ascii S} &amp; {\ascii T} &amp; {\ascii U} &amp; {\ascii V} &amp; {\ascii W} &amp; {\it {\char'175}5x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}13x} &amp; {\ascii X} &amp; {\ascii Y} &amp; {\ascii Z} &amp; {\ascii \char'133} &amp; {\ascii \char'134} &amp; {\ascii \char'135} &amp; {\ascii \char'136} &amp; {\ascii \char'137} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}14x} &amp;{\ascii `}  &amp; {\ascii a} &amp; {\ascii b} &amp; {\ascii c} &amp; {\ascii d} &amp; {\ascii e} &amp; {\ascii f} &amp; {\ascii g} &amp; {\it {\char'175}6x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}15x} &amp; {\ascii h} &amp; {\ascii i} &amp; {\ascii j} &amp; {\ascii k} &amp; {\ascii l} &amp; {\ascii m} &amp; {\ascii n} &amp; {\ascii o} &amp; \\
  \hline
 \rule{0pt}{12pt} {\it {\char'023}16x} &amp; {\ascii p}  &amp; {\ascii q} &amp; {\ascii r} &amp; {\ascii s} &amp; {\ascii t} &amp; {\ascii u} &amp; {\ascii v} &amp; {\ascii w} &amp; {\it {\char'175}7x} \\
  \cline{1-9}
\rule{0pt}{12pt}  {\it {\char'023}17x} &amp; {\ascii x} &amp; {\ascii y} &amp; {\ascii z} &amp; {\ascii \char'173} &amp; {\ascii \char'174} &amp; {\ascii \char'175} &amp; {\ascii \char'176} &amp; {\ascii \char'177} &amp; \\
\hline
\rule{0pt}{12pt}      &amp; {\it {\char'175}8} &amp; {\it {\char'175}9} &amp; {\it {\char'175}A} &amp; {\it {\char'175}B} &amp; {\it {\char'175}C} &amp; {\it {\char'175}D} &amp; {\it {\char'175}E} &amp; {\it {\char'175}F} &amp;   \\
  \end{tabular}
\end{center}
\caption{The {\sc ascii}-10 font.}
\end{table}





\section{Introduction}

ASCII.STY was developed while we were writing a book on {\it serial
interfacing}\footnote{Nickalls RWD, Ramasubramanian R,
Jahan F and Hall R (1994). Interfacing medical equipment to an IBM PC.\newline
(Cambridge University Press).}.
We were using \LaTeX\  and  wanted to include the usual table of ASCII
control
 codes and their IBM  graphics characters in the Appendix.
However, in spite of searching all the available archives,
we were unable to find a \TeX\ font
 containing {\it all\/} the graphics characters of the 7-bit
ASCII code (eg.\ {\ascii \SOH\ \CR\ \SO\  \SI\ \FS\ \splitvert\ \DEL}\ etc.).

One of us (Mark Reed) noticed that the  same problem was
raised in a recent issue UK\TeX\ Digest\footnote{See note by Sebastian Rahtz
on `AFM files for IBM Courier' in UKTeX Digest, Friday 18 Dec 1992,
 Vol 92: Issue 47.}, in which it was suggested that a possible solution
might be to derive the characters from the public domain Postscript
 {\sc ibm courier} font donated by IBM to the X Consortium.

We therefore downloaded the {\sc ibm courier} font, which consists of
two files {\sc cour.afm} and {\sc cour.pfa}, and duly got to work extracting
the characters and generating the necessary {\sc .tfm} and bit-mapped
{\sc .pk} files.

In practice, however, it was not at all easy owing to a paucity of
documentation on just exactly how to do this.
This article therefore details what we did and how we did it, and {\sc ascii.sty} is the result.

In order to avoid any confusion and to clearly distinguish
the new derivative font from the original IBM {\sc courier} font, this 
document will refer to the new derivative font as {\sc ascii}-10.

We have restricted our efforts to the first 128 characters of the PC character set because the term ASCII, as used by the original ANSI
standard\footnote{American National Standard X3.4 (1986). Available from the American National Standards Institute, 1430 Broadway, New York, 10018.}, refers only to the first 128 characters.


Those who are interested in unmasking the characters 128--255 in the PC character set may wish to examine some of the other {\sc .afm} files
 held in the Aston \TeX\ archive  (eg.\ {\sc crb-pc8.afm};
{\sc cri-pc8.afm}).



\section{The ASCII font}

Table 1 shows the 10-point {\sc ascii-10} font which we derived from
the {\sc ibm courier} font.
Different sizes can be generated using the \TeX\ magstep  procedure.

Each element in the font table can be accessed in the usual way by using
the \verb!\char! command.
For example, the style option {\sc ascii.sty} allocates  the
command \verb!\CR! for the  Carriage Return character as
 follows.



\begin{enumerate}
\item The new font is defined as \verb!\ascii! using
       \verb!\newfont{\ascii}{ascii-10}!

\item The new command  \verb!\CR! is defined  using
 \verb!\newcommand{\CR}{\char'015}!.

\end{enumerate}

Now when the command \verb!{\ascii\CR}! is used in the text it produces the
symbol {\ascii\CR}. The brackets are needed to keep the \verb!\ascii!
font local.


\section{Installing the font files}
\subsubsection*{Em\TeX\ implementation}

In order to use {\sc ascii.sty} the various font files ({\sc .pk} and
{\sc.tfm} files) need to be placed in the correct directories, as specified by Em\TeX.

\underline{{\sc ascii-10.tfm} file}: This file goes into
the usual $\backslash${\sc emtex}$\backslash${\sc tfm} directory.

\underline{{\sc ascii.fli} library}: This library of all {\sc ascii.pk} files goes into
the usual $\backslash${\sc texfonts} directory.

\subsubsection*{Non-Em\TeX\ implementations}
For those not using Em\TeX\, the separate {\sc ascii.pk} files are also
provided.
Although all the {\sc .pk} files initially have names which indicate the
dpi size (eg.\ {\sc ascii300.pk}), once correctly located in their respective subdirectories, they must all then
be renamed so that they all have the same name {\sc ascii-10.pk}.


\subsection{Adjusting the {\sc lj.cnf} file}

In order that Em\TeX\ can find all  fonts, the path for the fonts
in the {\sc lj.cnf} file (in the $\backslash${\sc emtex} directory)
may need to be altered to accommodate the directory structure of
$\backslash${\sc texfonts}.

The authors use the following library line (\verb!/pl!) in the {\sc lj.cnf} file.
\begin{verbatim}
  /pl=%DVIDRVFONTS%;lj_0;lj_h;lj_1;lj_2;lj_3;lj_4;lj_5a;lj_5b;lj_6;ascii;
\end{verbatim}

\section{Using {\sc ascii.sty}}

Place {\sc ascii.sty} in the {$\backslash$}{\sc texinput} directory,
and then use  the style option [{\sc ascii}] in the {$\backslash$}%
documentstyle command in the usual way.
{\sc ascii.sty} includes seven magnifications  of the {\sc ascii-10} font
as follows: magstep 0, half, 1, 2, 3, 4, 5, which are equivalent to point
sizes 10, 11, 12, 14, 17, 21, 25 respectively.
Note that the relationship between point size and magstep is such that
the point size corresponding to magstep {\bf n} is
$10 \times {1.2}^n$. ie.\ magstep 0 is equal to 10-point size.

Using {\sc ascii.sty}  an {\sc ascii}  character  is most easily
printed using the \verb#\ascii# command followed by the character
in the usual way. For example, \verb!{\ascii 5}! will print  the
number  {\ascii 5} from the {\sc ascii-10} font table.
The {\sc ascii.sty} style option will  automatically select the font size
currently being used in the document (eg.\ 10, 11, 12 point).
For convenience all the control characters except the four DC$_{1-4}$ have
been allocated  their usual code name (in {\it uppercase\/} letters);
thus the carriage return symbol ({\ascii\CR})
is called \verb#\CR#  and would be printed using \verb#{\ascii\CR}#.
The four Device Control characters DC1, DC2, DC3, DC4  have been 
allocated the commands \verb!\DCa!, \verb!\DCb!, \verb!\DCc!, \verb!\DCd!,
since \TeX\ does not allow commands to contain integers.

Two other characters in the {\sc ascii-10} font table which are not
usually available for \TeX\ users are
\begin{itemize}
\item {\ascii\DEL} (\verb!\DEL!) which is printed using
       \verb!{\ascii\DEL}!.
\item {\ascii \splitvert} (\verb!\splitvert!) which is printed using
      \verb!{\ascii\splitvert}!.
This name was chosen to be in keeping with Knuth's \verb!\vert! which is
$\vert$.
\end{itemize}

The standard codes and the coding  used by {\sc ascii.sty} for the control
 characters are shown in Table~\ref{asciitable}.


%*******************
\begin{table}[h,b,t]
\begin{center}
\begin{tabular}{|l|l|l|l|l|c|l|}
   \hline
   \multicolumn{7}{|c|}{\bf ASCII control codes} \\
   \hline
   \multicolumn{1}{|l|}{\it Dec} &amp;
   \multicolumn{1}{|l|}{\it Code} &amp;
   \multicolumn{1}{|l|}{\it Hex} &amp; &amp;
   \multicolumn{1}{|l|}{\it Name} &amp;
   \multicolumn{1}{|l|}{\it IBM}   &amp;
   \multicolumn{1}{|l|}{ {\sc ascii.sty}}   \\
   \hline
 0  &amp; NUL  &amp; 00h &amp; ${}^{\wedge}${\it \symbol{'100}}  &amp;  Null  &amp; --- &amp;  --- \\
 1  &amp; SOH  &amp; 01h &amp; ${}^{\wedge}$A &amp; Start of heading &amp; {\asciiXII \SOH} &amp; \verb!\SOH! \\
 2  &amp; STX  &amp; 02h &amp; ${}^{\wedge}$B &amp; Start of text  &amp; {\asciiXII \STX} &amp; \verb!\STX! \\
 3  &amp; ETX  &amp; 03h &amp; ${}^{\wedge}$C &amp; End of text  &amp; {\asciiXII \ETX} &amp; \verb!\ETX! \\
 4  &amp; EOT  &amp; 04h &amp; ${}^{\wedge}$D &amp; End of transmission &amp; {\asciiXII \EOT} &amp; \verb!\EOT! \\
 5  &amp; ENQ  &amp; 05h &amp; ${}^{\wedge}$E &amp; Enquiry &amp; {\asciiXII \ENQ} &amp; \verb!\ENQ! \\
 6  &amp; ACK  &amp; 06h &amp; ${}^{\wedge}$F &amp; Acknowledge &amp; {\asciiXII \ACK}  &amp; \verb!\ACK! \\
 7  &amp; BEL  &amp; 07h &amp; ${}^{\wedge}$G &amp; Bell &amp; {\asciiXII \BEL} &amp; \verb!\BEL! \\
 8  &amp; BS   &amp; 08h &amp; ${}^{\wedge}$H &amp; Back space &amp; {\asciiXII \BS} &amp; \verb!\BS!\\
 9  &amp; HT   &amp; 09h &amp; ${}^{\wedge}$I &amp; Horizontal tab &amp; {\asciiXII \HT} &amp; \verb!\HT! \\
 10  &amp; LF  &amp; 0Ah &amp; ${}^{\wedge}$J &amp; Linefeed &amp; {\asciiXII \LF} &amp; \verb!\LF! \\
 11  &amp; VT  &amp; 0Bh &amp; ${}^{\wedge}$K &amp; Vertical tab &amp; {\asciiXII \VT} &amp; \verb!\VT!\\
12  &amp; FF   &amp; 0Ch &amp; ${}^{\wedge}$L &amp; Formfeed &amp; {\asciiXII \FF} &amp; \verb!\FF! \\
13  &amp; CR   &amp; 0Dh &amp; ${}^{\wedge}$M &amp; Carriage return &amp; {\asciiXII \CR} &amp;\verb!\CR! \\
14  &amp; SO   &amp; 0Eh &amp; ${}^{\wedge}$N &amp; Shift out &amp; {\asciiXII \SO} &amp; \verb!\SO!\\
15  &amp; SI   &amp; 0Fh &amp; ${}^{\wedge}$O &amp; Shift in &amp; {\asciiXII \SI} &amp; \verb!\SI! \\
16  &amp; DLE  &amp; 10h &amp; ${}^{\wedge}$P &amp; Data link escape &amp; {\asciiXII \DLE} &amp;\verb!\DLE!\\
17 &amp; DC1   &amp; 11h &amp; ${}^{\wedge}$Q &amp; Device control 1 (XON)  &amp; {\asciiXII \DCa} &amp; \verb!\DCa! \\
18  &amp; DC2  &amp; 12h &amp; ${}^{\wedge}$R &amp; Device control 2 &amp; {\asciiXII \DCb} &amp; \verb!\DCb! \\
19 &amp; DC3   &amp; 13h &amp; ${}^{\wedge}$S &amp; Device control 3 (XOFF) &amp; {\asciiXII \DCc} &amp; \verb!\DCc! \\
20  &amp; DC4  &amp; 14h &amp; ${}^{\wedge}$T &amp; Device control 4 &amp; {\asciiXII \DCd} &amp; \verb!\DCd! \\
21  &amp; NAK  &amp; 15h &amp; ${}^{\wedge}$U &amp; Negative acknowledge &amp; {\asciiXII \NAK} &amp; \verb!\NAK!\\
22  &amp; SYN  &amp; 16h &amp; ${}^{\wedge}$V &amp; Synchronous idle &amp; {\asciiXII \SYN} &amp; \verb!\SYN!\\
23  &amp; ETB  &amp; 17h &amp; ${}^{\wedge}$W &amp; End transmission block &amp; {\asciiXII \ETB} &amp; \verb!\ETB! \\
24  &amp; CAN  &amp; 18h &amp; ${}^{\wedge}$X &amp; Cancel &amp; {\asciiXII \CAN} &amp; \verb!\CAN! \\
25  &amp; EM   &amp; 19h &amp; ${}^{\wedge}$Y &amp; End of medium  &amp; {\asciiXII \EM} &amp; \verb!\EM! \\
26  &amp; SUB  &amp; 1Ah &amp; ${}^{\wedge}$Z &amp; Substitute ( EOF) &amp; {\asciiXII \SUB} &amp; \verb!\SUB!\\
27  &amp; ESC  &amp; 1Bh &amp; ${}^{\wedge}$[ &amp; Escape &amp; {\asciiXII \ESC} &amp; \verb!\ESC! \\
28  &amp; FS   &amp; 1Ch &amp; ${}^{\wedge}\backslash$ &amp; File separator &amp; {\asciiXII \FS} &amp; \verb!\FS! \\
29  &amp; GS   &amp; 1Dh &amp; ${}^{\wedge}$] &amp; Group separator &amp; {\asciiXII \GS} &amp; \verb!\GS! \\
30  &amp; RS   &amp; 1Eh &amp; ${}^{\wedge}{}^{\wedge}$ &amp; Record separator &amp; {\asciiXII \RS} &amp; \verb!\RS!  \\
 31  &amp; US  &amp; 1Fh &amp; ${}^{\wedge}$\_ &amp; Unit separator &amp; {\asciiXII \US} &amp; \verb!\US! \\
 124  &amp; ---  &amp; 7Ch &amp; --- &amp; --- &amp; {\asciiXII \splitvert} &amp; \verb!\splitvert! \\
 127  &amp; DEL  &amp; 7Fh &amp; --- &amp; Delete &amp; {\asciiXII \DEL} &amp; \verb!\DEL! \\
\hline
\end{tabular}
\end{center}
\caption{{\sc ascii} table of control characters.}
\label{asciitable}
\end{table}
%*************************



\subsection{Using other sizes}

When an {\sc ascii} character having a different point size to the one
being used for the document is required, then a different command without
integers has to be used.


In view of this restriction {\sc ascii.sty} uses Roman numerals to indicate
both point size (eg.\ \verb!\asciiXII! for 12-point size) and
magstep number (eg.\ \verb!\asciimsV! for magstep 5), as shown
in Table~\ref{fontsizes}.
For example,  a 21-point  heart shape {\asciiXXI \ETX} can be  printed
using either of the
commands \verb#{\asciiXXI\ETX}#\ or\ \verb#{\asciimsIV\ETX}#.

\begin{table}[h,t]
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
\multicolumn{2}{|c|}{Using point sizes}&amp;
\multicolumn{2}{|c|}{Using magstep Nos.}\\
\hline
10 &amp; {$\backslash$}asciiX   &amp; Zero\ (msZ) &amp; {$\backslash$}asciimsZ \\
11 &amp; {$\backslash$}asciiXI   &amp; Half\ (msH) &amp; {$\backslash$}asciimsH \\
12 &amp; {$\backslash$}asciiXII   &amp; 1\ (msI) &amp; {$\backslash$}asciimsI \\
14 &amp; {$\backslash$}asciiXIV   &amp; 2\ (msII) &amp; {$\backslash$}asciimsII \\
17 &amp; {$\backslash$}asciiXVII   &amp; 3\ (msIII) &amp; {$\backslash$}asciimsIII \\
21 &amp; {$\backslash$}asciiXXI   &amp; 4\ (msIV) &amp; {$\backslash$}asciimsIV \\
25 &amp; {$\backslash$}asciiXXV   &amp; 5\ (msV) &amp; {$\backslash$}asciimsV \\
\hline
\end{tabular}
\end{center}
\caption{Font size commands for point and magstep.}
\label{fontsizes}
\end{table}



Examples of the characters and sizes given by the commands are shown below.

\medskip
\hspace*{1cm} The 10 point font: \verb#{\asciimsZ\SO}# and \verb#{\asciiX\SO}#  give {\asciimsZ \SO}

\hspace*{1cm} The 11 point font: \verb#{\asciimsH\SO}# and \verb#{\asciiXI\SO}#  give {\asciimsH \SO}

\hspace*{1cm} The 12 point font: \verb#{\asciimsI\SO}# and \verb#{\asciiXII\SO}#  give {\asciimsI \SO}

\hspace*{1cm} The 14 point font: \verb#{\asciimsII\SO}# and \verb#{\asciiXIV\SO}#  give {\asciimsII \SO}

\hspace*{1cm} The 17 point font: \verb#{\asciimsIII\SO}# and
 \verb#{\asciiXVII\SO}#  give {\asciimsIII \SO}

\hspace*{1cm} The 21 point font: \verb#{\asciimsIV\SO}# and \verb#{\asciiXXI\SO}#  give {\asciimsIV \SO}

\hspace*{1cm} The 25 point font: \verb#{\asciimsV\SO}# and \verb#{\asciiXXV\SO}#  give {\asciimsV \SO}



\section {Generating the {\sc ascii} font.}

As indicated earlier, the {\sc ibm courier} font files ({\sc cour.afm}
and {\sc cour.pfa}) contained all the graphics characters  needed for
typesetting a 7-bit ASCII table. In order to make use of this font in an
non-Postscript \TeX\ or \LaTeX\ environment, we needed to generate the
following:
\begin{itemize}
\item A {\sc .tfm} file from the corresponding Postscript {\sc .afm} file.
\item An MS-DOS binary {\sc .pfb} font file from the corresponding
       {\sc .pfa} font file
   (a Unix text file).
\item A bit-mapped {\sc .pk} font file from the corresponding {\sc .pfb}
      file.
\end{itemize}

The first step requires a program called {\sc afm2tfm}; the second step
requires a program called {\sc t1binary};
and the third step requires the program {\sc ps2pk}.
Fortunately, all the programs required for performing these
conversions on a PC are readily available from {\bf ftp.urc.tue.nl
[131.155.2.79]} in their /{\sc tex}/{\sc emtex} directory.
The various steps are shown in Figure~\ref{boxes}.

\begin{figure}[h,t]
\begin{center}
%
% afm2tfm stage
%
\vbox{%
     \framebox{%
        \vbox{%
          \hbox{\sc afm2tfm}

          \hbox{+\ \sc cour.afm}

          \hbox{+\ \sc ascii.enc}
        }
      }
      $\longrightarrow$
%
      \framebox{\sc ascii-10.tfm}
%
}


\vspace{1cm}

% .pfa to .pfb stage
%
\framebox{%
  \vbox{%
    \hbox{\sc t1binary}

    \hbox{+\ \sc cour.pfa}

   \hbox{(Unix text file)}
  }
}
%
$\longrightarrow$
%
\framebox{%
  \vbox{%
    \hbox{\sc cour.pfb}

    \hbox{(binary file)}
  }
}

\vspace{1cm}

% .pfb to .pk stage
%

\framebox{%
  \vbox{%
    \hbox{\sc ps2pk}

    \hbox{+\ \sc cour.pfb}

    \hbox{+\ \sc cour.afm}

    \hbox{+\ \sc ascii.enc}
  }
}
%
$\longrightarrow$
%
\framebox{%
  \vbox{%
    \hbox{\sc ascii300.pk}

    \hbox{(bit-mapped file)}
  }
}
%
\end{center}
\caption{Sequence of file changes to generate {\sc ascii-10.tfm} and
         {\sc ascii300.pk}.}
 \label{boxes}
\end{figure}


\subsection{Generating the {\sc .tfm} file}

Normally this would  be straightforward since the {\sc afm2tfm} program
reads a Postscript font metric information file (ie.\ an {\sc .afm} file)
and produces a {\sc .tfm} file.

\newpage
In practice, it was not easy to establish which characters were in the
{\sc cour.afm} file since there was no documentation.
For example, we could only discover by trial and error that the line
\begin{verbatim}
  C -1 ; WX 600 ; N SV040000 ; B 102 96 498 467 ;
\end{verbatim}
referred to the {\sc ascii} character {\ascii \US}. Note that the
\hbox{C --1} code indicates that the  character is {\it not\/} `visible'.


Once we had established the relative positions of the characters in the
{\sc .afm} file, it was fairly easy to generate an `encoding vector'
file ({\sc ascii.enc}).
The following is an extract from the {\sc ascii.enc} file:
\begin{verbatim}
  /asciiEncoding [
    /spacenumeric  /SS000000  /SS010000  /heart        /diamond
    /club          /spade     /bullet    /SM570001     /SM750000
    /SM750002      /male      /female    /musicalnote  /musicalnotedbl
    :
    :
    /.notdef  /.notdef  /.notdef  /.notdef  /.notdef
  ] def
\end{verbatim}
The {\sc ascii.enc} file contains 128 character names each preceded by
\verb|/|. 
The order of the names in this file specifies
the order of the characters in the \TeX\ font.
Any character position which is not defined (ie.\ those character positions with a value 
$&gt;$ 127) are designated \verb|/.notdef|. 

Once we had generated a complete {\sc ascii.enc} file,  the
 {\sc ascii-10.tfm} file  was generated  using the following command.
\begin{verbatim}
  afm2tfm cour.afm -T ascii.enc ascii-10.tfm
\end{verbatim}
Newer versions of {\sc afm2tfm} will automatically print out a line
suitable for inclusion in {\sc psfonts.map} for use with {\sc dvips}.
IGNORE the automatically generated line and see the section below on using
{\sc dvips} for more information.

For further information on {\sc afm2tfm}, the reader should refer to the
documentation which accompanies this program.
Readers who wish to know more about the codes found in {\sc .afm} files
 should consult the Postscript Language Reference Manual [the Red Book]
published by the Adobe Corporation.

\subsection{Conversion of PFA to PFB format}

When {\sc ps2pk} is run on PCs with MS-DOS, the program will only read
{\sc .pfb} files and not {\sc .pfa} files. In view of this, it was
necessary to first convert the {\sc .pfa} font file (which is a Unix
text file), into an  MS-DOS binary ({\sc .pfb}) font file using the
program {\sc t1binary}, using the following command:
\begin{verbatim}
  t1binary cour.pfa cour.pfb
\end{verbatim}


\subsection{Generating the {\sc .pk} bit-mapped file}

The {\sc pfb} file generated in the previous step, can now be used
by {\sc ps2pk} to produce a {\sc .pk} font file. This is done with
the following command  (note that
{\sc ps2pk} requires that  {\sc cour.afm}
is also in the same subdirectory):
\begin{verbatim}
  ps2pk -e ascii.enc cour.pfb ascii300.pk
\end{verbatim}
This produces a 10-point {\sc ascii300.pk} file (ie.\ {\sc ascii-10}) for an output device
with a resolution of 300dpi.
For further information regarding the command line switches and the use
of Postscript fonts with \TeX\ and \LaTeX, please read the detailed
documentation which comes with the {\sc ps2pk} package.


\section{Magnifying the {\sc ascii-10} font}

As indicated  earlier, the steps described above will produce the font at
its optimal 10-point design size ie.\ {\sc ascii-10} (since it was derived
from the 10-point {\sc ibm courier} font) and for an output device with
a resolution of 300dpi.

In order to produce an {\sc ascii} table with larger size graphics characters in
it, additional {\sc .pk} files must be generated (eg.\ {\sc ascii360.pk})
which contain magnified versions of these characters. This is done using
{\sc ps2pk} with the \verb|-X| flag as follows.
\begin{verbatim}
  ps2pk -e ascii.enc -X360 cour.pfb ascii360.pk
\end{verbatim}
Using \verb|-X360| will produce a 12-point font by magnifying a 10-point
design size font. By varying the \verb|-X| value different magnified sizes
can be obtained.

When all the necessary {\sc .pk} files have been produced, they can be gathered into a single compact font library ({\sc ascii-10.fli} in this case) using a program called {\sc fontlib}. This program and its documentation may be found in the standard Em\TeX\ package distributed by the Aston \TeX\ archive.
 
\section{Using {\sc ascii-10} with Tomas Rokicki's {\sc dvips}}

Using any Postscript font is extremely easy with {\sc dvips}, and
{\sc ascii-10} is no exception.
Simply copy the {\sc cour.afm}, {\sc cour.pfb} and {\sc ascii.enc} files to
{\sc dvips's} header directory. Then add the following line to the end of
{\sc psfonts.map}.
\begin{verbatim}
  ascii-10 Courier &lt;cour.pfb " asciiEncoding ReEncodeFont " &lt;ascii.enc
\end{verbatim}
Don't use the line generated by {\sc afm2tfm} as it will not work!

Once {\sc dvips} has been configured in this way, it will automatically use
the Postscript outline instead of using a bitmap. This gives much better
output quality and is resolution independent.

\begin{center}
$\diamond\diamond\diamond$
\end{center}

\end{document}

%%%%%%%%%%%%%%%%%%%%%% End of asciisty.tex %%%%%%%%%%%%%%%%%%%%%%



\begin{center}
$\diamond\diamond\diamond$
\end{center}

</pre></body></html>