Debian Codegraph @

texmf-dist/doc/latex/dialogl/fontmenu.tex

raw
1 % Copyright 1994 Michael John Downes
2 % Copyright 2013 TeX Users Group
3 % This file is part of the dialogl package, released under the LPPL;
4 % see dialogl.ins for details.
5
6 \def\ComputerModern{\gdef\fontbase{Times}\gobble}
7 \def\Garamond{\gdef\fontbase{Computer Modern}\gobble}
8 \def\Helvetica{\gdef\fontbase{Garamond}\gobble}
9 \def\Malibu{\gdef\fontbase{Helvetica}\gobble}
10 \def\Times{\gdef\fontbase{Malibu}\gobble}
11
12 \def\gobble#1\endgobble{}
13
14 % Make sure we have a reasonable \newlinechar
15 \newlinechar=`\^^J \catcode\newlinechar=12
16
17 \begingroup
18 \catcode`\<=1 \catcode`\ =2\relax
19 \gdef\menustart{\errmessage<%
20 ....................................... }%
21 \endlinechar\newlinechar\catcode`\ =12\relax
22 \gdef\menutext{
23 .......................................
24 .......................................
25
26 Select the font base you wish to use:
27
28 [1] Computer Modern [4] Malibu
29 [2] Garamond [5] Times
30 [3] Helvetica
31
32 (Default: Times)}%
33 \endgroup% percent here to avoid extra \newlinechar
34
35 \begingroup
36 \immediate\write16{\menutext}
37 % If the user accidentally types 33 instead of 3 they will get past
38 % all the legitimate menu choices. So to keep that from causing
39 % trouble, we throw in a bunch of ~ characters below to perform
40 % error recovery. The standard maximum number of tokens that TeX
41 % will delete at one time is 99.
42 \catcode`\~=\active % just to make sure
43 \def~{\newlinechar`\^^J% restore normal value
44 \message{%
45 Whoops! Well, you got Times as your font base, I think}%
46 \gobble}
47 % Minimize unwanted error context (note: setting
48 % this to -1 doesn't suppress any more information)
49 \errorcontextlines 0
50 \newlinechar=`\! % to hide the automatic ! from \errmessage
51 \gdef\fontbase{Times}
52 % Inside the next group we make the space character
53 % active so that we can use it to call \menustart,
54 % and then we use \expandafter so that the first
55 % space on the next line gets that catcode before
56 % the \endgroup makes it revert to normal. All this
57 % so that the user does not see `\menustart' on
58 % screen, only a space.
59 \begingroup
60 \catcode`\ =\active\let =\menustart\expandafter\endgroup%
61 % Enter a number (1...5) and press Return TWICE
62 \ComputerModern% Press Return to continue
63 \Garamond% Press Return to continue
64 \Helvetica% Press Return to continue
65 \Malibu% Press Return to continue
66 \Times% Press Return to continue
67 \gobble%
68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
69 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
70 \endgobble\endgroup%
71 \show\fontbase
72 \end