Skip to content

Commit

Permalink
fixing issues listed in #444
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Apr 26, 2021
1 parent 6ba1be7 commit 89d8fde
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 106 deletions.
12 changes: 12 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================

2021-04-26 Frank Mittelbach <[email protected]>

* ltfsstrc.dtx (subsection{General font loading}):
Unset the forced series boolean when reaching \selectfont (gh/444)

* ltfssini.dtx (subsection{Miscellaneous}):
Unconditionally switch to the requested font face with \normalfont (gh/444)

* ltfssbas.dtx (subsection{Macros for the user}):
Unconditionally switch to the requested font face with \usefont (gh/444)


2021-04-20 Frank Mittelbach <[email protected]>

* ltexpl.dtx (subsection{Loader}): Don't empty kernel hooks on rollback
Expand Down
28 changes: 24 additions & 4 deletions base/ltfssbas.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
%
%
\ProvidesFile{ltfssbas.dtx}
[2020/12/10 v3.2h LaTeX Kernel (NFSS Basic Macros)]
[2021/04/26 v3.2i LaTeX Kernel (NFSS Basic Macros)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
Expand Down Expand Up @@ -896,15 +896,35 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease> {\usefont}{Drop m in usefont}%
%<latexrelease>\IncludeInRelease{2021/06/01}%
%<latexrelease> {\usefont}{Force font face}%
\DeclareRobustCommand\usefont[4]{\fontencoding{#1}%
\edef\f@family{#2}%
\set@target@series{#3}%
\edef\f@shape{#4}\selectfont
\edef\f@shape{#4}%
% \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.2i}{2021/04/26}{Unconditionally switch to the requested
% font face (gh/444)}
% \begin{macrocode}
\let\delayed@f@adjustment\@empty
\selectfont
\ignorespaces}
%</2ekernel|latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{2020/02/02}%
%<latexrelease> {\usefont}{Drop m in usefont}%
%<latexrelease>
%<latexrelease>\DeclareRobustCommand\usefont[4]{\fontencoding{#1}%
%<latexrelease> \edef\f@family{#2}%
%<latexrelease> \set@target@series{#3}%
%<latexrelease> \edef\f@shape{#4}\selectfont
%<latexrelease> \ignorespaces}
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{0000/00/00}%
%<latexrelease> {\usefont}{Drop m in usefont}%
%<latexrelease>
Expand Down
32 changes: 30 additions & 2 deletions base/ltfssini.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
%
%
\ProvidesFile{ltfssini.dtx}
[2021/03/18 v3.2g LaTeX Kernel (NFSS Initialisation)]
[2021/04/26 v3.2h LaTeX Kernel (NFSS Initialisation)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
Expand Down Expand Up @@ -1770,7 +1770,7 @@
% \begin{macrocode}
%</2ekernel>
%<*2ekernel|latexrelease>
%<latexrelease>\IncludeInRelease{2020/10/01}%
%<latexrelease>\IncludeInRelease{2021/06/01}%
%<latexrelease> {\normalfont}{Add hook to \normalfont}%
\DeclareRobustCommand\normalfont{%
% \end{macrocode}
Expand All @@ -1783,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}
Expand All @@ -1809,6 +1818,22 @@
%</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>
Expand All @@ -1819,6 +1844,9 @@
%<latexrelease> \edef\f@shape{\shapedefault}%
%<latexrelease> \@defaultfamilyhook
%<latexrelease> \selectfont}
%<latexrelease>
%<latexrelease>\let\reset@font\normalfont
%<latexrelease>
%<latexrelease>\let\@defaultfamilyhook\@empty
%<latexrelease>
%<latexrelease>\EndIncludeInRelease
Expand Down
10 changes: 9 additions & 1 deletion base/ltfsstrc.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
%<package> [2020/12/22 v3.0n Standard LaTeX package (font tracing)]
% \fi
% \ProvidesFile{ltfsstrc.dtx}
% [2020/12/22 v3.0n LaTeX Kernel (NFSS tracing)]
% [2021/04/26 v3.0o LaTeX Kernel (NFSS tracing)]
%
% \iffalse
%<+checkmem>\CHECKMEM
Expand Down Expand Up @@ -525,6 +525,14 @@
\let\delayed@f@adjustment\@empty
\fi
% \end{macrocode}
% If the series was forced we should now cancel that in case the
% next series change is done with some low-level setting to
% \cs{f@series}.
% \changes{v3.0o}{2021/04/26}{Unset the forced series boolean when reaching
% \cs{selectfont} (gh/444)}
% \begin{macrocode}
\@forced@seriesfalse
% \end{macrocode}
% Then we generate the internal name of the font
% by concatenating {\em family}, {\em series},
% {\em shape}, and current {\em size},
Expand Down
12 changes: 6 additions & 6 deletions base/testfiles/github-0444b.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ Issue 1: we should get bx? not in the first case
1b: \OT1/cmr/b/n/10
1c: \OT1/cmr/bx/n/10
Issue 2: normalfont and usefont should unconditionally set the face
2a: \OT1/cmr/b/n/10
2b: \OT1/cmr/m/it/10
2c: \OT1/cmr/b/n/10
2d: \OT1/cmr/m/it/10
Issue 3:
2a: \OT1/cmr/m/n/10
2b: \OT1/cmr/m/n/10
2c: \OT1/cmr/m/n/10
2d: \OT1/cmr/m/n/10
Issue 3: force should make no difference
3a: \OT1/cmr/m/n/10
LaTeX Font Info: Trying to load font information for OT1+lmr on input line ...
8.
3b: \OT1/lmr/b/n/10
3c: \OT1/cmr/b/n/10
3c: \OT1/cmr/bx/n/10
3d: \OT1/cmr/m/n/10
3e: \OT1/lmr/b/n/10
3f: \OT1/cmr/bx/n/10
Expand Down
2 changes: 1 addition & 1 deletion base/testfiles/github-0444b.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
\showit{2d}{\fontshape{it}\usefont{OT1}{cmr}{m}{n} Lorem ipsum}%gives it


\typeout{Issue 3: }
\typeout{Issue 3: force should make no difference}

{
\fontseriesforce{m}\selectfont Lorem ipsum forced \showfont{3a}
Expand Down
12 changes: 6 additions & 6 deletions base/testfiles/github-0444b.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Issue 1: we should get bx? not in the first case
1b: \OT1/cmr/b/n/10
1c: \OT1/cmr/bx/n/10
Issue 2: normalfont and usefont should unconditionally set the face
2a: \OT1/cmr/b/n/10
2b: \OT1/cmr/m/it/10
2c: \OT1/cmr/b/n/10
2d: \OT1/cmr/m/it/10
Issue 3:
2a: \OT1/cmr/m/n/10
2b: \OT1/cmr/m/n/10
2c: \OT1/cmr/m/n/10
2d: \OT1/cmr/m/n/10
Issue 3: force should make no difference
3a: \OT1/cmr/m/n/10
LaTeX Font Info: Trying to load font information for OT1+lmr on input line ....
3b: \OT1/lmr/b/n/10
3c: \OT1/cmr/b/n/10
3c: \OT1/cmr/bx/n/10
3d: \OT1/cmr/m/n/10
3e: \OT1/lmr/b/n/10
3f: \OT1/cmr/bx/n/10
Expand Down
52 changes: 27 additions & 25 deletions base/testfiles/github-0479-often.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Applying: [....-..-..] Arbitrary units in \DeclareMathSizes on input line ...
.
Already applied: [....-..-..] Arbitrary units in \DeclareMathSizes on input li
ne 6932.
Skipping: [....-..-..] Force font face on input line ....
Applying: [....-..-..] Drop m in usefont on input line ....
LaTeX Info: Redefining \usefont on input line ....
Already applied: [....-..-..] Drop m in usefont on input line ....
Expand All @@ -244,7 +245,7 @@ Already applied: [....-..-..] Font substitution in preamble on input line ....
Applying: [....-..-..] XeTeX support for \showhyphens on input line ....
LaTeX Info: Redefining \showhyphens on input line ....
Already applied: [....-..-..] XeTeX support for \showhyphens on input line ...
5.
7.
Applying: [....-..-..] Series change rules on input line ....
Already applied: [....-..-..] Series change rules on input line ....
Skipping: [....-..-..] delay fontseries update on input line ....
Expand Down Expand Up @@ -306,6 +307,7 @@ Already applied: [....-..-..] Nested emph on input line ....
Applying: [....-..-..] XeTeX change for math on input line ....
LaTeX Info: Redefining \symbol on input line ....
Already applied: [....-..-..] XeTeX change for math 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 ....
Already applied: [....-..-..] Add hook to \normalfont on input line ....
Expand Down Expand Up @@ -358,17 +360,17 @@ Already applied: [....-..-..] Make commands robust on input line ....
Already applied: [....-..-..] Make commands robust on input line ....
Applying: [....-..-..] Disable hyphenation in verbatim on input line ....
Already applied: [....-..-..] Disable hyphenation in verbatim on input line ...
4.
7.
Applying: [....-..-..] Setup visible space for \verb on input line ....
LaTeX Info: Redefining \asciispace on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Already applied: [....-..-..] Setup visible space for \verb on input line ...
1.
4.
Applying: [....-..-..] Drop spaces before \verb delimiter on input line ....
Already applied: [....-..-..] Setup visible space for \verb on input line ...
5.
8.
Already applied: [....-..-..] Setup visible space for \verb on input line ...
1.
4.
Applying: [....-..-..] Disable hyphenation in verb on input line ....
Already applied: [....-..-..] Disable hyphenation in verb on input line ....
Applying: [....-..-..] Make commands robust on input line ....
Expand Down Expand Up @@ -460,16 +462,16 @@ Applying: [....-..-..] default units on input line ....
Already applied: [....-..-..] default units on input line ....
Applying: [....-..-..] Avoid almost zero length leaders on input line ....
Already applied: [....-..-..] Avoid almost zero length leaders on input line ...
769.
802.
Applying: [....-..-..] default units on input line ....
Already applied: [....-..-..] default units on input line ....
Already applied: [....-..-..] default units on input line ....
Applying: [....-..-..] Avoid almost zero length leaders on input line ....
Already applied: [....-..-..] Avoid almost zero length leaders on input line ...
868.
901.
Applying: [....-..-..] Avoid almost zero length leaders on input line ....
Already applied: [....-..-..] Avoid almost zero length leaders on input line ...
888.
921.
Applying: [....-..-..] default units on input line ....
Already applied: [....-..-..] default units on input line ....
Applying: [....-..-..] default units on input line ....
Expand All @@ -478,18 +480,18 @@ Applying: [....-..-..] default units on input line ....
Already applied: [....-..-..] default units on input line ....
Applying: [....-..-..] Make commands robust on input line ....
LaTeX Info: The control sequence `\bezier' is already robust on input line ...
4.
7.
LaTeX Info: The control sequence `\circle' is already robust on input line ...
5.
8.
LaTeX Info: The control sequence `\linethickness' is already robust on input li
ne 11058.
ne 11091.
LaTeX Info: The control sequence `\oval' is already robust on input line ....
LaTeX Info: The control sequence `\qbezier' is already robust on input line ...
62.
95.
LaTeX Info: The control sequence `\shortstack' is already robust on input line ...
11063.
11096.
LaTeX Info: The control sequence `\thinlines' is already robust on input line ...
1064.
1097.
Already applied: [....-..-..] Make commands robust on input line ....
Applying: [....-..-..] Make commands robust on input line ....
LaTeX Info: Redefining \title on input line ....
Expand Down Expand Up @@ -551,14 +553,14 @@ Applying: [....-..-..] Spaces in option clash check on input line ....
Already applied: [....-..-..] Spaces in option clash check on input line ....
Applying: [....-..-..] Check name with \strcmp on input line ....
Already applied: [....-..-..] Undo: check name with \strcmp on input line ...
9.
2.
Applying: [....-..-..] Allow for package substitution on input line ....
Already applied: [....-..-..] Protection for package info on input line ....
Already applied: [....-..-..] Protection for package info on input line ....
Applying: [....-..-..] Track \ProvidesPackage on input line ....
Skipping: [....-..-..] Raw option lists on input line ....
Applying: [....-..-..] Add file replacement in \@pass@ptions on input line ...
17.
50.
Already applied: [....-..-..] \@pass@ptions on input line ....
Skipping: [....-..-..] filter unused option list on input line ....
Applying: [....-..-..] filter unused option list on input line ....
Expand All @@ -574,22 +576,22 @@ Applying: [....-..-..] Unused options issue on input line ....
Already applied: [....-..-..] Unused options issue on input line ....
Applying: [....-..-..] ifx tests in \@fileswith@pti@ns on input line ....
Already applied: [....-..-..] ifx tests in \@fileswith@pti@ns on input line ...
004.
037.
Already applied: [....-..-..] ifx tests in \@fileswith@pti@ns on input line ...
031.
064.
Applying: [....-..-..] Hooks and unused options issue on input line ....
Already applied: [....-..-..] Hooks and unused options issue on input line ...
2.
5.
Applying: [....-..-..] Use hook system on input line ....
LaTeX Info: Redefining \AtBeginDocument on input line ....
LaTeX Info: Redefining \AtEndDocument on input line ....
Already applied: [....-..-..] Use hook system on input line ....
Applying: [....-..-..] Define \q@curr@file directly (gh/220) on input line ...
1.
4.
Already applied: [....-..-..] Spaces in file names + optional arg on input line
12380.
12413.
Already applied: [....-..-..] Spaces in file names + optional arg on input line
12511.
12544.
Applying: [....-..-..] Hook management file on input line ....
Already applied: [....-..-..] Hook management file on input line ....
Applying: [....-..-..] File helpers on input line ....
Expand Down Expand Up @@ -661,7 +663,7 @@ Applying: [....-..-..] float order in 2-column on input line ....
Already applied: [....-..-..] float order in 2-column on input line ....
Applying: [....-..-..] Reset language for hyphenation on input line ....
Already applied: [....-..-..] Reset language for hyphenation on input line ...
3.
6.
Applying: [....-..-..] float order in 2-column on input line ....
Already applied: [....-..-..] float order in 2-column on input line ....
Applying: [....-..-..] float order in 2-column on input line ....
Expand All @@ -686,9 +688,9 @@ Applying: [....-..-..] Extended Allocation on input line ....
Already applied: [....-..-..] Extended Allocation on input line ....
Applying: [....-..-..] Start of XeTeX class allocator on input line ....
Already applied: [....-..-..] Start of XeTeX class allocator on input line ...
8.
1.
Already applied: [....-..-..] Start of XeTeX class allocator on input line ...
5.
8.
Removing `tracingstacklevels' from `input_level_string'.
Skipping: [....-..-..] Lua trace_stack_levels function on input line ....
Applying: [....-..-..] Lua trace_stack_levels function on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/github-0479-often.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Applying: [....-..-..] Maybe drop one m on input line ....
Already applied: [....-..-..] Maybe drop one m on input line ....
Applying: [....-..-..] Arbitrary units in \DeclareMathSizes on input line ....
Already applied: [....-..-..] Arbitrary units in \DeclareMathSizes on input line ....
Skipping: [....-..-..] Force font face on input line ....
Applying: [....-..-..] Drop m in usefont on input line ....
LaTeX Info: Redefining \usefont on input line ....
Already applied: [....-..-..] Drop m in usefont on input line ....
Expand Down Expand Up @@ -260,6 +261,7 @@ Already applied: [....-..-..] Nested emph on input line ....
Applying: [....-..-..] XeTeX change for math on input line ....
LaTeX Info: Redefining \symbol on input line ....
Already applied: [....-..-..] XeTeX change for math 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 ....
Already applied: [....-..-..] Add hook to \normalfont on input line ....
Expand Down
Loading

0 comments on commit 89d8fde

Please sign in to comment.