Debian Codegraph @

texmf-dist/tex/latex/base/tracefnt.sty

raw
1 %%
2 %% This is file `tracefnt.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% ltfsstrc.dtx (with options: `package,trace')
8 %%
9 %% This is a generated file.
10 %%
11 %% The source is maintained by the LaTeX Project team and bug
12 %% reports for it can be opened at https://latex-project.org/bugs.html
13 %% (but please observe conditions on bug reports sent to that address!)
14 %%
15 %%
16 %% Copyright (C) 1993-2025
17 %% The LaTeX Project and any individual authors listed elsewhere
18 %% in this file.
19 %%
20 %% This file was generated from file(s) of the LaTeX base system.
21 %% --------------------------------------------------------------
22 %%
23 %% It may be distributed and/or modified under the
24 %% conditions of the LaTeX Project Public License, either version 1.3c
25 %% of this license or (at your option) any later version.
26 %% The latest version of this license is in
27 %% https://www.latex-project.org/lppl.txt
28 %% and version 1.3c or later is part of all distributions of LaTeX
29 %% version 2008 or later.
30 %%
31 %% This file has the LPPL maintenance status "maintained".
32 %%
33 %% This file may only be distributed together with a copy of the LaTeX
34 %% base system. You may however distribute the LaTeX base system without
35 %% such generated files.
36 %%
37 %% The list of all files belonging to the LaTeX base distribution is
38 %% given in the file `manifest.txt'. See also `legal.txt' for additional
39 %% information.
40 %%
41 %% The list of derived (unpacked) files belonging to the distribution
42 %% and covered by LPPL is defined by the unpacking scripts (with
43 %% extension .ins) which are part of the distribution.
44 %%% From File: ltfsstrc.dtx
45 %% Copyright (C) 1989-97 by Frank Mittelbach and Rainer Sch\"opf.
46 %% Copyright (C) 1994-97 by LaTeX Project. All rights reserved.
47 \NeedsTeXFormat{LaTeX2e}[2021/06/01]
48 \ProvidesPackage{tracefnt}
49 [2020/12/22 v3.0n Standard LaTeX package (font tracing)]
50 \newcount\tracingfonts
51 \tracingfonts=0
52 \DeclareOption{errorshow}{%
53 \def\@font@info#1{%
54 \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
55 {LaTeX Font Info: \space\space\space#1}}%
56 \def\@font@warning#1{%
57 \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
58 {LaTeX Font Warning: #1}}%
59 }
60 \DeclareOption{warningshow}{%
61 \def\@font@info#1{%
62 \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
63 {LaTeX Font Info: \space\space\space#1}}%
64 \def\@font@warning#1{%
65 \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
66 {LaTeX Font Warning: #1}}%
67 }
68 \DeclareOption{infoshow}{%
69 \def\@font@info#1{%
70 \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
71 {LaTeX Font Info: \space\space\space#1}}%
72 \def\@font@warning#1{%
73 \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
74 {LaTeX Font Warning: #1}}%
75 }
76 \DeclareOption{loading}{%
77 \tracingfonts\tw@
78 }
79 \DeclareOption{debugshow}{%
80 \ExecuteOptions{infoshow}%
81 \tracingfonts\thr@@
82 }
83 \DeclareOption{pausing}{%
84 \def\@font@warning#1{%
85 \GenericError
86 {(Font)\@spaces\@spaces\@spaces\space\space}%
87 {LaTeX Font Warning: #1}%
88 {See the LaTeX Companion for details.}%
89 {I'll stop for every LaTeX Font Warning because
90 you requested\MessageBreak the `pausing' option
91 to the tracefnt package.}}%
92 }
93 \ExecuteOptions{infoshow}
94 \ProcessOptions
95 \def\extract@font{%
96 \get@external@font
97 \global\expandafter\font\font@name\external@font\relax
98 \ifnum \tracingfonts >\@ne
99 \@font@info{External font `\external@font'
100 loaded as\MessageBreak \font@name}\fi
101 \font@name \relax
102 \csname \f@encoding+\f@family\endcsname
103 \csname\curr@fontshape\endcsname
104 \relax
105 }
106
107 \DeclareRobustCommand\selectfont
108 {%
109 \ifx\f@linespread\baselinestretch \else
110 \set@fontsize\baselinestretch\f@size\f@baselineskip \fi
111 \ifx\delayed@f@adjustment\@empty
112 \else
113 \let\f@shape@saved\f@shape
114 \let\f@series@saved\f@series
115 \delayed@f@adjustment
116 \maybe@load@fontshape
117 \ifcsname \f@encoding/\f@family/\f@series/\f@shape \endcsname
118 \else
119 \let\f@shape\f@shape@saved
120 \let\f@series\f@series@saved
121 \let\delayed@merge@font@shape\merge@font@shape
122 \let\delayed@merge@font@series\merge@font@series
123 \delayed@f@adjustment
124 \let\delayed@merge@font@shape\merge@font@shape@without@substitution
125 \let\delayed@merge@font@series\merge@font@series@without@substitution
126 \fi
127 \let\delayed@f@adjustment\@empty
128 \fi
129 \@forced@seriesfalse
130 \xdef\font@name{%
131 \csname\curr@fontshape/\f@size\endcsname}%
132 \pickup@font
133 \font@name
134 \UseHook{selectfont}%
135 \size@update
136 \enc@update
137 }
138 \AddToHook{selectfont}
139 {\ifnum \tracingfonts>\tw@
140 \@font@info{Switching to \font@name}\fi}
141 \IncludeInRelease{2021/06/01}%
142 {\selectfont}{Add hook to \selectfont}%
143 \EndIncludeInRelease
144 \IncludeInRelease{0000/00/00}%
145 {\selectfont}{Add hook to \selectfont}%
146
147 \DeclareRobustCommand\selectfont
148 {%
149 \ifx\f@linespread\baselinestretch \else
150 \set@fontsize\baselinestretch\f@size\f@baselineskip \fi
151 \xdef\font@name{%
152 \csname\curr@fontshape/\f@size\endcsname}%
153 \pickup@font
154 \font@name
155 \size@update
156 \enc@update
157 }
158
159 \EndIncludeInRelease
160 \def\set@fontsize#1#2#3{%
161 \@defaultunits\@tempdimb#2pt\relax\@nnil
162 \edef\f@size{\strip@pt\@tempdimb}%
163 \@defaultunits\@tempskipa#3pt\relax\@nnil
164 \edef\f@baselineskip{\the\@tempskipa}%
165 \edef\f@linespread{#1}%
166 \let\baselinestretch\f@linespread
167 \def\size@update{%
168 \baselineskip\f@baselineskip\relax
169 \baselineskip\f@linespread\baselineskip
170 \normalbaselineskip\baselineskip
171 \setbox\strutbox\hbox{%
172 \vrule\@height.7\baselineskip
173 \@depth.3\baselineskip
174 \@width\z@}%
175 \ifnum \tracingfonts>\tw@
176 \ifx\f@linespread\@empty
177 \let\reserved@a\@empty
178 \else
179 \def\reserved@a{\f@linespread x}%
180 \fi
181 \@font@info{Changing size to \f@size/\reserved@a
182 \f@baselineskip}%
183 \aftergroup\type@restoreinfo \fi
184 \let\size@update\relax}%
185 }
186 \let\size@update\relax
187 \def\type@restoreinfo{%
188 \ifx\f@linespread\@empty
189 \let\reserved@a\@empty
190 \else
191 \def\reserved@a{\f@linespread x}%
192 \fi
193 \@font@info{Restoring size to
194 \f@size/\reserved@a\f@baselineskip}}
195 \def\glb@settings{%
196 \expandafter\ifx\csname S@\f@size\endcsname\relax
197 \calculate@math@sizes
198 \fi
199 \csname S@\f@size\endcsname
200 \ifmath@fonts
201 \ifnum \tracingfonts>\tw@
202 \@font@info{Setting up math fonts for
203 \f@size/\f@baselineskip}\fi
204 \begingroup
205 \escapechar\m@ne
206 \csname mv@\math@version \endcsname
207 \globaldefs\@ne
208 \math@fonts
209 \let \glb@currsize \f@size
210 \endgroup
211 \the\every@math@size
212 \else
213 \ifnum \tracingfonts>\tw@
214 \@font@info{No math setup for
215 \f@size/\f@baselineskip}\fi
216 \fi
217 }
218 \def\check@mathfonts{%
219 \ifx \glb@currsize \f@size
220 \ifnum \tracingfonts>\thr@@
221 \@font@info{*** MATH: no change \f@size\space
222 curr/global (\curr@math@size/\glb@currsize)}\fi
223 \else
224 \ifnum \tracingfonts>\thr@@
225 \@font@info{*** MATH: setting up \f@size\space
226 curr/global (\curr@math@size/\glb@currsize)}\fi
227 \glb@settings
228 \init@restore@glb@settings
229 \fi
230 \let\curr@math@size\f@size
231 \def\init@restore@glb@settings{\aftergroup\restglb@settings}%
232 }
233 \def\init@restore@glb@settings{%
234 \ifnum \tracingfonts>\thr@@
235 \@font@info{*** MATH: no resetting (not in
236 nested math)}\fi
237 }
238 \def\restglb@settings{%
239 \ifnum \tracingfonts>\thr@@
240 \@font@info{*** MATH: restoring}\fi
241 \begingroup
242 \let\f@size\curr@math@size
243 \ifx\glb@currsize \f@size
244 \ifnum \tracingfonts>\thr@@
245 \@font@info{*** MATH: ... already okay (\f@size)}\fi
246 \else
247 \ifnum \tracingfonts>\thr@@
248 \@font@info{*** MATH: ... to \f@size}\fi
249 \glb@settings
250 \fi
251 \endgroup
252 }
253 \def\use@mathgroup#1#2{\relax\ifmmode
254 \ifnum \tracingfonts>\tw@
255 \count@#2\relax
256 \@font@info{Using \noexpand\mathgroup
257 (\the\count@) #2}\fi
258 \math@bgroup
259 \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
260 #1\fi
261 \mathgroup#2\relax
262 \expandafter\math@egroup\fi}%
263 \ifx\math@bgroup\bgroup
264 \def\math@egroup#1{#1\egroup
265 \ifnum \tracingfonts>\tw@
266 \@font@info{Restoring \noexpand\mathgroup
267 (\ifnum\mathgroup=\m@ne default\else \the\mathgroup \fi)%
268 }\fi}
269 \fi
270 \def\getanddefine@fonts#1#2{%
271 \ifnum \tracingfonts>\tw@
272 \count@#1\relax
273 \@font@info{\noexpand\mathgroup (\the\count@) #1 :=\MessageBreak
274 \string#2 \tf@size/\sf@size/\ssf@size}\fi
275 \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
276 \pickup@font \let\textfont@name\font@name
277 \xdef\font@name{\csname \transform@scriptfont {sf}{#2}/\sf@size\endcsname}%
278 \pickup@font \let\scriptfont@name\font@name
279 \xdef\font@name{\csname \transform@scriptfont {ssf}{#2}/\ssf@size\endcsname}%
280 \pickup@font
281 \edef\math@fonts{\math@fonts
282 \textfont#1\textfont@name
283 \scriptfont#1\scriptfont@name
284 \scriptscriptfont#1\font@name}%
285 }
286 \ExplSyntaxOn
287 \cs_set:Npn \transform@scriptfont #1 #2 {
288 \exp_last_unbraced:Nno
289 \__nfss_transform_scriptfont:nw
290 {#1}
291 {\token_to_str:N #2}
292 }
293 \cs_set:Npn \__nfss_transform_scriptfont:nw #1 #2 / #3 / {
294 \cs_if_exist_use:cF { __nfss_mapped_scriptfont_family_ #1 _ #2 / #3 } { #2 / #3 }
295 /
296 }
297 \cs_set:Npn \DeclareMathScriptfontMapping #1 #2 #3 #4 #5 #6 {
298 \cs_set:cpn { __nfss_mapped_scriptfont_family_sf_ #1 / #2 } { #3 / #4 }
299 \cs_set:cpn { __nfss_mapped_scriptfont_family_ssf_ #1 / #2 } { #5 / #6 }
300 }
301 \ExplSyntaxOff
302 \def\execute@size@function#1{%
303 \@ifundefined{s@fct@#1}%
304 {\errmessage{Undefined font size function #1}%
305 \s@fct@}%
306 {\csname s@fct@#1\endcsname}%
307 }
308 \def\fontsubfuzz{0pt}
309 \endinput
310 %%
311 %% End of file `tracefnt.sty'.