%
% 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
