[latex3-commits] [git/LaTeX3-latex3-latex2e] gh199: fix for #199 (a40695e7)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Nov 22 00:48:26 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : gh199
Link       : https://github.com/latex3/latex2e/commit/a40695e721dfbbd7b9b30669411590d67daab6ce

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

commit a40695e721dfbbd7b9b30669411590d67daab6ce
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Nov 22 00:48:26 2019 +0100

    fix for #199


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

a40695e721dfbbd7b9b30669411590d67daab6ce
 base/changes.txt                                   |  5 ++++
 base/doc/ltnews31.tex                              |  2 ++
 base/ltoutenc.dtx                                  | 19 +++++++++++--
 base/testfiles/github-0199.luatex.tlg              | 10 +++++++
 base/testfiles/github-0199.lvt                     | 33 ++++++++++++++++++++++
 base/testfiles/github-0199.tlg                     | 13 +++++++++
 base/testfiles/github-0199.xetex.tlg               | 10 +++++++
 base/testfiles/{tlb2054.tlg => tlb2054.luatex.tlg} |  3 +-
 base/testfiles/tlb2054.tlg                         |  3 +-
 9 files changed, 91 insertions(+), 7 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index ea882e93..6efed2a4 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2019-11-22  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltoutenc.dtx (subsection{The fontenc package}):
+	Avoid spurious if fontenc selects LY1 as default encoding (gh/199)
+
 2019-11-14  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* utf8ienc.dtx (subsection{The mapping table}):
diff --git a/base/doc/ltnews31.tex b/base/doc/ltnews31.tex
index c9ba5242..2b1eca22 100644
--- a/base/doc/ltnews31.tex
+++ b/base/doc/ltnews31.tex
@@ -225,6 +225,8 @@ entirely, but to support older formats, this is still recommended at present.
 
 \emph{fixed gh198}
 
+\emph{fixed gh199}
+
 \emph{fixed gh203}
 
 
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index b16af5c8..39e28895 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -38,14 +38,14 @@
 %<TU>\ProvidesFile{tuenc.def}
 %<package>\ProvidesPackage{fontenc}
 %<TS1sty>\ProvidesPackage{textcomp}
-%<OT1|T1|OMS|OML|OT4|TU|package|TS1sty> [2018/08/11 v2.0j
+%<OT1|T1|OMS|OML|OT4|TU|package|TS1sty> [2019/11/22 v2.0l
 %<OT1|T1|OMS|OML|OT4|TS1|TU>         Standard LaTeX file]
 %<package|TS1sty>                 Standard LaTeX package]
 %
 %<*driver>
 % \fi
 \ProvidesFile{ltoutenc.dtx}
-             [2018/11/18 v2.0k LaTeX Kernel (font encodings)]
+             [2019/11/22 v2.0l LaTeX Kernel (font encodings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltoutenc.dtx}
@@ -3508,8 +3508,21 @@
 \ProcessOptions*
 %    \end{macrocode}
 %
+%    We select the new font encoding default (i.e., the last encoding
+%    specified in the option list. But this encoding may not work with
+%    the current |\f at shape|, e.g., \texttt{LY1} is not defined for
+%    \texttt{cmr} and therefore packages switching to \texttt{LY1}
+%    usually also change \cs{rmdefault}. But that only applies at
+%    |\begin{document}| so we get a spurious warning if we use what
+%    \LaTeX{} previously used:
+% \changes{v2.0l}{2019/11/22}{Avoid spurious if fontenc selects LY1 as
+%    default encoding (gh/199)}
 %    \begin{macrocode}
-\fontencoding\encodingdefault\selectfont
+%\fontencoding\encodingdefault\selectfont
+%    \end{macrocode}
+%    So instead we do this here:
+%    \begin{macrocode}
+\usefont\encodingdefault\familydefault\seriesdefault\shapedefault
 %    \end{macrocode}
 %
 % To save some space we get rid of the macro extending the
diff --git a/base/testfiles/github-0199.luatex.tlg b/base/testfiles/github-0199.luatex.tlg
new file mode 100644
index 00000000..617cbda7
--- /dev/null
+++ b/base/testfiles/github-0199.luatex.tlg
@@ -0,0 +1,10 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(fontenc.sty
+Package: fontenc ....-..-.. v... Standard LaTeX package
+(ly1xenc.def)
+LaTeX Font Info:    Trying to load font information for LY1X+lmr on input line ....
+(ly1xlmr.fd))
+> \LY1X/lmr/m/n/10 .
+<recently read> \font 
+l. ...\showthe\font
diff --git a/base/testfiles/github-0199.lvt b/base/testfiles/github-0199.lvt
new file mode 100644
index 00000000..496eb418
--- /dev/null
+++ b/base/testfiles/github-0199.lvt
@@ -0,0 +1,33 @@
+% this is currently not testing LY1 as that is not part of the test suite
+% so even with the fakes below it will complain about missing ly1enc.def
+
+\documentclass{article}
+
+\input{test2e}
+
+% fake ly1enc.def to make sure we don't mess up any other test we make it ly1x
+
+\begin{filecontents}{ly1xenc.def}
+\DeclareFontEncoding{LY1X}{}{}
+
+\DeclareFontSubstitution{LY1X}{ptm}{m}{n}	% argh!
+\end{filecontents}
+
+% fake lylmr.fd as well
+
+\begin{filecontents}{ly1xlmr.fd}
+\DeclareFontFamily{LY1X}{lmr}{}
+\DeclareFontShape{LY1X}{lmr}{m}{n}{ <-> cmr10 }{}  % somehow
+\end{filecontents}
+
+
+\START
+
+\renewcommand\rmdefault{lmr}
+
+\usepackage[LY1X]{fontenc}
+
+\showthe\font
+
+ 
+\END
diff --git a/base/testfiles/github-0199.tlg b/base/testfiles/github-0199.tlg
new file mode 100644
index 00000000..8d2e80cd
--- /dev/null
+++ b/base/testfiles/github-0199.tlg
@@ -0,0 +1,13 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(fontenc.sty
+Package: fontenc ....-..-.. v... Standard LaTeX package
+(ly1xenc.def
+Now handling font encoding LY1X ...
+... no UTF-8 mapping file for font encoding LY1X
+)
+LaTeX Font Info:    Trying to load font information for LY1X+lmr on input line ....
+(ly1xlmr.fd))
+> \LY1X/lmr/m/n/10 .
+<recently read> \font 
+l. ...\showthe\font
diff --git a/base/testfiles/github-0199.xetex.tlg b/base/testfiles/github-0199.xetex.tlg
new file mode 100644
index 00000000..617cbda7
--- /dev/null
+++ b/base/testfiles/github-0199.xetex.tlg
@@ -0,0 +1,10 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(fontenc.sty
+Package: fontenc ....-..-.. v... Standard LaTeX package
+(ly1xenc.def)
+LaTeX Font Info:    Trying to load font information for LY1X+lmr on input line ....
+(ly1xlmr.fd))
+> \LY1X/lmr/m/n/10 .
+<recently read> \font 
+l. ...\showthe\font
diff --git a/base/testfiles/tlb2054.tlg b/base/testfiles/tlb2054.luatex.tlg
similarity index 92%
copy from base/testfiles/tlb2054.tlg
copy to base/testfiles/tlb2054.luatex.tlg
index b864f9e1..9e5a9a16 100644
--- a/base/testfiles/tlb2054.tlg
+++ b/base/testfiles/tlb2054.luatex.tlg
@@ -17,8 +17,7 @@ Thus calling the encoding later on will produce further error messages.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
-l. ...\fontencoding\encodingdefault
-                                   \selectfont
+l. ......lt\familydefault\seriesdefault\shapedefault
 Your command was ignored.
 Type  I <command> <return>  to replace it with another command,
 or  <return>  to continue without it.
diff --git a/base/testfiles/tlb2054.tlg b/base/testfiles/tlb2054.tlg
index b864f9e1..39fe622a 100644
--- a/base/testfiles/tlb2054.tlg
+++ b/base/testfiles/tlb2054.tlg
@@ -17,8 +17,7 @@ Thus calling the encoding later on will produce further error messages.
 See the LaTeX manual or LaTeX Companion for explanation.
 Type  H <return>  for immediate help.
  ...                                              
-l. ...\fontencoding\encodingdefault
-                                   \selectfont
+l. ......\familydefault\seriesdefault\shapedefault
 Your command was ignored.
 Type  I <command> <return>  to replace it with another command,
 or  <return>  to continue without it.





More information about the latex3-commits mailing list