%% 
%% This is file `nftrace.sty', generated 
%% on <1993/8/5> with the docstrip utility (2.0r).
%% 
%% The original source files were:
%% 
%% nftrace.dtx  (with options: `trace,style')
%% 
%% Copyright (C) 1989--1993 by Frank Mittelbach, Rainer Schoepf. 
%% All rights reserved. 
%% 
%% This file is part of the NFSS2 (New Font Selection Scheme) package. 
%% 
%% This package is distributed in the hope that it will be useful, 
%% but WITHOUT ANY WARRANTY; without even the implied warranty of 
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
%% 
%% 
%% IMPORTANT NOTICE: 
%% 
%% For error reports in case of UNCHANGED versions see readme files. 
%% 
%% Please do not request updates from us directly. Distribution is 
%% done through Mail-Servers and TeX organizations. 
%% 
%% You are not allowed to change this file. You may however copy 
%% this file to a file with a different name and then change the copy 
%% if you obey the restrictions on file changes described in 
%% readme.mz. 
%% 
%% You are allowed to distribute this file under the condition that 
%% it is distributed together with all files mentioned in readme.mz8. 
%% If you receive only some of these files from someone, complain! 
%% 
%% You are NOT ALLOWED to distribute this file alone. You are NOT 
%% ALLOWED to take money for the distribution or use of either this 
%% file or a changed version, except for a nominal charge for copying 
%% etc. 

\def\filename{nftrace}
\def\fileversion{v2.1h}
\def\filedate{93/07/16}
\def\docdate {93/07/16}


%% Copyright (C) 1989-1993 Frank Mittelbach and Rainer Sch\"opf,
%% all rights reserved.
\@ifundefined{DeclareFontShape}
     {\@ifundefined{pickup@font}
        {\@latexerr{The `nftrace' style option can only be used
                    with the new^^Jfont selection scheme}\@eha}
        {\@latexerr{The `nftrace' style option can only be used
                    with the new^^Jfont selection scheme *release 2*}
                   {Your format contains NFSS release 1, but this style
                    option was^^Jdeveloped for release 2.}
        }
      \endinput}
     {}
 \immediate\write\sixt@@n{Style Option: `nftrace'
 \fileversion\space <\filedate>  (FMi and RmS)}
\immediate\write\sixt@@n{English Documentation
\@spaces\@spaces\space  <\docdate>  (FMi and RmS)}
\immediate\write\sixt@@n{Includes module(s):
 trace
}
\def\extract@font{%
   \get@external@font
   \global\expandafter\font\font@name\external@font\relax
    \ifnum \tracingfonts >\@ne
    \font@log{Loading external
             \external@font\space as \font@name\f@warn@break}\fi
    \font@name \relax
    \csname \f@encoding+\f@family\endcsname
    \csname\curr@fontshape\endcsname
    \relax
       }
\def\get@external@font{%
   \let\external@font\@empty
   \edef\font@info{\expandafter\expandafter\expandafter\string
        \csname \curr@fontshape \endcsname}%
   \try@size@range
   \ifx\external@font\@empty
      \try@size@substitution
      \ifx\external@font\@empty
         \errmessage{Font \expandafter \string\font@name\space
                     not found}%
         \error@fontshape
         \get@external@font
   \fi\fi
}

 \def\p@selectfont{%
    \xdef\font@name{%
      \csname\curr@fontshape/\f@size\endcsname}%
    \pickup@font
    \font@name
  \ifnum \tracingfonts>\tw@
    \font@log{Switching to \font@name}\fi
      \@tempskipa \f@baselineskip\relax
      \baselineskip \baselinestretch\@tempskipa
    \setbox\strutbox\hbox{\vrule\@height.7\baselineskip
        \@depth.3\baselineskip \@width\z@}%
    \normalbaselineskip\baselineskip
    \ifx \glb@currsize \f@size
     \else
  \ifnum \tracingfonts>\tw@
    \font@log{Changing size to \f@size/\f@baselineskip}\fi
    \ifmath@fonts\else
      \font@log{No math setup}\fi
     \glb@settings \the\every@size
  \ifnum \tracingfonts>\tw@
    \aftergroup\type@restoreinfo \fi
       \aftergroup\glb@settings \fi
  \ifnum \tracingfonts>\tw@
   \gdef\font@restore{\xdef\font@name{%
     \csname\curr@fontshape/\f@size\endcsname}%
     \font@log{Restoring \space\space\space\font@name}%
     \global\let\font@restore\@empty}%
    \aftergroup\font@restore
  \fi
    }
   \def\type@restoreinfo{\font@log{Restoring size
                         or baselineskip to \f@size/\f@baselineskip}}
\def\baselinestretch{1}
\newtoks\every@size
\every@size={}
\def\use@mathgroup#1#2{\relax\ifmmode
  \ifnum \tracingfonts>\tw@
    \count@#2\relax
    \font@log{Using \noexpand\mathgroup
             (\the\count@) #2}\fi
     \math@bgroup
         \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
         #1\fi
         \mathgroup#2\relax
     \expandafter\math@egroup\fi}%
  \ifx\math@bgroup\begingroup
    \def\math@egroup#1{#1\endgroup
      \ifnum \tracingfonts>\tw@
     \font@log{Restoring \noxpand\mathgroup
        (\ifnum\mathgroup=\m@ne default\else \the\mathgroup \fi)%
        }\fi}
  \fi
\def\getanddefine@fonts#1#2{%
  \ifnum \tracingfonts>\tw@
  \count@#1\relax
    \font@log{\noexpand\mathgroup (\the\count@) #1 <-
              \string#2 \tf@size/\sf@size/\ssf@size}\fi
  \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
  \pickup@font \let\textfont@name\font@name
  \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
  \pickup@font \let\scriptfont@name\font@name
  \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
  \pickup@font
  \edef\math@fonts{\math@fonts
               \textfont#1\textfont@name
               \scriptfont#1\scriptfont@name
               \scriptscriptfont#1\font@name}%
    }
\def\tracingfonts{\font@warning{Command \noexpand\tracingfonts
                  not provided.\f@warn@break
                  Use `nftrace' option in \string\documentstyle\space
                  command.\f@warn@break Command found:}%
                  \count@}
\newcount\tracingfonts
\tracingfonts=1
\def\font@warning#1{%
  \ifnum\tracingfonts>\z@
  \errhelp{This is only a warning message but it gives you^^J%
           time to think about the font substitution above.}%
  \errmessage{NFSS Warning: #1}\else
          \font@trace{#1}%
  \fi
          }
\def\font@trace#1{\immediate\write\sixt@@n
                 {^^JNFSS Info: #1\on@line.^^J}}
\def\font@log#1{%
          \immediate\write\m@ne{NFSS Note: #1\on@line.}}
\def\font@log#1{%
          \immediate\write\sixt@@n{NFSS Note: #1\on@line.}}
\def\ifnot@nil#1{\def\@tempa{#1}%
  \ifx\@tempa\@nnil \expandafter\@gobble\else \expandafter\@iden\fi}
\def\@iden#1{#1}
\def\remove@to@nnil#1\@nnil{}
\def\remove@angles#1>{\set@simple@size@args}
\def\remove@star#1*{#1}
\def\gobble@font@spec#1\@nil<\@nnil{}
\def\extract@sizefn#1*#2\@nil{%
  \if>#2>\set@size@funct@args#1\@nil
         \let\sizefn@info\@empty
  \else\expandafter\set@size@funct@args\remove@star#2\@nil
       \def\sizefn@info{#1}\fi
  }
%% this could be replaced by \try@size@range making the subst slower!
\def\try@simple@size{%
    \def\@tempa{\def\extract@fontinfo####1}%
    \expandafter\@tempa\expandafter<\f@size>##2<##3\@nnil{%
          \ifnot@nil{##2}%
    {\set@simple@size@args##2<##3\@nnil
             \execute@size@function\sizefn@info
            }}%
    \expandafter\expandafter
    \expandafter\extract@fontinfo\expandafter\font@info
    \expandafter<\f@size>\@nil<\@nnil
}
\def\set@simple@size@args#1<{%
          \if<#1<%
    \expandafter\remove@angles
  \else
            \extract@sizefn#1*\@nil
    \expandafter\remove@to@nnil
  \fi}
\def\extract@rangefontinfo#1<#2>{%
       \is@range#2->\@nil#2>}
\def\is@range#1-#2\@nil{%
   \if>#2\expandafter\check@single\else
      \expandafter\check@range\fi}
\newdimen\lower@bound
\newdimen\upper@bound
\def\check@range#1-#2>#3<#4\@nnil{%
  \ifnot@nil{#3}{%
     \def\next{\extract@rangefontinfo<#4\@nnil}%
     \upper@bound0#2\p@
     \ifdim\upper@bound=\z@ \upper@bound\maxdimen\fi
     \ifdim \f@size \p@<\upper@bound
       \lower@bound0#1\p@
       \ifdim \f@size \p@<\lower@bound
        \else
          \set@simple@size@args#3<#4\@nnil
  \execute@size@function\sizefn@info
         \ifx\external@font\@empty
         \else
           \let\next\@empty
         \fi
       \fi
     \fi
     \next}}
\def\check@single#1>#2<#3\@nnil{%
     \def\next{\extract@rangefontinfo<#3\@nnil}%
     \ifdim \f@size \p@=#1\p@
        \set@simple@size@args#2<#3\@nnil
        \execute@size@function\sizefn@info
        \ifx\external@font\@empty
        \else
          \let\next\@empty
        \fi
     \fi
     \next}
\def\set@size@funct@args{\@ifnextchar[%
  \set@size@funct@args@{\set@size@funct@args@[]}}
\def\set@size@funct@args@[#1]#2\@nil{%
  \def\mandatory@arg{#2}%
  \def\optional@arg{#1}}
\def\DeclareSizeFunction#1#2{\@namedef{s@fct@#1}{#2}}
\def\execute@size@function#1{%
         \@ifundefined{s@fct@#1}%
           {\errmessage{Undefined font size function #1}%
            \s@fct@}%
           {\csname s@fct@#1\endcsname}%
}
\def\f@warn@break{^^J\@spaces\@spaces\@spaces}
\def\f@warn@break{^^JNFSS \@spaces\space\space}
\def\try@size@range{%
    \expandafter\extract@rangefontinfo\font@info <-*>\@nil<\@nnil
}

\def\try@size@substitution{%
    \@tempdimb\z@
    \@tempdimc\maxdimen
    \let\lower@font@size\@empty
    \let\higher@font@size\@empty
    \expandafter\extract@subfontinfo\font@info <\number\@M>\@nil<\@nnil
    \dimen@-\f@size\p@
    \advance\@tempdimb\dimen@
    \@tempdimb-\@tempdimb
    \advance\@tempdimc\dimen@
    \ifdim\@tempdimb<\@tempdimc
      \subst@size\lower@font@size\@tempdimb
      \subst@size\higher@font@size\@tempdimc
    \else
      \subst@size\higher@font@size\@tempdimc
      \subst@size\lower@font@size\@tempdimb
   \fi}
\def\subst@size#1#2{%
  \ifx#1\@empty\else
   \ifx\external@font\@empty
      \ifdim#2>\fontsubmax
        \global\fontsubmax#2% #2 should be register
      \fi
      \let\f@user@size\f@size
      \let\f@size#1%
      \ifdim#2>\fontsubfuzz
        \font@warning{Font shape `\curr@fontshape'
                    in size <\f@user@size> not
                    available.\f@warn@break
                    size <\f@size> substituted}%
      \fi
      \try@simple@size
      \do@subst@correction
  \fi
 \fi}
\fontsubfuzz=0pt
\def\extract@subfontinfo#1<#2>{%
  \is@simple#2->\is@simple}
\def\is@simple#1-#2\is@simple{%
   \let\next\extract@subfontinfo
   \if>#2%
      \dimen@ #1\p@
      \ifdim \f@size\p@<\dimen@
        \ifdim \dimen@ <\@M\p@
          \def\higher@font@size{#1}%
  \@tempdimc\dimen@
        \fi
\let\next\gobble@font@spec
      \else
\def\lower@font@size{#1}%
\@tempdimb\dimen@
      \fi
    \fi\next}
\DeclareSizeFunction{}{\empty@sfcnt\font@warning}
\DeclareSizeFunction{s}{\empty@sfcnt\font@log}

\def\empty@sfcnt#1{%
      \@tempdimb \f@size\p@
      \ifx\optional@arg\@empty
      \else
        \@tempdimb \optional@arg\@tempdimb
        #1{Font shape `\curr@fontshape'
            will be\f@warn@break
            scaled to size \the\@tempdimb}%
      \fi
      \edef\external@font{\mandatory@arg\space at\the\@tempdimb}}
\DeclareSizeFunction{gen}{\gen@sfcnt\font@warning}
\DeclareSizeFunction{sgens}{\gen@sfcnt\font@log}

\def\gen@sfcnt{%
      \edef\mandatory@arg{\mandatory@arg\f@size}%
      \empty@sfcnt}
\DeclareSizeFunction{sub}{\sub@sfcnt\font@warning}
\DeclareSizeFunction{ssub}{\sub@sfcnt\font@log}
\def\sub@sfcnt#1{%
    \edef\mandatory@arg{\f@encoding/\mandatory@arg}%
    \begingroup
     \expandafter\split@name\mandatory@arg/\@nil
     \try@load@fontshape
    \endgroup
    \let\f@user@size\f@size
    \expandafter
    \ifx\csname\mandatory@arg\endcsname\relax
      \errmessage{No declaration for shape \mandatory@arg}%
      \error@fontshape
    \else
      #1{Font shape `\curr@fontshape' in size <\f@size> not
                    available.\f@warn@break
                    Font shape `\mandatory@arg' tried instead}%
      \expandafter\split@name\mandatory@arg/\@nil
    \fi
    \edef\f@size{\f@user@size}%
    \get@external@font
    \do@subst@correction
}
\DeclareSizeFunction{subf}{\subf@sfcnt\font@warning}
\DeclareSizeFunction{ssubf}{\subf@sfcnt\font@log}
\def\subf@sfcnt#1{%
      #1{Font shape `\curr@fontshape'
    in size \f@size\space
    not available.\f@warn@break
    external font `\mandatory@arg'
    used}%
      \empty@sfcnt#1%
      }
\DeclareSizeFunction{fixed}{\fixed@sfcnt\font@warning}
\DeclareSizeFunction{sfixed}{\fixed@sfcnt\font@log}
\def\fixed@sfcnt#1{%
  \ifx\optional@arg\@empty
    \let\external@font\mandatory@arg
  \else
    \edef\external@font{\mandatory@arg\space at\optional@arg pt}%
  \fi
  #1{External font `\external@font' loaded for size <\f@size>}%
}


\endinput
%% 
%% End of file `nftrace.sty'.
