Debian Codegraph @

texk/web2c/tests/mltextst.tex

raw
1 % This is MLTEXTST.TEX (Version 1.2) in text format, as of Dec 07, 1995.
2 % Test file to check MLTeX implementations.
3 %
4 % Copyright (C) 1995 by B.Raichle; all rights are reserved.
5 %
6 % Usage:
7 %
8 % Run iniTeX on this file. Do not try to use plain-TeX or LaTeX.
9 % Needs the font metric files: cmr10.tfm, cmti10.tfm
10 %
11 %
12 % Changes:
13 %
14 % 95/12/05 v1.0
15 % - initial version
16 % 95/12/06 v1.1
17 % - don't show tracing output
18 % - \nonstopmode and additional test for bug 2.
19 % 95/12/07 v1.2
20 % - added MLTeX version numbers (and release dates)
21 % - added test for MLTeX version 2.2
22 %
23 %
24 % History of MLTeX for TeX 3.x:
25 %
26 % 90/04/02 Version ?? (for TeX 3.0)
27 % \charsublist, \charsublistmax
28 % ??/??/?? Version 1.0
29 % 92/02/03 Version 2 (for TeX 3.1--3.141)
30 % |effective_char| uses explicit font information
31 % 93/10/29 Version 2.01
32 % fix \*leaders problem
33 % 95/12/06 Version 2.2 (for TeX 3.14159)
34 % fix font loading bug
35 % fix invalid |font_info| access
36 % in work Version 3.0
37 % complete re-implementation
38 %
39 %
40 \catcode`\{=1 \catcode`\}=2 \catcode`\#=6
41 %
42 \immediate\write16{}
43 \immediate\write16{Test for bugs in MLTeX (1995/12/07 v1.2 [br])}
44 \immediate\write16{}
45 %
46 % check for plain-TeX:
47 % we have to ensure that _no_ fonts are preloaded
48 \expandafter\ifx\csname active\endcsname\relax \else
49 \message{Please (Ini)TeX this file, no plain-TeX, no LaTeX!}
50 \expandafter\endinput\expandafter\end\fi
51 % check for MLTeX
52 \expandafter\ifx\csname charsubdef\endcsname\relax
53 \message{This test file can only be used with MLTeX!}
54 \expandafter\endinput\fi
55 %
56 \nonstopmode
57 %%%\tracingonline=1 \tracingoutput=1 \showboxbreadth=255
58 %%%\tracinglostchars=100 \tracingcharsubdef=1
59 \hsize=5in
60 %
61 %
62 % 1. Check for bug accessing the wrong character metrics:
63 % (in versions before Feb 1992)
64 %
65 \font\tenrm=cmr10\relax
66 %
67 % The group is only necessary, if you want to use this
68 % test in your own macros. \charsubdefmax is saved
69 % explicitly for very old versions of MLTeX which have
70 % an additional bug when assigning this special integer.
71 \begingroup
72 \count255=\charsubdefmax
73 \charsubdefmax=256 % enable all substitutions
74 % very old versions of MLTeX will
75 \charsubdef`\i=1 `\M % substitute "i" by "M"
76 \setbox0=\hbox{\tenrm i}% <-- here
77 \dimen0=\wd0 % get width of box (either "i" or "M")
78 % get width of "i"
79 \charsubdefmax=-1 % disable all substitutions
80 \setbox0=\hbox{\tenrm i}%
81 \dimen2=\wd0 % get width of box
82 % restore former value of \charsubdefmax
83 \charsubdefmax=\count255
84 \expandafter\endgroup
85 \ifdim\dimen0=\dimen2\relax
86 \immediate\write16{..... Ok, this is a newer MLTeX version (>= 2.0).}
87 \immediate\write16{}
88 \else
89 \immediate\write16{%
90 ..... This is a very old version of MLTeX < 2.0 (released before Feb. 1992)}
91 \immediate\write16{%
92 ..... immediately update to the newest MLTeX version!}
93 \immediate\write16{}
94 \expandafter\endinput\expandafter\end
95 \fi
96 %
97 %
98 % 2. Check for font loading bug:
99 % (in versions before Dec 1995)
100 %
101 % - Define a \charsubdef of an existing character with
102 % a non-existing base character
103 %
104 \charsubdef `A=`a 128
105 %%%\message{now: \string\charsubdefmax=\number\charsubdefmax}
106 %
107 % - now load font (do not preload this font!!!!!!)
108 %
109 \immediate\write16{}
110 \immediate\write16{..... If there will be an error "Bad metric (TFM) file",}
111 \immediate\write16{..... please update to the newest MLTeX version!}
112 \immediate\write16{}
113 \font\test=cmti10\relax
114 \begingroup
115 \setbox0=\hbox{\test A}
116 \expandafter\endgroup
117 \ifdim\wd0>0pt\relax \else
118 \immediate\write16{}
119 \immediate\write16{%
120 ..... This seems to be MLTeX version 2.0 or 2.01 (released before Dec. 1995)}
121 \immediate\write16{%
122 ..... this version has bugs,}
123 \immediate\write16{%
124 ..... please update to the newest MLTeX version!}
125 \immediate\write16{}
126 \expandafter\endinput\expandafter\end
127 \fi
128 \immediate\write16{..... Good, no "Bad metric (TFM) file" bug,}
129 \immediate\write16{..... seems to be the a MLTeX version > 2.01.}
130 %
131 %
132 % 3. Check for invalid |font_info| access:
133 %
134 \immediate\write16{}
135 \font\tenrm=cmr10\relax
136 %
137 \setbox0=\hbox{\tenrm \char`a}\dimen1=\wd0
138 \setbox0=\hbox{\tenrm \char`M}\dimen3=\wd0
139 \setbox0=\hbox{\tenrm \char0}\dimen5=\wd0
140 %
141 \charsubdef 128=`a `a
142 \setbox0=\hbox{\tenrm \char128}
143 \dimen0=\wd0 % get width of `a
144 %
145 % Now the \charsubdef is changed using
146 % an existing base character:
147 \charsubdef 128=`a `M
148 \setbox0=\hbox{\unhbox0}
149 \dimen2=\wd0 % get width of `a or `M
150 %
151 % And then we remove it. MLTeX will try to access the 128th
152 % entry in the |char_base| array, which is the first entry in
153 % the width index array.
154 % For MLTeX 2.2 this was "fixed", now it will report a warning
155 % "Missing char... no substitution for ..." and MLTeX will use
156 % the first character of the font.
157 \charsubdefmax=-1
158 \setbox0=\hbox{\unhbox0}%
159 \dimen4=\wd0
160 %
161 %%%\message{\the\dimen0-\the\dimen1-\the\dimen2-\the\dimen3-%
162 %%% \the\dimen4-\the\dimen5-}
163 %
164 \def\x#1\fi\fi{\fi\fi#1}
165 \ifdim\dimen0=\dimen2\relax \ifdim\dimen0=\dimen4\relax
166 \immediate\write16{}
167 \immediate\write16{%
168 ...... Seems to be MLTeX version 3.x (unreleased),}
169 \immediate\write16{%
170 ...... from whom did you get this version? :-)}
171 \immediate\write16{}
172 \immediate\write16{%
173 Congratulations, you have the best MLTeX version!}
174 \immediate\write16{}
175 \x{\endinput\csname end\endcsname}%
176 \fi\fi
177 %
178 \def\x#1\fi{\fi#1}
179 \ifdim\dimen4=\dimen5\relax \else
180 \immediate\write16{}
181 \immediate\write16{%
182 ..... Seems to be MLTeX version 2.0 or 2.01 (released before Dec. 1995)}
183 \immediate\write16{%
184 ..... this version has bugs,}
185 \immediate\write16{%
186 ..... please update to the newest MLTeX version!}
187 \immediate\write16{}
188 \expandafter\endinput\expandafter\end
189 \fi
190 %
191 \immediate\write16{}
192 \immediate\write16{%
193 ...... Seems to be MLTeX version 2.2 (released Dec. 1995).}
194 \immediate\write16{}
195 \immediate\write16{%
196 Congratulations, you have a MLTeX version with all known bugs fixed.}
197 \immediate\write16{}
198 \end
199 %
200 %%% END OF FILE %%%