Debian Codegraph @

texmf-dist/source/fonts/ascii-font/ascii.dtx

raw
1 %% \CharacterTable
2 %% {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
3 %% 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
4 %% Digits \0\1\2\3\4\5\6\7\8\9
5 %% Exclamation \! Double quote \" Hash (number) \#
6 %% Dollar \$ Percent \% Ampersand \&
7 %% Acute accent \' Left paren \( Right paren \)
8 %% Asterisk \* Plus \+ Comma \,
9 %% Minus \- Point \. Solidus \/
10 %% Colon \: Semicolon \; Less than \<
11 %% Equals \= Greater than \> Question mark \?
12 %% Commercial at \@ Left bracket \[ Backslash \\
13 %% Right bracket \] Circumflex \^ Underscore \_
14 %% Grave accent \` Left brace \{ Vertical bar \|
15 %% Right brace \} Tilde \~}
16 %\iffalse
17 %
18 % (c) copyright 2006 A Syropoulos & RWD Nickalls
19 % This program can be redistributed and/or modified under the terms
20 % of the LaTeX Project Public License Distributed from CTAN
21 % archives in directory macros/latex/base/lppl.txt; either
22 % version 1 of the License, or any later version.
23 %
24 % Please report errors or suggestions for improvement to
25 %
26 % Apostolos Syropoulos and/or Dick Nickalls
27 % [email protected] [email protected]
28 %
29 %\fi
30 % \CheckSum{286}
31 % \iffalse This is a Metacomment
32 %
33 %<ascii, >\ProvidesFile{ascii.sty}
34 %
35 %<ascii, > [2006/05/30 v2.0 Package `ascii.sty']
36 %
37 % \begin{macrocode}
38 %<*driver>
39 \documentclass{ltxdoc}
40 \usepackage{ascii,fullpage}
41 \GetFileInfo{ascii.drv}
42 \begin{document}
43 \DocInput{ascii.dtx}
44 \end{document}
45 %</driver>
46 % \end{macrocode}
47 % \fi
48 %\StopEventually{}
49 %\MakeShortVerb{\|}
50 %\title{The `ascii' package}
51 %\author{A. Syropoulos and R.W.D. Nickalls}
52 % \date{2006/05/30}
53 %\maketitle
54 % \begin{abstract}
55 % The \textsf{ascii} package provides glyph and font access commands so
56 % that \LaTeX\ users can use the ASCII font in their documents. The ASCII font
57 % is encoded according to the {\em IBM PC Code Page 437 C0 Graphics}. This
58 % package replaces any early \LaTeX2.09 package and "font" by R. Ramasubramanian and
59 % R.W.D. Nickalls.
60 % symbols.
61 %\end{abstract}
62 %
63 % \section{Introduction}
64 % In a number of documents it is quite useful to be able to use the graphical
65 % representation of the first 32 ASCII characters as these have been defined
66 % in the {\em IBM PC Code Page 437 C0 Graphics}. For this reason, in 1993 R. Ramasubramanian and
67 % R.W.D. Nickalls implemented the \textsf{ascii} package and provided a font so to allow
68 % \LaTeX\ users to typeset the graphical representation of these characters. The present package
69 % is a rewrite of the original package that relies on a new Type~1 font designed from scratch.
70 % Naturally, the new package uses the NFSS to provide access to the accompanying font.
71 %
72 % Table~\ref{tab:1} shows the
73 % the graphical representation of the various ASCII control characters. Notice
74 % that these graphical representations are now part of the Unicode standard
75 % as individual characters, which, however, do not represent the actual control
76 % characters. In other words, the visual representations of the the control characters are now
77 % Unicode characters. In addition, the new font included a visual representation of the
78 % ``NO BREAK SPACE'' character, since it is practically a font ``implementing'' the
79 % ISO8859-7 character set.
80 %
81 % To access the control characters one can use the commands of the following
82 % table:
83 % \begin{center}
84 % \begin{tabular}{cccc}\hline
85 % Command & ASCII & Command & ASCII \\ \hline
86 % \verb|\SOH| & 0x1 & \verb|\DCa| & 0x11 \\
87 % \verb|\STX| & 0x2 & \verb|\DCb| & 0x12 \\
88 % \verb|\ETX| & 0x3 & \verb|\DCc| & 0x13 \\
89 % \verb|\EOT| & 0x4 & \verb|\DCd| & 0x14 \\
90 % \verb|\ENQ| & 0x5 & \verb|\NAK| & 0x15 \\
91 % \verb|\ACK| & 0x6 & \verb|\SYN| & 0x16 \\
92 % \verb|\BEL| & 0x7 & \verb|\ETB| & 0x17 \\
93 % \verb|\BS| & 0x8 & \verb|\CAN| & 0x18 \\
94 % \verb|\HT| & 0x9 & \verb|\EM| & 0x19 \\
95 % \verb|\LF| & 0xA & \verb|\SUB| & 0x1A \\
96 % \verb|\VT| & 0xB & \verb|\ESC| & 0x1B \\
97 % \verb|\FF| & 0xC & \verb|\FS| & 0x1C \\
98 % \verb|\CR| & 0xD & \verb|\GS| & 0x1D \\
99 % \verb|\SO| & 0xE & \verb|\RS| & 0x1E \\
100 % \verb|\SI| & 0xF & \verb|\US| & 0x1F \\
101 % \verb|\DEL| & 0x10 & \verb|\DEL| & 0x7F \\
102 % \verb|\NUL| & 0x0 & \verb|\NBSP| & 0x20 \\
103 %\hline
104 % \end{tabular}
105 % \end{center}
106 % Unfortunately, the standard glyph access commands for the various special
107 % \LaTeX\ symbols do not give the expected results and, so, we had to define
108 % a number of commands to provide access to these special glyphs. These
109 % commands are shown below:
110 %\begin{center}
111 %\begin{tabular}{lc}\hline
112 %Command & Character \\ \hline
113 %\verb|\asciihash| & \asciihash\\
114 %\verb|\asciipercent| & \asciipercent\\
115 %\verb|\asciicircum| & \asciicircum\\
116 %\verb|\asciitilde| & \asciitilde\\
117 %\verb|\asciilbrace| & \asciilbrace\\
118 %\verb|\asciidollar| & \asciidollar\\
119 %\verb|\asciiampersand| & \asciiampersand\\
120 %\verb|\asciiunderscore| & \asciiunderscore\\
121 %\verb|\asciibackslash| & \asciibackslash\\
122 %\verb|\asciirbrace| & \asciirbrace\\
123 %\verb|\asciispace| & \asciispace\\
124 %\verb|\asciivert| & \asciivert\\
125 %\verb|\splitvert| & \splitvert\\
126 %\verb|\isosplitvert| & \isosplitvert\\
127 %\verb|\asciiquotedbl| & \asciiquotedbl\\
128 %\verb|\asciiquotegrave| & \asciiquotegrave\\
129 %\verb|\asciiquoteacute| & \asciiquoteacute\\\hline
130 %\end{tabular}
131 %\end{center}
132 % The reader should be aware that all these glyph access commands have been implemented
133 % using the \textsf{xspace} package and, thus, one does need to take any special
134 % precaution when using them. In addition, if someone wishes to typeset Greek text using
135 % this package, he/she needs to use a Greek keyboard as there are no special glyph access
136 % commands for the ``Greek'' characters of ISO8859-7.
137 %
138 % The command \verb|\textascii| is a font switching command and its argument is
139 % typeset using the ASCII font.
140 %\begin{table}
141 %\begin{center}
142 %\begin{tabular}{crlc}\hline\hline
143 % Code & IBM & Unicode Name & Glyph\\ \hline\hline
144 % 2400 & 00 & NUL & \textascii{\char"00}\\
145 % 263A & 01 & White smiling face & \textascii{\char"01}\\
146 % 263B & 02 & Black smiling face & \textascii{\char"02}\\
147 % 2665 & 03 & Black heart suit & \textascii{\char"03}\\
148 % 2666 & 04 & Black diamond suit & \textascii{\char"04}\\
149 % 2663 & 05 & Black club suit & \textascii{\char"05}\\
150 % 2660 & 06 & Black space suit & \textascii{\char"06}\\
151 % 2022 & 07 & Bullet & \textascii{\char"07}\\
152 % 25D8 & 08 & Inverse bullet & \textascii{\char"08}\\
153 % 25EF & 09 & Large circle & \textascii{\char"09}\\
154 % 25D9 & 0A & Inverse white circle & \textascii{\char"0A}\\
155 % 2642 & 0B & Male sign & \textascii{\char"0B}\\
156 % 2640 & 0C & Female sign & \textascii{\char"0C}\\
157 % 266A & 0D & Eighth note & \textascii{\char"0D}\\
158 % 266C & 0E & Beamed 16th notes & \textascii{\char"0E}\\
159 % 263C & 0F & White sun with rays & \textascii{\char"0F}\\
160 % 25BA & 10 & Black right-pointing pointer & \textascii{\char"10}\\
161 % 25C4 & 11 & Black left-pointing pointer & \textascii{\char"11}\\
162 % 2195 & 12 & Up down arrow & \textascii{\char"12}\\
163 % 203C & 13 & Double exclamation mark & \textascii{\char"13}\\
164 % 00B6 & 14 & Pilcrow sign & \textascii{\char"14}\\
165 % 00A7 & 15 & Section sign & \textascii{\char"15}\\
166 % 25AC & 16 & Black rectangle & \textascii{\char"16}\\
167 % 21A8 & 17 & Up down arrow with base & \textascii{\char"17}\\
168 % 2191 & 18 & Upwards arrow & \textascii{\char"18}\\
169 % 2193 & 19 & Downwards arrow & \textascii{\char"19}\\
170 % 2192 & 1A & Rightwards arrow & \textascii{\char"1A}\\
171 % 2190 & 1B & Leftwards arrow & \textascii{\char"1B}\\
172 % 2319 & 1C & Turned not sign & \textascii{\char"1C}\\
173 % 2194 & 1D & Left right arrow & \textascii{\char"1D}\\
174 % 25B2 & 1E & Black up-pointing triangle & \textascii{\char"1E}\\
175 % 25BC & 1F & Black down-pointing triangle & \textascii{\char"1F}\\
176 % 00A0 & -- & NO BREAK SPACE & \textascii{\char"A0}\\\hline
177 %\end{tabular}
178 %\end{center}
179 % \caption{The graphical representation of the first 32 ASCII characters
180 % provided by the ASCII font.}\label{tab:1}
181 %\end{table}
182 %
183 % \section{The Source Code}
184 % The first thing we need to do is to define a new font family and the relevant
185 % font substitutions.
186 % \begin{macrocode}
187 %<*ascii>
188 \DeclareFontFamily{U}{ascii}{\hyphenchar \font\m@ne}
189 \DeclareFontShape{U}{ascii}{m}{n}{
190 <-> ASCII}{}
191 \DeclareFontShape{U}{ascii}{m}{sl}{
192 <-> ssub * ascii/m/n}{}
193 \DeclareFontShape{U}{ascii}{m}{it}{
194 <-> ssub * ascii/m/n}{}
195 \DeclareFontShape{U}{ascii}{m}{sc}{
196 <-> ssub * ascii/m/n}{}
197 \DeclareFontShape{U}{ascii}{bx}{n}{
198 <-> ssub * ascii/m/n}{}
199 \DeclareFontShape{U}{ascii}{bx}{sl}{
200 <-> ssub * ascii/m/n}{}
201 \DeclareFontShape{U}{ascii}{bx}{it}{
202 <-> ssub * ascii/m/n}{}
203 \DeclareFontShape{U}{ascii}{bx}{sc}{
204 <-> ssub * ascii/m/n}{}
205 % \end{macrocode}
206 % Now we need to define a font access command:
207 % \begin{macrocode}
208 \def\asciifamily{\fontencoding{U}\fontfamily{ascii}\selectfont}
209 \long\def\textascii#1{{\asciifamily #1}}
210 % \end{macrocode}
211 % The next step is to define glyph access commands for the first 32 glyphs
212 % of the font and the various special \TeX\ characters.
213 % \begin{macrocode}
214 \RequirePackage{xspace}
215 \def\NUL{{\asciifamily\char"00}\xspace}
216 \def\SOH{{\asciifamily\char"01}\xspace}
217 \def\STX{{\asciifamily\char"02}\xspace}
218 \def\ETX{{\asciifamily\char"03}\xspace}
219 \def\EOT{{\asciifamily\char"04}\xspace}
220 \def\ENQ{{\asciifamily\char"05}\xspace}
221 \def\ACK{{\asciifamily\char"06}\xspace}
222 \def\BEL{{\asciifamily\char"07}\xspace}
223 \def\BS{{\asciifamily\char"08}\xspace}
224 \def\HT{{\asciifamily\char"09}\xspace}
225 \def\LF{{\asciifamily\char"0A}\xspace}
226 \def\VT{{\asciifamily\char"0B}\xspace}
227 \def\FF{{\asciifamily\char"0C}\xspace}
228 \def\CR{{\asciifamily\char"0D}\xspace}
229 \def\SO{{\asciifamily\char"0E}\xspace}
230 \def\SI{{\asciifamily\char"0F}\xspace}
231 \def\DLE{{\asciifamily\char"10}\xspace}
232 \def\DCa{{\asciifamily\char"11}\xspace}
233 \def\DCb{{\asciifamily\char"12}\xspace}
234 \def\DCc{{\asciifamily\char"13}\xspace}
235 \def\DCd{{\asciifamily\char"14}\xspace}
236 \def\NAK{{\asciifamily\char"15}\xspace}
237 \def\SYN{{\asciifamily\char"16}\xspace}
238 \def\ETB{{\asciifamily\char"17}\xspace}
239 \def\CAN{{\asciifamily\char"18}\xspace}
240 \def\EM{{\asciifamily\char"19}\xspace}
241 \def\SUB{{\asciifamily\char"1A}\xspace}
242 \def\ESC{{\asciifamily\char"1B}\xspace}
243 \def\FS{{\asciifamily\char"1C}\xspace}
244 \def\GS{{\asciifamily\char"1D}\xspace}
245 \def\RS{{\asciifamily\char"1E}\xspace}
246 \def\US{{\asciifamily\char"1F}\xspace}
247 \def\DEL{{\asciifamily\char'177}\xspace}
248 \def\NBSP{{\asciifamily\char"A0}\xspace}
249 \def\asciihash{{\asciifamily\char`\#}\xspace}
250 \def\asciipercent{{\asciifamily\char`\%}\xspace}
251 \def\asciicircum{{\asciifamily\char`\^}\xspace}
252 \def\asciitilde{{\asciifamily\char`\~}\xspace}
253 \def\asciilbrace{{\asciifamily\char`\{}\xspace}
254 \def\asciidollar{{\asciifamily\char`\$}\xspace}
255 \def\asciiampersand{{\asciifamily\char`\&}\xspace}
256 \def\asciiunderscore{{\asciifamily\char`\_}\xspace}
257 \def\asciibackslash{{\asciifamily\char`\\}\xspace}
258 \def\asciirbrace{{\asciifamily\char`\}}\xspace}
259 \def\asciispace{{\asciifamily\char"20}\xspace}
260 % \end{macrocode}
261 % The following three commands provide access to glyphs that were not included in the
262 % original font.
263 % \begin{macrocode}
264 \def\asciiquotedbl{{\asciifamily\char"22}\xspace}
265 \def\asciiquotegrave{{\asciifamily\char"60}\xspace}
266 \def\asciiquoteacute{{\asciifamily\char"27}\xspace}
267 % \end{macrocode}
268 % In the original \textsf{ascii} package the |\splivert| command was supposed to provide
269 % access to the \splitvert character. However, it actually provided access to the
270 % \asciivert character. To remedy this drawback, we introduced the correct glyph in
271 % the new font and provided a new command to access this glyph. Needless to say, the
272 % old command is now an alias to the new command.
273 % \begin{macrocode}
274 \def\isosplitvert{{\asciifamily\char"A6}\xspace}
275 \def\asciivert{{\asciifamily\char"7C}\xspace}
276 \let\splitvert\isosplitvert
277 %</ascii>
278 % \end{macrocode}
279 %
280 % \Finale