[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh269+271: fix for #269 (be6da633)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Feb 10 23:45:13 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh269+271
Link       : https://github.com/latex3/latex2e/commit/be6da633d641197af6d92d110494887408ea59e2

>---------------------------------------------------------------

commit be6da633d641197af6d92d110494887408ea59e2
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Feb 10 23:45:13 2020 +0100

    fix for #269


>---------------------------------------------------------------

be6da633d641197af6d92d110494887408ea59e2
 base/changes.txt                               |  3 +-
 base/ltfssini.dtx                              | 62 ++++++++++++++++++++++----
 base/testfiles/tlb-latexrelease-003.luatex.tlg |  6 +++
 base/testfiles/tlb-latexrelease-003.tlg        |  6 +++
 base/testfiles/tlb-latexrelease-003.xetex.tlg  |  6 +++
 5 files changed, 72 insertions(+), 11 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 707e2b24..5e749aa1 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -7,11 +7,10 @@ are not part of the distribution.
 
 2020-02-10  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
-2020-02-10  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
-
 	* ltfssini.dtx:
 	Renamed \@reservedb to \reserved at b
 	Renamed \@reservedc to \reserved at c
+	Add \@defaultfamilyhook to \normalfont (gh/269)
 
 	* lttextcomp.dtx (subsection{Sub-encoding 2):
 	Use \@tabacckludge for tabbing where necessary if defining \capitalacute
diff --git a/base/ltfssini.dtx b/base/ltfssini.dtx
index 404bc84b..826a3529 100644
--- a/base/ltfssini.dtx
+++ b/base/ltfssini.dtx
@@ -570,7 +570,7 @@
 %    \begin{macrocode}
    \prepare at family@series at update{rm}\rmdefault
 %    \end{macrocode}
-%    The comes the hook code (by default a no-op) and finally the call
+%    Then comes the hook code (by default a no-op) and finally the call
 %    to \cs{selectfont}.
 %    \begin{macrocode}
    \@rmfamilyhook
@@ -1249,7 +1249,6 @@
 % \begin{macro}{\normalfont}
 % \changes{v2.1a}{1993/11/11}{Macro added}
 % \begin{macro}{\reset at font}
-% \begin{macro}{\p at reset@font}
 % \changes{v1.1n}{1991/08/26}{Macro introduced}
 %    The macro |\reset at font| is used in \LaTeX{} to switch to a standard
 %    font, in order to initialize the current font in situations where
@@ -1264,18 +1263,63 @@
 % \changes{v2.1k}{1994/05/14}{Remove surplus braces}
 % \changes{v3.0f}{1995/10/16}{Added \cs{relax} after \cs{usefont},
 %              as the latter eats up spaces.}
+% \changes{v3.1h}{2020/02/10}{Add \cs{@defaultfamilyhook} to \cs{normalfont} (gh/269)}
+%    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease>                 {\normalfont}{Add hook to \normalfont}%
+\DeclareRobustCommand\normalfont{%
+%    \end{macrocode}
+%    Instead of calling \cs{usefont}, as it was done in the past, we
+%    inline the code from \cs{usefont} as we want to add the hook
+%    before \cs{selectfont}, but after all the font attributes are set.
+%    \begin{macrocode}
+   \fontencoding\encodingdefault
+   \edef\f at family{\familydefault}%
+   \edef\f at series{\seriesdefault}%
+   \edef\f at shape{\shapedefault}%
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+   \@defaultfamilyhook
+   \selectfont}
+%    \end{macrocode}
+%    
 %    \begin{macrocode}
-\DeclareRobustCommand\normalfont
-                 {\usefont\encodingdefault
-                          \familydefault
-                          \seriesdefault
-                          \shapedefault
-                  \relax}
 \let\reset at font\normalfont
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
+%    
+%
+%  \begin{macro}{\@defaultfamilyhook}
+%    By default the hooks do nothing.
+% \changes{v3.1h}{2020/02/10}{Add \cs{@defaultfamilyhook} to \cs{normalfont} (gh/269)}
+%    \begin{macrocode}
+\let\@defaultfamilyhook\@empty
+%    \end{macrocode}
+%  \end{macro}
+%
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\normalfont}{Add hook to \normalfont}%
+%<latexrelease>
+%<latexrelease>\DeclareRobustCommand\normalfont
+%<latexrelease>         {\usefont\encodingdefault
+%<latexrelease>                  \familydefault
+%<latexrelease>                  \seriesdefault
+%<latexrelease>                  \shapedefault
+%<latexrelease>                  \relax}
+%<latexrelease>\let\reset at font\normalfont
+%<latexrelease>
+%<latexrelease>\let\@defaultfamilyhook\@undefined
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
 %
 %
 %
diff --git a/base/testfiles/tlb-latexrelease-003.luatex.tlg b/base/testfiles/tlb-latexrelease-003.luatex.tlg
index 45d6d558..9643357f 100644
--- a/base/testfiles/tlb-latexrelease-003.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.luatex.tlg
@@ -191,6 +191,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Skipping: [....-..-..] TU encoding default on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....
@@ -524,6 +527,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
 Already applied: [....-..-..] Nested emph on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Already applied: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.tlg b/base/testfiles/tlb-latexrelease-003.tlg
index 1951c5b2..af0aa261 100644
--- a/base/testfiles/tlb-latexrelease-003.tlg
+++ b/base/testfiles/tlb-latexrelease-003.tlg
@@ -189,6 +189,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Skipping: [....-..-..] TU encoding default on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....
@@ -516,6 +519,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
 Already applied: [....-..-..] Nested emph on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Already applied: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.xetex.tlg b/base/testfiles/tlb-latexrelease-003.xetex.tlg
index 3981fab1..90033881 100644
--- a/base/testfiles/tlb-latexrelease-003.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.xetex.tlg
@@ -189,6 +189,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Skipping: [....-..-..] TU encoding default on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....
@@ -525,6 +528,9 @@ Skipping: [....-..-..] Nested emph on input line ....
 Applying: [....-..-..] Nested emph on input line ....
 LaTeX Info: Redefining \em on input line ....
 Already applied: [....-..-..] Nested emph on input line ....
+Skipping: [....-..-..] Add hook to \normalfont  on input line ....
+Applying: [....-..-..] Add hook to \normalfont  on input line ....
+LaTeX Info: Redefining \normalfont on input line ....
 Applying: [....-..-..] TU encoding default on input line ....
 Already applied: [....-..-..] TU encoding default on input line ....
 Skipping: [....-..-..] font defaults change on input line ....





More information about the latex3-commits mailing list.