[latex3-commits] [git/LaTeX3-latex3-latex2e] gh291: code and test for #291; further documentation to follow (778b5aea)
Frank Mittelbach
frank.mittelbach at latex-project.org
Tue Feb 25 22:17:19 CET 2020
Repository : https://github.com/latex3/latex2e
On branch : gh291
Link : https://github.com/latex3/latex2e/commit/778b5aea1633d11728ae72feaf0a82a1e407f3c6
>---------------------------------------------------------------
commit 778b5aea1633d11728ae72feaf0a82a1e407f3c6
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Tue Feb 25 22:17:19 2020 +0100
code and test for #291; further documentation to follow
>---------------------------------------------------------------
778b5aea1633d11728ae72feaf0a82a1e407f3c6
base/ltfssini.dtx | 50 +++++++++++++++++---
base/testfiles-search/tlb-nfssaxes-009.lvt | 49 +++++++++++++++++++
base/testfiles-search/tlb-nfssaxes-009.tlg | 76 ++++++++++++++++++++++++++++++
3 files changed, 168 insertions(+), 7 deletions(-)
diff --git a/base/ltfssini.dtx b/base/ltfssini.dtx
index bdf5f5e6..7bc1d2f5 100644
--- a/base/ltfssini.dtx
+++ b/base/ltfssini.dtx
@@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssini.dtx}
- [2020/02/18 v3.1i LaTeX Kernel (NFSS Initialisation)]
+ [2020/02/25 v3.1j LaTeX Kernel (NFSS Initialisation)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -244,7 +244,7 @@
% \DescribeMacro\DeclareFontSeriesDefault
% We now support this concept directly from within \LaTeX{} and for
% use in font packages (or the document preamble) we offer
-% \cs{DeclareSeriesDefault}. This declaration takes three
+% \cs{DeclareFontSeriesDefault}. This declaration takes three
% arguments:
% \begin{description}
% \item[document family interface:] Can either be \texttt{rm},
@@ -393,8 +393,14 @@
\edef\rmdef at ult{\rmdefault}%
\edef\sfdef at ult{\sfdefault}%
\edef\ttdef at ult{\ttdefault}%
- \edef\bfdef at ult{\bfdefault}%
- \edef\mddef at ult{\mddefault}%
+% \end{macrocode}
+% The series defaults may contain some surplus \texttt{m} that we
+% need to drop here.
+% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from \cs{bfdef at ult}
+% and \cs{mddef at ult} (gh/291)}
+% \begin{macrocode}
+ \edef\bfdef at ult{\expandafter\series at drop@one at m\bfdefault mm\series at drop@one at m}%
+ \edef\mddef at ult{\expandafter\series at drop@one at m\mddefault mm\series at drop@one at m}%
\edef\famdef at ult{\familydefault}%
}
% \end{macrocode}
@@ -718,7 +724,17 @@
\maybe at load@fontshape
%<+debug> \series at change@debug{Target series:
%<+debug> \f at series \space -> \target at series@value}%
- \let\f at series\target at series@value
+% \end{macrocode}
+% The \cs{target at series@value} may contain something like
+% \texttt{cm} (coming from a default) and so we can't directly
+% asign it to \cs{f at series} be have to drop any surplus \texttt{m}
+% first.
+% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from
+% \cs{target at series@value} (gh/291)}
+% \begin{macrocode}
+% \let\f at series\target at series@value
+ \edef\f at series{\expandafter\series at drop@one at m
+ \target at series@value mm\series at drop@one at m}%
\fi
\fi
\fi
@@ -776,10 +792,30 @@
% \cs{rmfamily}. This is now covered by looping and stopping the
% loop when a match was found.
% \begin{macrocode}
- \expandafter\ifx\csname mdseries@#1\endcsname\f at series
+% \end{macrocode}
+% We have to sanitize the default value first because it may
+% contain something like \texttt{mc} and that would never match
+% \cs{f at series} because there it would be called \texttt{c} with
+% the \texttt{m} dropped. It would be probably better to do that
+% differently these days, but it is hard to adjust without causing
+% a lot of issues, so we do the dropping in various places instead.
+% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from \cs{reserved at d}
+% (gh/291)}
+% \begin{macrocode}
+ \edef\reserved at d{\expandafter\expandafter\expandafter
+ \series at drop@one at m\csname mdseries@#1\endcsname mm\series at drop@one at m}%
+ \ifx\reserved at d\f at series
%<+debug> \series at change@debug{mdseries@#1 matched -> \reserved at b}%
\let\target at series@value\reserved at b
- \else\expandafter\ifx\csname bfseries@#1\endcsname\f at series
+ \else
+% \end{macrocode}
+% Again do some sanitizing.
+% \changes{v3.1j}{2020/02/25}{Drop surplus ``m'' from \cs{reserved at d}
+% (gh/291)}
+% \begin{macrocode}
+ \edef\reserved at d{\expandafter\expandafter\expandafter
+ \series at drop@one at m\csname bfseries@#1\endcsname mm\series at drop@one at m}%
+ \ifx\reserved at d\f at series
%<+debug> \series at change@debug{bfseries@#1 matched -> \reserved at c}%
\let\target at series@value\reserved at c
\else\ifx\f at series\mddef at ult \let\target at series@value\reserved at b
diff --git a/base/testfiles-search/tlb-nfssaxes-009.lvt b/base/testfiles-search/tlb-nfssaxes-009.lvt
new file mode 100644
index 00000000..22eca71e
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-009.lvt
@@ -0,0 +1,49 @@
+\documentclass{article}
+
+\input{test2e}
+
+
+
+\makeatletter
+\def\showfont#1#2{\typeout{#1: \f at encoding/\f at family/\f at series/\f at shape \space (#2)}}
+\makeatother
+
+\renewcommand\rmdefault{lmr}
+\renewcommand\rmdefault{lmss}
+\renewcommand\ttdefault{lmvtt}
+\renewcommand\encodingdefault{T1}
+
+\DeclareFontSeriesDefault[rm]{md}{m}
+\DeclareFontSeriesDefault[rm]{bf}{bx}
+
+\DeclareFontSeriesDefault[sf]{md}{m}
+\DeclareFontSeriesDefault[sf]{bf}{bx}
+
+\DeclareFontSeriesDefault[tt]{md}{lm}
+\DeclareFontSeriesDefault[tt]{bf}{bm}
+
+
+
+\begin{document}
+
+\sffamily\ttfamily\rmfamily % have them loaded already
+
+\START
+
+\showfont{1}{m} AAA
+
+\bfseries
+\showfont{2}{bx} BBB
+
+\ttfamily
+\showfont{3}{b} CCC
+
+\mdseries
+\showfont{4}{l} DDD
+
+\sffamily
+\showfont{5}{m} EEE
+
+
+\showoutput
+\end{document}
diff --git a/base/testfiles-search/tlb-nfssaxes-009.tlg b/base/testfiles-search/tlb-nfssaxes-009.tlg
new file mode 100644
index 00000000..cd0780ae
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-009.tlg
@@ -0,0 +1,76 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+1: T1/lmss/m/n (m)
+2: T1/lmss/bx/n (bx)
+3: T1/lmvtt/b/n (b)
+4: T1/lmvtt/l/n (l)
+5: T1/cmss/m/n (m)
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 491.94745fil
+...\write-{}
+...\glue(\topskip) 3.0555
+...\hbox(6.9445+0.0)x345.0, glue set 309.99902fil
+....\hbox(0.0+0.0)x15.0
+....\T1/lmss/m/n/10 A
+....\T1/lmss/m/n/10 A
+....\T1/lmss/m/n/10 A
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 5.0555
+...\hbox(6.9445+0.0)x345.0, glue set 308.00102fil
+....\hbox(0.0+0.0)x15.0
+....\T1/lmss/bx/n/10 B
+....\T1/lmss/bx/n/10 B
+....\T1/lmss/bx/n/10 B
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 5.81453
+...\hbox(6.18547+0.0)x345.0, glue set 307.25107fil
+....\hbox(0.0+0.0)x15.0
+....\T1/lmvtt/b/n/10 C
+....\T1/lmvtt/b/n/10 C
+....\T1/lmvtt/b/n/10 C
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 5.8045
+...\hbox(6.1955+0.0)x345.0, glue set 306.375fil
+....\hbox(0.0+0.0)x15.0
+....\T1/lmvtt/l/n/10 D
+....\T1/lmvtt/l/n/10 D
+....\T1/lmvtt/l/n/10 D
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 5.05725
+...\hbox(6.94275+0.0)x345.0, glue set 312.0877fil
+....\hbox(0.0+0.0)x15.0
+....\T1/cmss/m/n/10 E
+....\T1/cmss/m/n/10 E
+....\T1/cmss/m/n/10 E
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.4445
+..\hbox(6.5555+0.0)x345.0, glue set 170.0fil
+...\glue 0.0 plus 1.0fil
+...\T1/lmss/m/n/10 1
+...\glue 0.0 plus 1.0fil
+(tlb-nfssaxes-009.aux)
More information about the latex3-commits
mailing list.