Debian Codegraph @

texmf-dist/doc/fonts/boisik/example/testfont.tex

raw
1 % A testbed for font evaluation (see The METAFONTbook, Appendix H)
2 % -- modified for Boisik
3
4 \tracinglostchars=0
5 \tolerance=1000
6 \raggedbottom
7 \nopagenumbers
8 \parindent=0pt
9 \newlinechar=`@
10 \hyphenpenalty=200
11 \doublehyphendemerits=30000
12 \hyphenation{prom-i-nent}
13 \vsize 26.5cm
14 \newcount\m \newcount\n \newcount\p \newdimen\dim
15 \chardef\other=12
16
17 \def\today{\ifcase\month\or
18 January\or February\or March\or April\or May\or June\or
19 July\or August\or September\or October\or November\or December\fi
20 \space\number\day, \number\year}
21 \def\hours{\n=\time \divide\n 60
22 \m=-\n \multiply\m 60 \advance\m \time
23 \twodigits\n\twodigits\m}
24 \def\twodigits#1{\ifnum #1<10 0\fi \number#1}
25
26 \def\init{\message{@Name of the font to test = }
27 \read-1 to\fontname \startfont
28 \message{Now type a test command (\string\help\space for help):}}
29 \def\startfont{\font\testfont=\fontname \spaceskip=0pt
30 \leftline{\sevenrm Test of \fontname\unskip}
31 \medskip
32 \testfont \setbaselineskip
33 \ifdim\fontdimen6\testfont<10pt \rightskip=0pt plus 20pt
34 \else\rightskip=0pt plus 2em \fi
35 \spaceskip=\fontdimen2\testfont % space between words (\raggedright)
36 \xspaceskip=\fontdimen2\testfont \advance\xspaceskip by\fontdimen7\testfont}
37
38 {\catcode`\|=0 \catcode`\\=\other
39 |gdef|help{|message{%
40 \init switches to another font;@%
41 \end or \bye finishes the run;@%
42 \table prints the font layout in tabular format;@%
43 \text prints a sample text, assuming TeX text font conventions;@%
44 \sample combines \table and \text;@%
45 \mixture mixes a background character with a series of others;@%
46 \alternation interleaves a background character with a series;@%
47 \alphabet prints all lowercase letters within a given background;@%
48 \ALPHABET prints all uppercase letters within a given background;@%
49 \series prints a series of letters within a given background;@%
50 \lowers prints a comprehensive test of lowercase;@%
51 \uppers prints a comprehensive test of uppercase;@%
52 \digits prints a comprehensive test of numerals;@%
53 \math prints a comprehensive test of TeX math italic;@%
54 \names prints a text that mixes upper and lower case;@%
55 \punct prints a punctuation test;@%
56 \bigtest combines many of the above routines;@%
57 \help repeats this message;@%
58 and you can use ordinary TeX commands (e.g., to \input a file).}}}
59
60 \def\setbaselineskip{\setbox0=\hbox{\n=0
61 \loop\char\n \ifnum \n<255 \advance\n 1 \repeat}
62 \baselineskip=6pt \advance\baselineskip\ht0 \advance\baselineskip\dp0 }
63
64 \def\setchar#1{{\escapechar-1\message{\string#1 character = }%
65 \def\do##1{\catcode`##1=\other}\dospecials
66 \read-1 to\next
67 \expandafter\finsetchar\next\next#1}}
68 \def\finsetchar#1#2\next#3{\global\chardef#3=`#1
69 \ifnum #3=`\# \global\chardef#3=#2 \fi}
70 \def\promptthree{\setchar\background
71 \setchar\starting \setchar\ending}
72
73 \def\mixture{\promptthree \domix\mixpattern}
74 \def\alternation{\promptthree \domix\altpattern}
75 \def\mixpattern{\0\1\0\0\1\1\0\0\0\1\1\1\0\1}
76 \def\altpattern{\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0\1\0}
77 \def\domix#1{\par\chardef\0=\background \n=\starting
78 \loop \chardef\1=\n %
79 %moje zmena
80 \setbox0=\hbox{\1}\def\delej{#1\endgraf}\ifdim\wd0=0pt \ifdim\ht0=0pt \ifdim\dp0=0pt \let\delej\relax \fi \fi \fi
81 \delej\ifnum \n<\ending \advance\n 1 \repeat \ifnum\n=90\0'\endgraf\fi}
82
83 \def\!{\discretionary{\background}{\background}{\background}}
84 \def\series{\promptthree \!\doseries\starting\ending\par}
85 \def\doseries#1#2{\n=#1\loop\char\n\!\ifnum\n<#2\advance\n 1 \repeat}
86 \def\complower{\!\doseries{`a}{`z}\doseries{'31}{'34}\par}
87 \def\compupper{\!\doseries{`A}{`Z}\doseries{'35}{'37}\par}
88 \def\compdigs{\!\doseries{`0}{`9}\par}
89 \def\alphabet{\setchar\background\complower}
90 \def\ALPHABET{\setchar\background\compupper}
91
92 \def\lowers{\docomprehensive\complower{`a}{`z}{'31}{'34}}
93 \def\uppers{\docomprehensive\compupper{`A}{`Z}{'35}{'37}}
94 \def\digits{\docomprehensive\compdigs{`0}{`4}{`5}{`9}}
95 \def\docomprehensive#1#2#3#4#5{\par\chardef\background=#2
96 \loop{#1} \ifnum\background<#3\m=\background\advance\m 1
97 \chardef\background=\m \repeat \chardef\background=#4
98 \loop{#1} \ifnum\background<#5\m=\background\advance\m 1
99 \chardef\background=\m \repeat}
100
101 \def\names{ {\AA}ngel\aa\ Beatrice Claire
102 Diana \'Erica Fran\c{c}oise Ginette H\'el\`ene Iris
103 Jackie K\=aren {\L}au\.ra Mar{\'\i}a N\H{a}ta{\l}{\u\i}e {\O}ctave
104 Pauline Qu\^eneau Roxanne Sabine T\~a{\'\j}a Ur\v{s}ula
105 Vivian Wendy Xanthippe Yv{\o}nne Z\"azilie\par}
106 \def\punct{\par\dopunct{min}\dopunct{pig}\dopunct{hid}
107 \dopunct{HIE}\dopunct{TIP}\dopunct{fluff}
108 \$1,234.56 + 7/8 = 9\% @ \#0\par}
109 \def\dopunct#1{#1,\ #1:\ #1;\ `#1'\ ?`#1?\ !`#1!\ (#1)\ [#1]\ #1*\ #1.\par}
110
111 \def\bigtest{\sample
112 hamburgefonstiv HAMBURGEFONSTIV\par
113 \names \punct \lowers \uppers \digits}
114
115 \def\math{\textfont1=\testfont \skewchar\testfont=\skewtrial
116 \mathchardef\Gamma="100 \mathchardef\Delta="101
117 \mathchardef\Theta="102 \mathchardef\Lambda="103 \mathchardef\Xi="104
118 \mathchardef\Pi="105 \mathchardef\Sigma="106 \mathchardef\Upsilon="107
119 \mathchardef\Phi="108 \mathchardef\Psi="109 \mathchardef\Omega="10A
120 \def\ii{i} \def\jj{j}
121 \def\\##1{|##1|+}\mathtrial
122 \def\\##1{##1_2+}\mathtrial
123 \def\\##1{##1^2+}\mathtrial
124 \def\\##1{##1/2+}\mathtrial
125 \def\\##1{2/##1+}\mathtrial
126 \def\\##1{##1,{}+}\mathtrial
127 \def\\##1{d##1+}\mathtrial
128 \let\ii=\imath \let\jj=\jmath \def\\##1{\hat##1+}\mathtrial}
129 \newcount\skewtrial \skewtrial='177
130 \def\mathtrial{$\\A \\B \\C \\D \\E \\F \\G \\H \\I \\J \\K \\L \\M \\N \\O
131 \\P \\Q \\R \\S \\T \\U \\V \\W \\X \\Y \\Z \\a \\b \\c \\d \\e \\f \\g
132 \\h \\\ii \\\jj \\k \\l \\m \\n \\o \\p \\q \\r \\s \\t \\u \\v \\w \\x \\y
133 \\z \\\alpha \\\beta \\\gamma \\\delta \\\epsilon \\\zeta \\\eta \\\theta
134 \\\iota \\\kappa \\\lambda \\\mu \\\nu \\\xi \\\pi \\\rho \\\sigma \\\tau
135 \\\upsilon \\\phi \\\chi \\\psi \\\omega \\\vartheta \\\varpi \\\varphi
136 \\\Gamma \\\Delta \\\Theta \\\Lambda \\\Xi \\\Pi \\\Sigma \\\Upsilon
137 \\\Phi \\\Psi \\\Omega \\\partial \\\ell \\\wp$\par}
138 \def\mathsy{\begingroup\skewtrial='060 % for math symbol font tests
139 \def\mathtrial{$\\A \\B \\C \\D \\E \\F \\G \\H \\I \\J \\K \\L
140 \\M \\N \\O \\P \\Q \\R \\S \\T \\U \\V \\W \\X \\Y \\Z$\par}
141 \math\endgroup}
142
143 \def\oct#1{\hbox{\rm\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
144 \def\hex#1{\hbox{\rm\H{}\tt#1}} % hexadecimal constant
145 \def\setdigs#1"#2{\gdef\h{#2}% \h=hex prefix; \0\1=corresponding octal
146 \m=\n \divide\m by 64 \xdef\0{\the\m}%
147 \multiply\m by-64 \advance\m by\n \divide\m by 8 \xdef\1{\the\m}}
148 \def\testrow{\setbox0=\hbox{\penalty 1\def\\{\char"\h}%
149 \\0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\A\\B\\C\\D\\E\\F%
150 \global\p=\lastpenalty}} % \p=1 if none of the characters exist
151 \def\oddline{\cr
152 \noalign{\nointerlineskip}
153 \multispan{19}\hrulefill&
154 \setbox0=\hbox{\lower 2.3pt\hbox{\hex{\h x}}}\smash{\box0}\cr
155 \noalign{\nointerlineskip}}
156 \newif\ifskipping
157 \def\evenline{\loop\skippingfalse
158 \ifnum\n<256 \m=\n \divide\m 16 \chardef\next=\m
159 \expandafter\setdigs\meaning\next \testrow
160 \ifnum\p=1 \skippingtrue \fi\fi
161 \ifskipping \global\advance\n 16 \repeat
162 \ifnum\n=256 \let\next=\endchart\else\let\next=\morechart\fi
163 \next}
164 \def\morechart{\cr\noalign{\hrule\penalty5000}
165 \chartline \oddline \m=\1 \advance\m 1 \xdef\1{\the\m}
166 \chartline \evenline}
167 \def\chartline{&\oct{\0\1x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&}
168 \def\chartstrut{\lower4.5pt\vbox to14pt{}}
169 \def\table{$$\global\n=0
170 \halign to.8\hsize\bgroup
171 \chartstrut##\tabskip0pt plus10pt&
172 &\hfil##\hfil&\vrule##\cr
173 \lower6.5pt\null
174 &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline}
175 \def\endchart{\cr\noalign{\hrule}
176 \raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B&
177 &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$\par}
178 \def\:{\setbox0=\hbox{\noboundary\char\n\noboundary}%
179 \ifdim\ht0>7.5pt\reposition
180 \else\ifdim\dp0>2.5pt\reposition\fi\fi
181 \box0\global\advance\n 1 }
182 \def\reposition{\setbox0=\vbox{\kern2pt\box0}\dim=\dp0
183 \advance\dim 2pt \dp0=\dim}
184 \def\centerlargechars{
185 \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}}
186
187 \def\text{{\advance\baselineskip-4pt
188 On November 14, 1885, Senator \& Mrs.~Leland Stanford called
189 together at their San Francisco mansion the 24~prominent men who had
190 been chosen as the first trustees of The Leland Stanford Junior University.
191 They handed to the board the Founding Grant of the University, which they
192 had executed three days before. This document---with various amendments,
193 legislative acts, and court decrees---remains as the University's charter.
194 In bold, sweeping language it stipulates that the objectives of the University
195 are ``to qualify students for personal success and direct usefulness in life;
196 and to promote the publick welfare by exercising an influence in behalf of
197 humanity and civilization, teaching the blessings of liberty regulated by
198 law, and inculcating love and reverence for the great principles of
199 government as derived from the inalienable rights of man to life, liberty,
200 and the pursuit of happiness.'' \moretext
201 (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)\par}}
202 \def\moretext{?`But aren't Kafka's Schlo{\ss} and {\AE}sop's {\OE}uvres
203 often na{\"\i}ve vis-\`a-vis the d{\ae}monic ph{\oe}nix's official r\^ole
204 in fluffy souffl\'es? }
205 \def\omitaccents{\let\moretext=\relax}
206
207 \def\sample{\table\text}
208
209 %\ifx\noinit!\else\init\fi
210 \def\bskfont#1{\def\fontname{#1}\startfont\table}
211 \def\ep{\vfill\eject}
212 \bskfont{bskr10}\ep
213 \bskfont{bski10}\ep
214 \bskfont{bskiu10}\ep
215 \bskfont{bskrw10}\ep
216 \bskfont{bskr10-T1}\ep
217 \bskfont{bskr10-TS1}\ep
218 \bskfont{bsksc10}\ep
219 \bskfont{bskmi10}\ep
220 \bskfont{bsksy10}\ep
221 \bskfont{bskms10}\ep
222 \bskfont{bskex10}\ep
223 \bskfont{bskma10}
224 \bskfont{bskhc10}
225 \end