%% This file is part of the GRKFINST project version 0.3.2
%% -------------------------------------------------------
%% 
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%% The file was initially based on the fnstcorr.tex file from the cyrfinst
%% package by Vladimir Volovich, but later was modified to take advantage
%% of the \aliased command, introduced in fontinst 1.915. I also have
%% replaced all LaTeX macros with equivalent fontinst constructions,
%% so that fontinst job files, which load this file, can be processed
%% with plain TeX or plain Omega.
%%
%% Copyright (C) 2002--2005 by Alexej Kryukov
%% Please report errors to: A.M. Kryukov <basileia@yandex.ru>

\needsfontinstversion{1.926}
\fontinstcc

\let\charnameprefix\empty
\def\charnamealias#1{
   \if_undefined{GN@\charnameprefix#1}\then
      \if_undefined{GN@#1}\then
          #1
       \else
          \csname GN@#1\endcsname
       \fi% was just {#1}
   \else
      \csname GN@\charnameprefix#1\endcsname
   \fi
}
\def\init_cc#1{%
   \out_line{\string\setglyph{\charnamealias{#1}}}
   \edef\char_name{\charnamealias{#1}}
}
\list_def{N}(#1){\edef\char_name{\charnamealias{#1}}}
\afm_def{KP}(#1~#2~#3~#4){
   \if\first_char#1=.\else
   \if\first_char#2=.\else
      \afm_length\a_count{#3}
      \ifnum \a_count>\minimum_kern
         \out_line{\string\setkern{\charnamealias{#1}}{\charnamealias{#2}}{\the\a_count}}
      \else\ifnum \a_count<-\minimum_kern
         \out_line{\string\setkern{\charnamealias{#1}}{\charnamealias{#2}}{\the\a_count}}
      \fi\fi
   \fi\fi
}
\afm_let{KPX}{KP}

\def\galias#1#2{
  \def\temp@a{#1}%
  \foreach(temp@b){#2}
     \expandafter\let\csname GN@\str{temp@b}\endcsname\temp@a
  \endfor(temp@b)
}
\def\aliasfonts#1#2#3{%
  \def\charnameprefix{#1}%
  \foreach(temp@font){#3}
     \afmtomtx{#2\str{temp@font}}{#2\str{temp@font}}
     \mtxtopl{#2\str{temp@font}}{#2\str{temp@font}}
  \endfor(temp@font)
  \let\charnameprefix\empty
}

\normalcc

\endinput
