summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/lh/testkern.tex
blob: f14dd58337c92bf1d8e3e7800166480be233bf5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
%
% testkern.tex
%
%% Cyrillic font container with T2 encoding beta-support
%
% This file is future part of lxfonts package
% Version 3.5 // Patchlevel=0
% (c) O.Lapko
%
% This package is freeware product under conditions similar to
% those of D. E. Knuth specified for the Computer Modern family of fonts.
% In particular, only the authors are entitled to modify this file
% (and all this package as well) and to save it under the same name.
%
% Content:
%
% TeX file with macros for testing kerns between letters in fonts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcount\chu \newcount\chl \newcount\chtemp
\newcount \hours \newcount \minutes

\let\xpar=\par

\def\LHpair#1 #2.{\noindent\chu=#1%
{\loop \chl=\chu
{\loop \char\chu\char\chl\char\chu{}\char\chl{}\char\chu\
\advance\chl by 1 \let\chtemp\chl#2\xpar\noindent}%
\global\advance\chu by 1 \let\chtemp\chu#2\xpar}}

\def\LHcross#1 #2 #3.{\noindent\chu=#1\chl=#2%
\def\H{\discretionary{\char\chu}{\char\chu}{\char\chu}}%
{\char\chu\loop\char\chl\H%
\advance\chl by 1 \let\chtemp\chl#3\xpar}}

\def\LHdot#1 #2.{\noindent\chu=#1%
{\loop \char\chu.\ \char\chu.\ %
\advance\chl by 1 \let\chtemp\chl#2\xpar}}

\def\LHuplow#1 #2; #3 #4.{\noindent\chu=#1%
{\loop \chl=#3%
{\loop \char\chu\char\chl\char\chl\ \char\chu{}\char\chl{}\char\chl\
\advance\chl by 1 \let\chtemp\chl#4\xpar\noindent}%
\global\advance\chu by 1 \let\chtemp\chu#2\xpar}}

\def\LHblks #1#2#3{\par\baselineskip=2.65ex\lineskip2pt
{\noindent
\chu=#1\loop
\centerline{\quad\llap{\rm\number\chu $:\,$}%
\chl=#1\loop  \setbox0\hbox{\char\chu}%
\rlap{\lower\dp0\hbox{\vrule\vbox{\hrule\box0\hrule}\vrule}}\hskip1.25em%
\global\advance\chu by 1 \advance\chl by 1 \ifnum\chl<#3 \repeat \hfill}
\ifnum\chu<#2 \repeat}}

\def\LHblk{\LHblks{0}{256}{16}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%T2
\def\Ttwo{%
\LHpair      128 \ifnum\chtemp=157\chtemp=192 \ifnum\chtemp<224\repeat.
\eject
\LHpair      160 \ifnum\chtemp=189\chtemp=224 \ifnum\chtemp<256\repeat.
\eject
\LHcross 205 128 \ifnum\chtemp=157\chtemp=192 \ifnum\chtemp<224\repeat.
\LHcross 237 160 \ifnum\chtemp=189\chtemp=224 \ifnum\chtemp<256\repeat.
\LHdot       128 \ifnum\chtemp=157\chtemp=192 \ifnum\chtemp<224\repeat.
\LHdot       160 \ifnum\chtemp=189\chtemp=224 \ifnum\chtemp<256\repeat.
\eject
\LHuplow     128 \ifnum\chtemp=157\chtemp=192 \ifnum\chtemp<224\repeat; 160 \loTtwo.
}

%ALT
\def\ALT{%
\LHpair      128 %
    \ifnum\chtemp=160\chtemp=242\fi %
    \ifnum\chtemp=243\chtemp=244\fi %
    \ifnum\chtemp=245\chtemp=246\fi %
    \ifnum\chtemp=247\chtemp=248\fi %
    \ifnum\chtemp=249\chtemp=250\fi %
    \ifnum\chtemp<251\repeat.
\eject
\LHpair      160 %
    \ifnum\chtemp=176\chtemp=224\fi %
    \ifnum\chtemp=240\chtemp=241\fi %
    \ifnum\chtemp=242\chtemp=243\fi %
    \ifnum\chtemp=244\chtemp=245\fi %
    \ifnum\chtemp=246\chtemp=247\fi %
    \ifnum\chtemp=248\chtemp=249\fi %
    \ifnum\chtemp=250\chtemp=251\fi %
    \ifnum\chtemp<252\repeat.
\eject
\LHcross 205 128 %
    \ifnum\chtemp=160\chtemp=242\fi %
    \ifnum\chtemp=243\chtemp=244\fi %
    \ifnum\chtemp=245\chtemp=246\fi %
    \ifnum\chtemp=247\chtemp=248\fi %
    \ifnum\chtemp=249\chtemp=250\fi %
    \ifnum\chtemp<251\repeat.
\LHcross 237 160 %
    \ifnum\chtemp=176\chtemp=224\fi %
    \ifnum\chtemp=240\chtemp=241\fi %
    \ifnum\chtemp=242\chtemp=243\fi %
    \ifnum\chtemp=244\chtemp=245\fi %
    \ifnum\chtemp=246\chtemp=247\fi %
    \ifnum\chtemp=248\chtemp=249\fi %
    \ifnum\chtemp=250\chtemp=251\fi %
    \ifnum\chtemp<252\repeat.
\LHdot       128 %
    \ifnum\chtemp=160\chtemp=242\fi %
    \ifnum\chtemp=243\chtemp=244\fi %
    \ifnum\chtemp=245\chtemp=246\fi %
    \ifnum\chtemp=247\chtemp=248\fi %
    \ifnum\chtemp=249\chtemp=250\fi %
    \ifnum\chtemp<251\repeat.
\LHdot       160 %
    \ifnum\chtemp=176\chtemp=224\fi %
    \ifnum\chtemp=240\chtemp=241\fi %
    \ifnum\chtemp=242\chtemp=243\fi %
    \ifnum\chtemp=244\chtemp=245\fi %
    \ifnum\chtemp=246\chtemp=247\fi %
    \ifnum\chtemp=248\chtemp=249\fi %
    \ifnum\chtemp=250\chtemp=251\fi %
    \ifnum\chtemp<252\repeat.
\eject
\LHuplow     128 %
    \ifnum\chtemp=160\chtemp=242\fi %
    \ifnum\chtemp=243\chtemp=244\fi %
    \ifnum\chtemp=245\chtemp=246\fi %
    \ifnum\chtemp=247\chtemp=248\fi %
    \ifnum\chtemp=249\chtemp=250\fi %
    \ifnum\chtemp<251\repeat;
             160 %
    \ifnum\chtemp=176\chtemp=224\fi %
    \ifnum\chtemp=240\chtemp=241\fi %
    \ifnum\chtemp=242\chtemp=243\fi %
    \ifnum\chtemp=244\chtemp=245\fi %
    \ifnum\chtemp=246\chtemp=247\fi %
    \ifnum\chtemp=248\chtemp=249\fi %
    \ifnum\chtemp=250\chtemp=251\fi %
    \ifnum\chtemp<252\repeat.
}
\newlinechar=`@
{\chardef\other=12
\catcode`\|=0 \catcode`\\=\other
|gdef|kernhelp{|message{@%
=====================================================================@%
YOU MAY USE THESE COMMANDS AFTER SELECTING TEST FONT:@@%
\kernhelp - this help;@%
\help - main testfo(nt)x.tex's help;@%
\init - set font name to be tested;@@%
\ALT - kerning test in LCY encoding (lh* fonts);@%
\Ttwo - kerning test in T2/X2 encoding (rx/l(a/b/c)* fonts);@@%
\LHblk - test for char boxes and char placement inside framed boxes;@%
\LHblks{<num1>}{<num2>}{<num3>} - "low level" macro for previous one;@%
where:@
 <num1> - number of first code number (e.g. 0 in \LHblk);@
 <num2> - number of last code number+1 (e.g. 256 in \LHblk);@
 <num3> - number of characters per line (e.g. 16 in \LHblk)@%
=====================================================================@%
}}}

\kernhelp\par
\input testfox