home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
useful
/
dist
/
text
/
tex
/
pastex
/
macros
/
latex
/
nfss2
/
nftrace.sty
< prev
next >
Wrap
Text File
|
1993-08-05
|
13KB
|
387 lines
%%
%% 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