%%
%% This is file `mlltxchg.def'.
%% Copyright (C) 1996,1997,1998,1999 Bernd Raichle.
%%
%% -----------------------------------------------------------------
%% IMPORTANT NOTICE:
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% -----------------------------------------------------------------
%%
%% CHANGES:
%% 1997/09/03 0.1a
%%    Changes for LaTeX Kernel <1997/06/01>.
%% 1998/10/21 0.1b
%%    Checked changes for LaTeX Kernel <1998/06/01>.
%% 1998/11/17 0.9a
%%    Final release changes:
%%    Renamed file from ``mlltxchg.def'' to ``mlltxchg.def''.
%%    Added \Fd@<alias> to map from an alias to the original
%%    font encoding (needed for \mlfontencoding).
%% 1998/12/21 0.9b
%%    Removed warning \message; added \GenericInfo that some
%%    NFSS kernel macros has to be changed. 
%% 1999/03/08 0.9c
%%    Changed licensing conditions to LPPL.
%%
%% ------------------------------------------------------------
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01] % Need mono-case file names!

\ProvidesFile{mlltxchg.def}%
    [1999/03/08 v0.9c %
     MLTeX/LaTeX changes of LaTeX Kernel (NFSS) (br)]
\GenericInfo{(mlltxchg)}%
   {MLTeX Support Info: Have to change NFSS kernel macros}

%% Provide the new NFSS declaration
%%
%%  \DeclareFontDefinitionEncodingAlias
%%      {<alias-fontenc>}{<fontenc>}
%%
%% which declares that for the font encoding <alias-fontenc>
%% NFSS should access and use the fd files of <fontenc>.
%% This can only be done if the fonts in font encoding <fontenc>
%% are only subsets of the fonts in font encoding <alias-fontenc>.
%%
\newcommand{\DeclareFontDefinitionEncodingAlias}[2]{%
  \expandafter\ifx\csname T@#2\endcsname\relax
    \@font@warning{Font encoding #1 undefined %
                   (used for fd encoding alias)}%
  \else
    \expandafter\ifx\csname T@#1\endcsname\relax
    \else
      \@font@info{Redeclaring font def. encoding alias for #1}%
    \fi
    \expandafter\xdef\csname fD@#1\endcsname{#2}%
    \expandafter\xdef\csname Fd@#2\endcsname{#1}%
  \fi}
\@onlypreamble\DeclareFontDefinitionEncodingAlias


%% Load the .fd file of the FD Encoding Alias if it exists.
%%
%% From file: ``ltfssbas.dtx''
%%
%% .fd file has not to be loaded if
%%   - encoding+family was already loaded
%%   - an fd encoding alias was defined and
%%     the aliased encoding+family was already loaded
%%

%% Original definition from <1996/06/01>
%\def\try@load@fontshape{%
%   \expandafter
%   \ifx\csname \f@encoding+\f@family\endcsname\relax
%     \@font@info{Try loading font information for
%                   \f@encoding+\f@family}%
%    \global\expandafter\let
%       \csname\f@encoding+\f@family\endcsname\@empty
%     \makeatletter
%     \nfss@catcodes
%     \@input@{\f@encoding\f@family.fd}%
%   \fi
%}
%% Original definition from <1995/12/01>...<1998/06/01>
%\def\try@load@fontshape{%
%   \expandafter
%   \ifx\csname \f@encoding+\f@family\endcsname\relax
%     \@font@info{Try loading font information for
%                   \f@encoding+\f@family}%
%    \global\expandafter\let
%       \csname\f@encoding+\f@family\endcsname\@empty
% %   \makeatletter
%     \nfss@catcodes
%     \let\nfss@catcodes\relax
%     \edef\reserved@a{%
%       \lowercase{%
%         \noexpand\InputIfFileExists{\f@encoding\f@family.fd}}}%
%     \reserved@a\relax
%          {\@input@{\f@encoding\f@family.fd}}%
%   \fi}

\def\ml@try@load@fontshape#1{%
     \@font@info{Try loading font information for
                   \f@encoding+\f@family}%
    \global\expandafter\let
       \csname\f@encoding+\f@family\endcsname\@empty
%-br%% following line from <1995/12/01>...<1997/06/01>, needed?
%-br% \makeatletter                 
     \nfss@catcodes
     \let\nfss@catcodes\relax
     \edef\reserved@a{%
       \lowercase{%
         \noexpand\InputIfFileExists{#1\f@family.fd}}}%
     \reserved@a\relax
          {\@input@{#1\f@family.fd}}%
   }
\def\try@load@fontshape{%
   \expandafter
   \ifx\csname \f@encoding+\f@family\endcsname\relax
     \expandafter
     \ifx\csname fD@\f@encoding\endcsname\relax
       \ml@try@load@fontshape\f@encoding
     \else
       \expandafter
       \ifx\csname \csname fD@\f@encoding\endcsname+\f@family\endcsname\relax
         \expandafter\ml@try@load@fontshape\csname fD@\f@encoding\endcsname
       \fi
     \fi
   \fi}


%% Access the FD Encoding Alias as font encoding if it exists:
%%
%% From file: ``ltfssbas.dtx''
%%

%% Original definition from <1994/06/01>...<1998/06/01>
%\def\curr@fontshape{\f@encoding/\f@family/\f@series/\f@shape}

\def\curr@fontshape{%
  \expandafter\ifx\csname fD@\f@encoding\endcsname\relax
    \f@encoding
  \else
    \csname fD@\f@encoding\endcsname
  \fi /\f@family/\f@series/\f@shape}


%% When NFSS is checking defaults, use FD Encoding Alias it it exists:
%%
%% From file: ``ltfssdcl.dtx''
%%

%% Original definition from <1994/06/01>...<1998/06/01>
%\def\process@table{%
%    \def\cdp@elt##1##2##3##4{%
%        \@font@info{Checking defaults for
%                  ##1/##2/##3/##4}%
%        \expandafter
%        \ifx\csname##1/##2/##3/##4\endcsname\relax
%          \begingroup
%           \def\f@encoding{##1}\def\f@family{##2}%
%           \try@load@fontshape
%          \endgroup
%        \fi
%        \expandafter
%        \ifx\csname##1/##2/##3/##4\endcsname\relax
%             \@latex@error{This NFSS system isn't set up properly}%
%                       {For encoding scheme ##1 the defaults
%                        ##2/##3/##4 do not form a valid font shape}%
%        \else
%             \@font@info{... okay}%
%        \fi}%
%    \cdp@list
%    \begingroup
%       \escapechar\m@ne
%       \error@fontshape
%       \expandafter\ifx\csname \curr@fontshape\endcsname\relax
%          \begingroup
%            \try@load@fontshape
%           \endgroup
%       \fi
%       \expandafter\ifx\csname \curr@fontshape\endcsname\relax
%         \@latex@error{This NFSS system isn't set up properly}%
%            {The system maintainer forgot to specify a suitable
%             substitution
%             font shape using the \noexpand\DeclareErrorFont
%             command}%
%       \fi
%    \endgroup
%    \let\select@group\document@select@group
%    \fontencoding{\encodingdefault}%
%    \fontfamily{\familydefault}%
%    \fontseries{\seriesdefault}%
%    \fontshape{\shapedefault}%
% \everyjob{}%
%}

\def\process@table{%
    \def\cdp@elt##1##2##3##4{%
        \@font@info{Checking defaults for
                  ##1/##2/##3/##4}%
        \expandafter
        \ifx\csname##1/##2/##3/##4\endcsname\relax
          \begingroup
           \def\f@encoding{##1}\def\f@family{##2}%
           \try@load@fontshape
          \endgroup
        \fi
%br% new - begin (uses \ifnum 0<0[1]\relax ... trick!)
       \ifnum 0<0%
%br% new - end
        \expandafter
        \ifx\csname##1/##2/##3/##4\endcsname\relax
%br% new - begin
         \expandafter
         \ifx\csname fD@##1\endcsname\relax
           1%
         \else
           \expandafter
           \ifx\csname \csname fD@##1\endcsname
                       /##2/##3/##4\endcsname\relax
              1%
           \fi
         \fi
        \fi \relax
%br% new - end
            \@latex@error{This NFSS system isn't set up properly}%
                       {For encoding scheme ##1 the defaults
                        ##2/##3/##4 do not form a valid font shape}%
        \else
            \@font@info{... okay}%
        \fi}%
    \cdp@list
    \begingroup
       \escapechar\m@ne
       \error@fontshape
       \expandafter\ifx\csname \curr@fontshape\endcsname\relax
          \begingroup
            \try@load@fontshape
           \endgroup
       \fi
       \expandafter\ifx\csname \curr@fontshape\endcsname\relax
         \@latex@error{This NFSS system isn't set up properly}%
            {The system maintainer forgot to specify a suitable
             substitution
             font shape using the \noexpand\DeclareErrorFont
             command}%
       \fi
    \endgroup
    \let\select@group\document@select@group
    \fontencoding{\encodingdefault}%
    \fontfamily{\familydefault}%
    \fontseries{\seriesdefault}%
    \fontshape{\shapedefault}%
 \everyjob{}%
}
\@onlypreamble\process@table

\endinput
%% 
%% End of file `mlltxchg.def'.
