Skip to content

Commit

Permalink
fix for #269
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Feb 10, 2020
1 parent a144635 commit be6da63
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 11 deletions.
3 changes: 1 addition & 2 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ are not part of the distribution.
=======================================================================


2020-02-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

2020-02-10 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* ltfssini.dtx:
Renamed \@reservedb to \reserved@b
Renamed \@reservedc to \reserved@c
Add \@defaultfamilyhook to \normalfont (gh/269)

* lttextcomp.dtx (subsection{Sub-encoding 2):
Use \@tabacckludge for tabbing where necessary if defining \capitalacute
Expand Down
62 changes: 53 additions & 9 deletions base/ltfssini.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@
% \begin{macrocode}
\prepare@family@series@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
Expand Down Expand Up @@ -1249,7 +1249,6 @@
% \begin{macro}{\normalfont}
% \changes{v2.1a}{1993/11/11}{Macro added}
% \begin{macro}{\reset@font}
% \begin{macro}{\p@reset@font}
% \changes{v1.1n}{1991/08/26}{Macro introduced}
% The macro |\reset@font| is used in \LaTeX{} to switch to a standard
% font, in order to initialize the current font in situations where
Expand All @@ -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@family{\familydefault}%
\edef\f@series{\seriesdefault}%
\edef\f@shape{\shapedefault}%
% \end{macrocode}
%
% \begin{macrocode}
\@defaultfamilyhook
\selectfont}
% \end{macrocode}
%
% \begin{macrocode}
\DeclareRobustCommand\normalfont
{\usefont\encodingdefault
\familydefault
\seriesdefault
\shapedefault
\relax}
\let\reset@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@font\normalfont
%<latexrelease>
%<latexrelease>\let\@defaultfamilyhook\@undefined
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
%
%
%
Expand Down
6 changes: 6 additions & 0 deletions base/testfiles/tlb-latexrelease-003.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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 ....
Expand Down Expand Up @@ -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 ....
Expand Down
6 changes: 6 additions & 0 deletions base/testfiles/tlb-latexrelease-003.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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 ....
Expand Down Expand Up @@ -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 ....
Expand Down
6 changes: 6 additions & 0 deletions base/testfiles/tlb-latexrelease-003.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -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 ....
Expand Down Expand Up @@ -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 ....
Expand Down

0 comments on commit be6da63

Please sign in to comment.