summaryrefslogtreecommitdiff
path: root/macros/latex/base/ltfssini.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/base/ltfssini.dtx')
-rw-r--r--macros/latex/base/ltfssini.dtx146
1 files changed, 106 insertions, 40 deletions
diff --git a/macros/latex/base/ltfssini.dtx b/macros/latex/base/ltfssini.dtx
index fbea725c1d..b06fc161b0 100644
--- a/macros/latex/base/ltfssini.dtx
+++ b/macros/latex/base/ltfssini.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% Copyright (C) 1993-2021
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssini.dtx}
- [2020/10/08 v3.2e LaTeX Kernel (NFSS Initialisation)]
+ [2021/04/26 v3.2h LaTeX Kernel (NFSS Initialisation)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -56,7 +56,7 @@
%
% \GetFileInfo{ltfssini.dtx}
% \title{A new font selection scheme for \TeX{} macro packages\\
-% (Initialisation)\thanks
+% (Initialization)\thanks
% {This file has version number
% \fileversion\ dated \filedate}}
%
@@ -83,7 +83,7 @@
% \changes{v3.1d}{2019/08/27}{Make various commands robust}
%
%
-% \section{NFSS Initialisation}
+% \section{NFSS Initialization}
%
% \iffalse
%<+checkmem>\CHECKMEM
@@ -301,7 +301,7 @@
\else
% \end{macrocode}
%
-% \changes{v3.1g}{2020/02/05}{Clarrified error text}
+% \changes{v3.1g}{2020/02/05}{Clarified error text}
% \begin{macrocode}
\@latex@error{Wrong syntax for \string\DeclareFontSeriesDefault}%
{Mandatory first argument must be 'md' or 'bf'.}
@@ -431,7 +431,7 @@
%<+debug> \series@change@debug{No series preparation (forced \f@series)\on@line}%
\fontfamily#2%
\else
-%<+debug> \series@change@debug{Prepearing for switching to #1 (#2)\on@line}%
+%<+debug> \series@change@debug{Preparing for switching to #1 (#2)\on@line}%
\expand@font@defaults
% \end{macrocode}
% We prepare for changing the current series. We have to find it
@@ -448,7 +448,7 @@
% \item \cs{bfseries} is called for a family using \texttt{bx}
% (e.g., CMR)
% \item Switch to a font family that is none of the meta
-% families, e.g., via \verb=\fontfamily{ptm}\selectfont=
+% families, e.g., via \verb=\fontfamily{ptm}\allowbreak\verb=\selectfont=
% \item Then none of the real meta families, match but the final
% \verb=\@elt{??}= will.
% \item Therefore if the current series is \cs{mddefault} or
@@ -493,7 +493,7 @@
% \end{macrocode}
% The \cs{target@series@value} may contain something like
% \texttt{cm} (coming from a default) and so we can't directly
-% asign it to \cs{f@series} be have to drop any surplus \texttt{m}
+% assign it to \cs{f@series} be have to drop any surplus \texttt{m}
% first.
% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from
% \cs{target@series@value} (gh/291)}
@@ -513,7 +513,7 @@
% In this macro used in the look you basically find the nested
% \cs{ifx}s from the outline above. The only difference is that is
% it is parameterized instead of being written out and only for one
-% block of tests because the code is called reatedly when looping
+% block of tests because the code is called repeatedly when looping
% over the meta family list. From the list we get each meta family
% name in turn.
% \begin{macrocode}
@@ -665,7 +665,7 @@
% the now current series value (in \cs{f@series}).
%
% But what should happen if \cs{seriesdefault} got explicitly
-% changed? In that case the explicit change should surive and we
+% changed? In that case the explicit change should survive and we
% should not alter \cs{seriesdefault}. This is solved by comparing
% the current value of \cs{seriesdefault} with a kernel version
% saved in the format and if they differ we do not call
@@ -915,9 +915,9 @@
%\end{verbatim}
% We have to do the testing while the current family is still
% unchanged but we have to do the adjustment of the series after it
-% got changed (because the new family might has different sets
-% ofshapes available and we certainly don't want to see
-% substituation going on. So we use \cs{target@series@value} to
+% got changed (because the new family might have different sets
+% of shapes available and we certainly don't want to see
+% substitution going on. So we use \cs{target@series@value} to
% hold the target series (if any).
%\begin{verbatim}
% \let\target@series@value\@empty
@@ -1088,6 +1088,8 @@
% \end{macro}
%
%
+% \changes{v3.2g}{2021/03/18}
+% {Add legacy hook definitions for rollback.}
% \begin{macrocode}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
@@ -1140,6 +1142,9 @@
%<latexrelease> \prepare@family@series@update{tt}\ttdefault
%<latexrelease> \@ttfamilyhook
%<latexrelease> \selectfont}
+%<latexrelease>\let\@rmfamilyhook\@empty
+%<latexrelease>\let\@sffamilyhook\@empty
+%<latexrelease>\let\@ttfamilyhook\@empty
%<latexrelease>
% \end{macrocode}
%
@@ -1183,7 +1188,7 @@
% to different NFSS axis values it becomes important to have the
% ability to determine the current context as we can no longer look
% at \cs{f@series} to answer a question such as ``am I currently
-% typsetting in a bold typeface?''
+% typesetting in a bold typeface?''
%
% This is provided by the test \cs{IfFontSeriesContextTF}. It takes
% three arguments:
@@ -1221,7 +1226,7 @@
\DeclareRobustCommand\IfFontSeriesContextTF[1]{%
\expand@font@defaults
% \end{macrocode}
-% In the beginning we haven't found the context we are loking for.
+% In the beginning we haven't found the context we are looking for.
% \begin{macrocode}
\@font@series@contextfalse
% \end{macrocode}
@@ -1238,7 +1243,7 @@
\expandafter\edef\csname ??def@ult\endcsname{\f@family}%
% \end{macrocode}
% Then we run through the meta family list (currently containing
-% just the three values) followed by the artifical meta family
+% just the three values) followed by the artificial meta family
% \texttt{??} and test each of them in turn using
% \cs{test@font@series@context} as the testing command.
% \begin{macrocode}
@@ -1264,7 +1269,7 @@
% \begin{macro}{\test@font@series@context}
% This tests the context (stored in \cs{requested@test@context})
-% and updates the bookean if the right context is found.
+% and updates the boolean if the right context is found.
% \begin{macrocode}
\def\test@font@series@context#1{%
% \end{macrocode}
@@ -1307,8 +1312,9 @@
}
% \end{macrocode}
% \end{macro}
-
-
+%
+%
+%
% \begin{macro}{\if@font@series@context}
% The boolean to signal if we found the requested font series context.
% \begin{macrocode}
@@ -1334,19 +1340,21 @@
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
-
-
-
+%
+%
+%
+%
+%
%
% \section{Supporting nested emphasis}
%
% By default \LaTeXe{} supports two levels of nested emphasis: if
% the current font has an upright shape then it switches to
% \cs{itshape} otherwise to \cs{eminnershape} (which defaults to
-% \cs{upshape}). This means nested emphasis will ocssilate between
+% \cs{upshape}). This means nested emphasis will oscillate between
% italic and upright shapes.
%
-% Sometimes it would be nice to allow for a more lengthly sequence,
+% Sometimes it would be nice to allow for a more lengthy sequence,
% but instead of providing a fixed one \LaTeX{} now offers a
% general mechanism that allows to define arbitrary sequences.
%
@@ -1377,7 +1385,7 @@
% \begin{macro}{\DeclareEmphSequence}
%
% \cs{DeclareEmphSequence} expects a clist of declaration. Spaces in the
-% argument are dropped to avoid surious spaces in the output. The
+% argument are dropped to avoid spurious spaces in the output. The
% declarations are additive. At the very end the shape is reset
% using |\emreset| and |\emforce| so that this case is never
% skipped.\footnote{Maybe we should not add \cs{emforce} but allow
@@ -1401,9 +1409,9 @@
\let\emfontdeclare@clist\@empty
% \end{macrocode}
% \end{macro}
-
-
-
+%
+%
+%
% \begin{macro}{\emrest}
% Reset the font to upright and upper/lower case. With the default rules
% using \cs{shapedefault} does that for us but to be on the safe side we
@@ -1412,12 +1420,13 @@
\DeclareRobustCommand\emreset{\upshape\ulcshape}
% \end{macrocode}
% \end{macro}
-
-
-
+%
+%
+%
% \begin{macro}{\em}
-% The new definition for \cs{em} (and implicitly \cs{emph} is like
-% it was before if \cs{emfontdeclare@clist} is empty.
+%
+% The new definition for \cs{em} (and implicitly \cs{emph}) is the
+% same as before as long as \cs{emfontdeclare@clist} is empty.
% \begin{macrocode}
\DeclareRobustCommand\em{%
\@nomath\em
@@ -1479,7 +1488,7 @@
% \begin{macrocode}
\expandafter\ifx\csname \curr@fontshape/\f@size\em@force
% \end{macrocode}
-% For the comparison with \cs{ifx} we have to exand
+% For the comparison with \cs{ifx} we have to expand
% \cs{em@currfont} once as the relevant info is inside.
% \begin{macrocode}
\expandafter\endcsname
@@ -1761,7 +1770,7 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease>\IncludeInRelease{2021/06/01}%
%<latexrelease> {\normalfont}{Add hook to \normalfont}%
\DeclareRobustCommand\normalfont{%
% \end{macrocode}
@@ -1774,6 +1783,15 @@
\edef\f@series{\seriesdefault}%
\edef\f@shape{\shapedefault}%
% \end{macrocode}
+% Any earlier \cs{fontseries}, etc.\ should be canceled and we
+% should switch unconditionally to the requested font face so we
+% drop any code that may have been stored in
+% \cs{delayed@f@adjustment}.
+% \changes{v3.2h}{2021/04/26}{Unconditionally switch to the requested
+% font face (gh/444)}
+% \begin{macrocode}
+ \let\delayed@f@adjustment\@empty
+% \end{macrocode}
%
% \changes{v3.2b}{2020/08/21}{Integration of new hook management interface}
% \begin{macrocode}
@@ -1785,18 +1803,54 @@
\@defaultfamilyhook % hookname from 2020/02 will vanish
\selectfont}
% \end{macrocode}
-%
+%
% \begin{macrocode}
\let\reset@font\normalfont
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
%
%
% \begin{macrocode}
+% \changes{v3.2g}{2021/03/18}
+% {Add missing 2020/02/02 latexrelease entry.}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
+%<latexrelease>
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease> {\normalfont}{Add hook to \normalfont}%
+%<latexrelease>
+%<latexrelease>\DeclareRobustCommand\normalfont{%
+%<latexrelease> \fontencoding\encodingdefault
+%<latexrelease> \edef\f@family{\familydefault}%
+%<latexrelease> \edef\f@series{\seriesdefault}%
+%<latexrelease> \edef\f@shape{\shapedefault}%
+%<latexrelease> \UseHook{normalfont}%
+%<latexrelease> \@defaultfamilyhook % hookname from 2020/02 will vanish
+%<latexrelease> \selectfont}
+%<latexrelease>
+%<latexrelease>\let\reset@font\normalfont
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>
+%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease> {\normalfont}{Add hook to \normalfont}%
+%<latexrelease>
+%<latexrelease>\DeclareRobustCommand\normalfont{%
+%<latexrelease> \fontencoding\encodingdefault
+%<latexrelease> \edef\f@family{\familydefault}%
+%<latexrelease> \edef\f@series{\seriesdefault}%
+%<latexrelease> \edef\f@shape{\shapedefault}%
+%<latexrelease> \@defaultfamilyhook
+%<latexrelease> \selectfont}
+%<latexrelease>
+%<latexrelease>\let\reset@font\normalfont
+%<latexrelease>
+%<latexrelease>\let\@defaultfamilyhook\@empty
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\normalfont}{Add hook to \normalfont}%
%<latexrelease>
@@ -1863,8 +1917,20 @@
% \changes{v3.1c}{2019/07/09}{Explicitly set some defaults}
% \begin{macrocode}
\fontfamily{cmr}
-\fontseries{m}
-\fontshape{n}
+% \end{macrocode}
+%
+% \changes{v3.2f}{2020/12/04}{Adjust start values for series and shape (gh/444)}
+% Previously the default values for series and shape were set by
+% calling \cs{fontseries} and \cs{fontshape}, but their action is
+% now delayed until \cs{selectfont} which isn't called inside the
+% format (to avoid unnecessarily loading a font that may never get used).
+% We therefore have to set \cs{f@series} and \cs{f@shape} directly instead.
+% \begin{macrocode}
+\def\f@series{m} % \fontseries{m}
+\def\f@shape{n} % \fontshape{n}
+% \end{macrocode}
+%
+% \begin{macrocode}
\fontsize{10}{10}
% \end{macrocode}
%