[latex3-commits] [latex3/latex2e] hotfix-declareencodingsubset: hotfix to allow \DeclareEncodingsubset in .fd files (b77acfe8b)

github at latex-project.org github at latex-project.org
Wed Nov 20 16:18:15 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : hotfix-declareencodingsubset
Link       : https://github.com/latex3/latex2e/commit/b77acfe8bc4e8218034a439358565b9cb0aad39a

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

commit b77acfe8bc4e8218034a439358565b9cb0aad39a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Nov 20 16:18:15 2024 +0100

    hotfix to allow \DeclareEncodingsubset in .fd files


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

b77acfe8bc4e8218034a439358565b9cb0aad39a
 base/changes.txt                               |  22 ++++
 base/cmfonts.fdd                               |  21 +++-
 base/fontdef.dtx                               |  48 +++++---
 base/ltfssaxes.dtx                             |   9 +-
 base/ltfssbas.dtx                              | 137 ++++++++++++++++++++-
 base/ltfssdcl.dtx                              |   8 +-
 base/ltfssini.dtx                              |   3 +-
 base/ltfsstrc.dtx                              |   3 +-
 base/lttextcomp.dtx                            | 158 ++++---------------------
 base/testfiles-legacy/github-1333-rollback.tlg |   2 +-
 base/testfiles-legacy/tlb-textcomp-006.tlg     |   2 -
 base/testfiles/github-1336.tlg                 |   2 +-
 12 files changed, 252 insertions(+), 163 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 6321cf6fd..a4edef9e6 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,28 @@ not part of the distribution.
 All changes above are only part of the development branch for the next release.
 ================================================================================
 
+#########################
+# 2024-11-01 PL1 Release
+#########################
+
+2024-11-19  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* lttextcomp.dtx:
+	Allow using \DeclareEncodingSubset in the document body so that it
+	can be placed into .fd file (gh/1518)
+
+	* cmfonts.fdd:
+	Add \DeclareEncodingSubset declarations in the .fd files for
+	ts1cmr, ts1cmss, ts1cmtt, and ts1cmvtt  (gh/1518)
+
+	* ltfssbas.dtx:
+	Moved \DeclareEncodingSubset and \CheckEncodingSubset from
+	lttextcomp.dtx into this file
+
+	* fontdef.dtx:
+	Preload ts1cmr.fd, ts1cmss.fd, and ts1cmtt in the kernel
+	Drop unnessary \DeclareFontSubstitution declarations
+
 #########################
 # 2024-11-01 Release
 #########################
diff --git a/base/cmfonts.fdd b/base/cmfonts.fdd
index 556db5be8..ed6f3d70e 100644
--- a/base/cmfonts.fdd
+++ b/base/cmfonts.fdd
@@ -67,7 +67,7 @@
 %<*driver,  >
              \ProvidesFile{cmfonts.drv}
 %</driver,  >
-        [2023/04/13 v2.5m Standard LaTeX font definitions]
+        [2024/11/19 v2.5n Standard LaTeX font definitions]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -751,6 +751,11 @@
 \EC at family{TS1}{cmr}{bx}{sl}{tcbl}
 %<!ec>\EC at family{TS1}{cmr}{m}{ui}{tcu}
 %<ec>\EC at family{TS1}{cmr}{m}{ui}{tcui}
+%    \end{macrocode}
+%    
+% \changes{v2.5n}{2024/11/19}{Add \cs{DeclareEncodingSubset} declaration}
+%    \begin{macrocode}
+\DeclareEncodingSubset{TS1}{cmr}{0}
 %</TS1cmr>
 %<*TS1cmss>
 \DeclareFontFamily{TS1}{cmss}{\hyphenchar\font\m at ne}
@@ -760,12 +765,22 @@
 \EC at family{TS1}{cmss}{bx}{n}{tcsx}
 \EC at family{TS1}{cmss}{bx}{it}{tcso}
 \EC at family{TS1}{cmss}{bx}{sl}{tcso}
+%    \end{macrocode}
+%    
+% \changes{v2.5n}{2024/11/19}{Add \cs{DeclareEncodingSubset} declaration}
+%    \begin{macrocode}
+\DeclareEncodingSubset{TS1}{cmss}{0}
 %</TS1cmss>
 %<*TS1cmtt>
 \DeclareFontFamily{TS1}{cmtt}{\hyphenchar\font\m at ne}
 \EC at ttfamily{TS1}{cmtt}{m}{n}{tctt}
 \EC at ttfamily{TS1}{cmtt}{m}{sl}{tcst}
 \EC at ttfamily{TS1}{cmtt}{m}{it}{tcit}
+%    \end{macrocode}
+%    
+% \changes{v2.5n}{2024/11/19}{Add \cs{DeclareEncodingSubset} declaration}
+%    \begin{macrocode}
+\DeclareEncodingSubset{TS1}{cmtt}{0}
 %</TS1cmtt>
 %    \end{macrocode}
 %    Again the italic shape is only available with release 1.3.
@@ -774,6 +789,10 @@
 \DeclareFontFamily{TS1}{cmvtt}{}
 \EC at ttfamily{TS1}{cmvtt}{m}{n}{tcvt}
 \EC at ttfamily{TS1}{cmvtt}{m}{it}{tcvi}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\DeclareEncodingSubset{TS1}{cmvtt}{0}
 %</TS1cmvtt>
 %    \end{macrocode}
 %
diff --git a/base/fontdef.dtx b/base/fontdef.dtx
index ae11766ca..ad66ed411 100644
--- a/base/fontdef.dtx
+++ b/base/fontdef.dtx
@@ -40,7 +40,7 @@
 %<driver, >\ProvidesFile{fontdef.drv}
 % \fi
 % \ProvidesFile{fontdef.dtx}
-           [2024/09/03 v3.0k LaTeX Kernel
+           [2024/11/19 v3.0l LaTeX Kernel
 % \iffalse
 %<text,   >   (Text font setup)
 %<math,   >   (Math font setup)
@@ -260,7 +260,7 @@
 \input {omsenc.def}
 %    \end{macrocode}
 %    Documents containing a lot of accented characters should really
-%    be using T1 fonts. We therefore load this last so that T1 encoding
+%    be using T1 fonts. We therefore load this after OT1 so that T1 encoding
 %    specific commands are executed as fast as possible (encoding
 %    files are no longer reloaded in \texttt{fontenc}.
 % \changes{v3.0f}{2020/01/25}{Load t1enc.def last (gh/255)}
@@ -270,7 +270,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\input{ts1enc.def}
+\input {ts1enc.def}
 %    \end{macrocode}
 %    
 %
@@ -349,7 +349,15 @@
 \DeclareFontEncodingDefaults{}{}
 %    \end{macrocode}
 %
-%    Then we define the default substitution for every encoding.
+%    The default font substitution for an encoding is defined in the
+%    corresponding  \texttt{...enc.def} file so for \texttt{OT1},
+%    \texttt{T1}, and \texttt{TS1} this is already defined.
+%    \begin{macrocode}
+%\DeclareFontSubstitution{T1}{cmr}{m}{n}
+%\DeclareFontSubstitution{OT1}{cmr}{m}{n}
+%\DeclareFontSubstitution{TS1}{cmr}{m}{n}
+%    \end{macrocode}
+%
 %    This release of \LaTeXe{} assumes that the ec fonts are
 %    available. It is possible to change this to point to some other
 %    font family (e.g., Times with the appropriate encoding if it is
@@ -358,10 +366,6 @@
 %    sites. The substitution defaults can all be changed without
 %    losing portability as long as there are font shape definitions
 %    for the selected substitutions.
-%    \begin{macrocode}
-\DeclareFontSubstitution{T1}{cmr}{m}{n}
-\DeclareFontSubstitution{OT1}{cmr}{m}{n}
-%    \end{macrocode}
 %
 %    For every encoding declaration, \LaTeXe{} will try to verify that
 %    the given substitution information makes sense, i.e.~that it is
@@ -391,6 +395,12 @@
 \nfss at catcodes
 \input  {t1cmr.fd}
 \input  {ot1cmr.fd}
+%    \end{macrocode}
+%
+% \changes{v3.0l}{2024/11/19}{Preload the TS1 \texttt{ts1cmr.fd} file
+%    in all engines}
+%    \begin{macrocode}
+\input  {ts1cmr.fd}
 \endgroup
 %    \end{macrocode}
 %
@@ -411,19 +421,29 @@
 \input {t1cmtt.fd}
 \input {ot1cmss.fd}
 \input {ot1cmtt.fd}
+%    \end{macrocode}
+%
+% \changes{v3.0l}{2024/11/19}{Preload the TS1 \texttt{.fd} file}
+%    \begin{macrocode}
+\input {ts1cmss.fd}
+\input {ts1cmtt.fd}
 \endgroup
 %    \end{macrocode}
 %
 % \changes{v3.0j}{2024/06/24}{load ts1 cmr fd file in Unicode engines}
 % Even though Unicode engines default to |lm| load |ts1cmr| 
 % as this may be used for fallback for TS1 encoding.
+%
+%    We now load it in all engines above, so the next lines are no longer
+%    necessary. We keep them here if we stop loading other fd files in
+%    Unicode engines.
 %    \begin{macrocode}
-\ifx\Umathcode\@undefined\else
-\begingroup
-\nfss at catcodes
-\input {ts1cmr.fd}
-\endgroup
-\fi
+%\ifx\Umathcode\@undefined\else
+%\begingroup
+%\nfss at catcodes
+%\input {ts1cmr.fd}
+%\endgroup
+%\fi
 %    \end{macrocode}
 %
 %    Even with all the precautions it is still possible that NFSS will
diff --git a/base/ltfssaxes.dtx b/base/ltfssaxes.dtx
index 8b5014a4c..867847228 100644
--- a/base/ltfssaxes.dtx
+++ b/base/ltfssaxes.dtx
@@ -35,7 +35,7 @@
 %
 %
 \ProvidesFile{ltfssaxes.dtx}
-             [2024/02/08 v1.0i LaTeX Kernel (NFSS Axes handing)]
+             [2024/11/19 v1.0j LaTeX Kernel (NFSS Axes handing)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -70,10 +70,17 @@
 %
 % \changes{v1.0h}{2020/12/04}{Reorganized the rollback data}
 %
+%    \begin{macrocode}
+%<2ekernel>\message{NFSS axes,}
+%    \end{macrocode}
+%    
 % Everything in the this file got introduced 2020/02/02, so we use large rollback
 % chunks, only interrupted if necessary.
 %    \begin{macrocode}
 %<*2ekernel|latexrelease>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2020/02/02}%
 %<latexrelease>   {\DeclareFontSeriesChangeRule}{Series change rules}%
 %    \end{macrocode}
diff --git a/base/ltfssbas.dtx b/base/ltfssbas.dtx
index 387214e94..ba0040abd 100644
--- a/base/ltfssbas.dtx
+++ b/base/ltfssbas.dtx
@@ -35,7 +35,7 @@
 %
 %
 \ProvidesFile{ltfssbas.dtx}
-             [2024/06/17 v3.2m LaTeX Kernel (NFSS Basic Macros)]
+             [2024/11/19 v3.2n LaTeX Kernel (NFSS Basic Macros)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -157,12 +157,16 @@
 % We define a number
 % of macros that will be used later.
 %
+%    \begin{macrocode}
+%<*2ekernel>
+\message{NFSS base,}
+%    \end{macrocode}
+%
 %
 % \begin{macro}{\@nomath}
 %    |\@nomath| is used by most macros that will have no effect
 %    in math mode. It issues a warning message.
 %    \begin{macrocode}
-%<*2ekernel>
 \def\@nomath#1{\relax\ifmmode
    \@font at warning{Command \noexpand#1invalid in math mode}\fi}
 %    \end{macrocode}
@@ -593,6 +597,135 @@
 % \end{macro}
 %
 %
+%
+%
+%  \begin{macro}{\DeclareEncodingSubset}
+%
+%    The declaration takes 3 mandatory arguments: an \emph{encoding}
+%    for which a subsetting is wanted (currently always \texttt{TS1},
+%    and most likely forever), the \emph{font family} for which we
+%    declare the subset and finally the \emph{subset} number, with a value between
+%    \texttt{0} (all of the encoding is supported) and \texttt{9} (many
+%    glyphs are missing).
+%
+%    For \texttt{TS1} the numbers have been chosen in a way that most
+%    fonts can be fairly correctly categorized, but the default
+%    settings are always conservative, that is they may claim that
+%    less glyphs are supported than there actually are.
+%
+%    As these days many font families are set up to end in \texttt{-LF}
+%    (lining figures), \texttt{-OsF} (oldstyle figures), etc.\ the
+%    declaration supports a shortcut: if the \emph{font family} name
+%    ends in \texttt{-*} then the star gets replaced by these common
+%    ending, e.g.,
+%\begin{verbatim}
+% \DeclareEncodingSubset{TS1}{Alegreya-*}{2}
+%\end{verbatim}
+%    is the same as writing
+%\begin{verbatim}
+% \DeclareEncodingSubset{TS1}{Alegreya-LF}{2}
+% \DeclareEncodingSubset{TS1}{Alegreya-OsF}{2}
+% \DeclareEncodingSubset{TS1}{Alegreya-TLF}{2}
+% \DeclareEncodingSubset{TS1}{Alegreya-TOsF}{2}
+%\end{verbatim}
+%    If only some are needed then one can define them individually but
+%    in many cases all four are wanted, hence the shortcut.
+%
+%
+%    The coding of the declaration has no error checking as it is
+%    mostly for internal use.
+%    \begin{macrocode}
+\def\DeclareEncodingSubset#1#2{%
+  \DeclareEncodingSubset at aux{#1}#2*\DeclareEncodingSubset at aux
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\DeclareEncodingSubset at aux#1#2*#3\DeclareEncodingSubset at aux#4{%
+%    \end{macrocode}
+%    if \verb=#3= is empty then there was no star, otherwise we
+%    define all four variants.
+%    \begin{macrocode}
+  \expandafter\ifx\expandafter X\detokenize{#3}X%
+    \@DeclareEncodingSubset{#1}{#2}{#4}%
+  \else
+    \@DeclareEncodingSubset{#1}{#2LF}{#4}%
+    \@DeclareEncodingSubset{#1}{#2TLF}{#4}%
+    \@DeclareEncodingSubset{#1}{#2OsF}{#4}%
+    \@DeclareEncodingSubset{#1}{#2TOsF}{#4}%
+  \fi
+}
+%    \end{macrocode}
+%
+%    The subset info is stored in a command with the name
+%    \texttt{\bslash}\emph{family}\texttt{:}\emph{subset} so if that
+%    already exists we change otherwise declare a subset.
+%    \begin{macrocode}
+\def\@DeclareEncodingSubset#1#2#3{%
+   \@ifundefined{#1:#2}%
+     {\@font at info{Setting #2 sub-encoding to #1/#3}}%
+     {\@font at info{Changing #2 sub-encoding to #1/#3}}%
+%    \end{macrocode}
+%    This declaration should be usable in \texttt{.fd} files and
+%    therefore has to make its definition globally, because such files
+%    can get loaded in random places.
+% \changes{v1.0g}{2022/08/07}{Make  global declaration (gh/905)}
+%    \begin{macrocode}
+     \global\@namedef{#1:#2}{#3}}
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
+%
+% \begin{macro}{\CheckEncodingSubset}
+%    The command |\CheckEncodingSubset| will check if the current font
+%    family has the right encoding subset to typeset a certain
+%    command. It takes five arguments as follows:
+%    first argument is either |\UseTextSymbol|, |\UseTextAccent|
+%    depending on whether or not the symbol is a text symbol or a text
+%    accent.
+
+%    The second argument is the encoding from which this symbol should
+%    be fetched.
+%
+%    The third argument is either a fake accessor command or an error
+%    message. the code in that argument (if ever executed) receives
+%    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
+%
+%    Argument four is the subset encoding id to test against: if this
+%    value is higher than the subset id of the current font family
+%    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
+%    it runs |#3#5|, e.g., to produce an error message or fake the
+%    glyph somehow.
+%
+%    Argument five is the symbol or accent command that is being
+%    checked.
+%
+%    For usage examples see definitions in \texttt{lttextcomp.dtx}.
+%
+%    \begin{macrocode}
+\def\CheckEncodingSubset#1#2#3#4#5{%
+    \ifnum #4>%
+      \expandafter\ifx\csname #2:\f at family\endcsname\relax
+        0\csname #2:?\endcsname
+      \else
+        \csname #2:\f at family\endcsname
+      \fi
+   \relax
+   \expandafter\@firstoftwo
+  \else
+   \expandafter\@secondoftwo
+ \fi
+  {#1{#2}}{#3}%
+  #5%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
 % \begin{macro}{\DeclarePreloadSizes}
 %    \begin{macrocode}
 \def\DeclarePreloadSizes#1#2#3#4#5{%
diff --git a/base/ltfssdcl.dtx b/base/ltfssdcl.dtx
index 32f9eedf1..c88fe6e1b 100644
--- a/base/ltfssdcl.dtx
+++ b/base/ltfssdcl.dtx
@@ -36,7 +36,7 @@
 %
 %
 \ProvidesFile{ltfssdcl.dtx}
-            [2022/09/20 v3.1b LaTeX Kernel (NFSS Declarative Interface)]
+            [2024/11/19 v3.1c LaTeX Kernel (NFSS Declarative Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -110,6 +110,11 @@
 %                             \cs{@DeclareMathDelimiter}}
 % \changes{v2.1c}{1994/03/13}{add 2ekernel module to omit repeated code}
 %
+%    \begin{macrocode}
+%<*2ekernel>
+\message{NFSS declarative interface,}
+%    \end{macrocode}
+%    
 %
 % \begin{macro}{\in@}
 % \changes{v3.0m}{2009/10/20}{More robust thanks to Heiko.}
@@ -121,7 +126,6 @@
 %    contain braces nor |#| (more precisely, tokens of category
 %    code 1,~2, or~6).
 %    \begin{macrocode}
-%<*2ekernel>
 \def\in@#1#2%
  {%
    \begingroup
diff --git a/base/ltfssini.dtx b/base/ltfssini.dtx
index 6b0ba9181..79e854691 100644
--- a/base/ltfssini.dtx
+++ b/base/ltfssini.dtx
@@ -36,7 +36,7 @@
 %
 %
 \ProvidesFile{ltfssini.dtx}
-             [2024/08/28 v3.2i LaTeX Kernel (NFSS Initialisation)]
+             [2024/11/19 v3.2j LaTeX Kernel (NFSS Initialisation)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -142,6 +142,7 @@
 %
 %    \begin{macrocode}
 %<*2ekernel>
+\message{NFSS initialization,}
 %    \end{macrocode}
 %
 % \subsection{Providing math \emph{versions}}
diff --git a/base/ltfsstrc.dtx b/base/ltfsstrc.dtx
index 4f0e43021..de9518f4e 100644
--- a/base/ltfsstrc.dtx
+++ b/base/ltfsstrc.dtx
@@ -37,7 +37,7 @@
 %<package>     [2020/12/22 v3.0n  Standard LaTeX package (font tracing)]
 % \fi
 % \ProvidesFile{ltfsstrc.dtx}
-%              [2024/02/08 v3.0o LaTeX Kernel (NFSS tracing)]
+%              [2024/11/19 v3.0p LaTeX Kernel (NFSS tracing)]
 %
 % \iffalse
 %<+checkmem>\CHECKMEM
@@ -212,6 +212,7 @@
 %      {Check if \cs{tracingfonts} defined removed again.}
 %    \begin{macrocode}
 %<*2ekernel>
+\message{NFSS tracing,}
 \def\tracingfonts{%
   \@font at warning{Command \noexpand\tracingfonts
            not provided.\MessageBreak
diff --git a/base/lttextcomp.dtx b/base/lttextcomp.dtx
index 1ee4a18b7..64c89fe95 100644
--- a/base/lttextcomp.dtx
+++ b/base/lttextcomp.dtx
@@ -37,7 +37,7 @@
 %
 %
 \ProvidesFile{lttextcomp.dtx}
-             [2024/04/24 v1.1c LaTeX Kernel (text companion symbols)]
+             [2024/11/19 v1.1d LaTeX Kernel (text companion symbols)]
 % \iffalse
 \documentclass{ltxdoc}
 \begin{document}
@@ -161,139 +161,9 @@
 %    \end{macrocode}
 % \end{macro}
 %
-%  \begin{macro}{\DeclareEncodingSubset}
-%
-%    The declaration takes 3 mandatory arguments: an \emph{encoding}
-%    for which a subsetting is wanted (currently always \texttt{TS1},
-%    and most likely forever), the \emph{font family} for which we
-%    declare the subset and finally the \emph{subset} number, with a value between
-%    \texttt{0} (all of the encoding is supported) and \texttt{9} (many
-%    glyphs are missing).
-%
-%    For \texttt{TS1} the numbers have been chosen in a way that most
-%    fonts can be fairly correctly categorized, but the default
-%    settings are always conservative, that is they may claim that
-%    less glyphs are supported than there actually are.
-%
-%    As these days many font families are set up to end in \texttt{-LF}
-%    (lining figures), \texttt{-OsF} (oldstyle figures), etc.\ the
-%    declaration supports a shortcut: if the \emph{font family} name
-%    ends in \texttt{-*} then the star gets replaced by these common
-%    ending, e.g.,
-%\begin{verbatim}
-% \DeclareEncodingSubset{TS1}{Alegreya-*}{2}
-%\end{verbatim}
-%    is the same as writing
-%\begin{verbatim}
-% \DeclareEncodingSubset{TS1}{Alegreya-LF}{2}
-% \DeclareEncodingSubset{TS1}{Alegreya-OsF}{2}
-% \DeclareEncodingSubset{TS1}{Alegreya-TLF}{2}
-% \DeclareEncodingSubset{TS1}{Alegreya-TOsF}{2}
-%\end{verbatim}
-%    If only some are needed then one can define them individually but
-%    in many cases all four are wanted, hence the shortcut.
-%
-%
-%    The coding of the declaration has no error checking as it is
-%    mostly for internal use.
-%    \begin{macrocode}
-\def\DeclareEncodingSubset#1#2{%
-  \DeclareEncodingSubset at aux{#1}#2*\DeclareEncodingSubset at aux
-}
-%    \end{macrocode}
-%
-%    \begin{macrocode}
-\def\DeclareEncodingSubset at aux#1#2*#3\DeclareEncodingSubset at aux#4{%
-%    \end{macrocode}
-%    if \verb=#3= is empty then there was no star, otherwise we
-%    define all four variants.
-%    \begin{macrocode}
-  \expandafter\ifx\expandafter X\detokenize{#3}X%
-    \@DeclareEncodingSubset{#1}{#2}{#4}%
-  \else
-    \@DeclareEncodingSubset{#1}{#2LF}{#4}%
-    \@DeclareEncodingSubset{#1}{#2TLF}{#4}%
-    \@DeclareEncodingSubset{#1}{#2OsF}{#4}%
-    \@DeclareEncodingSubset{#1}{#2TOsF}{#4}%
-  \fi
-}
-%    \end{macrocode}
-%
-%    The subset info is stored in a command with the name
-%    \texttt{\bslash}\emph{family}\texttt{:}\emph{subset} so if that
-%    already exists we change otherwise declare a subset.
-%    \begin{macrocode}
-\def\@DeclareEncodingSubset#1#2#3{%
-   \@ifundefined{#1:#2}%
-     {\@font at info{Setting #2 sub-encoding to #1/#3}}%
-     {\@font at info{Changing #2 sub-encoding to #1/#3}}%
-%    \end{macrocode}
-%    This declaration should be usable in \texttt{.fd} files and
-%    therefore has to make its definition globally, because such files
-%    can get loaded in random places.
-% \changes{v1.0g}{2022/08/07}{Make  global declaration (gh/905)}
-%    \begin{macrocode}
-     \global\@namedef{#1:#2}{#3}}
-%    \end{macrocode}
-%
-%    Any reason to allow those in the middle of documents?
-%    \begin{macrocode}
-\@onlypreamble\DeclareEncodingSubset
-\@onlypreamble\DeclareEncodingSubset at aux
-\@onlypreamble\@DeclareEncodingSubset
-%    \end{macrocode}
-%  \end{macro}
-
-
-% \begin{macro}{\CheckEncodingSubset}
-%    The command |\CheckEncodingSubset| will check if the current font
-%    family has the right encoding subset to typeset a certain
-%    command. It takes five arguments as follows:
-%    first argument is either |\UseTextSymbol|, |\UseTextAccent|
-%    depending on whether or not the symbol is a text symbol or a text
-%    accent.
-
-%    The second argument is the encoding from which this symbol should
-%    be fetched.
-%
-%    The third argument is either a fake accessor command or an error
-%    message. the code in that argument (if ever executed) receives
-%    two arguments: |#2| and |#5| of |\CheckEncodingSubset|.
 %
-%    Argument four is the subset encoding id to test against: if this
-%    value is higher than the subset id of the current font family
-%    then we typeset the symbol, i.e., execute |#1{#2}#5| otherwise
-%    it runs |#3#5|, e.g., to produce an error message or fake the
-%    glyph somehow.
 %
-%    Argument five is the symbol or accent command that is being
-%    checked.
-%
-%    For usage examples see definitions below.
 %
-%    \begin{macrocode}
-\def\CheckEncodingSubset#1#2#3#4#5{%
-    \ifnum #4>%
-      \expandafter\ifx\csname #2:\f at family\endcsname\relax
-        0\csname #2:?\endcsname
-      \else
-        \csname #2:\f at family\endcsname
-      \fi
-   \relax
-   \expandafter\@firstoftwo
-  \else
-   \expandafter\@secondoftwo
- \fi
-  {#1{#2}}{#3}%
-  #5%
-}
-%    \end{macrocode}
-% \end{macro}
-
-
-
-
-
 % To set up the glyphs for the subsets we need a number helpers.
 %
 %  \begin{macro}{\tc at errorwarn}
@@ -956,11 +826,20 @@
 %    \begin{macrocode}
 \DeclareEncodingSubset{TS1}{ccr}     {0}
 \DeclareEncodingSubset{TS1}{cmbr}    {0}
-\DeclareEncodingSubset{TS1}{cmr}     {0}
-\DeclareEncodingSubset{TS1}{cmss}    {0}
+%    \end{macrocode}
+%    The following 4 declarations are now part of the corresponding
+%    \texttt{.fd} file, hopefully other will follow so that this list
+%    of declarations can eventually be removed from the kernel (where
+%    it doesn't belong).
+%    \begin{macrocode}
+%\DeclareEncodingSubset{TS1}{cmr}     {0}
+%\DeclareEncodingSubset{TS1}{cmss}    {0}
+%\DeclareEncodingSubset{TS1}{cmtt}    {0}
+%\DeclareEncodingSubset{TS1}{cmvtt}   {0}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
 \DeclareEncodingSubset{TS1}{cmtl}    {0}
-\DeclareEncodingSubset{TS1}{cmtt}    {0}
-\DeclareEncodingSubset{TS1}{cmvtt}   {0}
 \DeclareEncodingSubset{TS1}{pxr}     {0}
 \DeclareEncodingSubset{TS1}{pxss}    {0}
 \DeclareEncodingSubset{TS1}{pxtt}    {0}
@@ -1218,7 +1097,7 @@
 %    \end{macrocode}
 %    Strangely enough NotoSerif and NotoSans are sub-encoding 7 as
 %    they are missing \cs{textminus} and several other glyphs. In
-%    contrast the NotoSansMono is far more complete.
+%    contrast, the NotoSansMono is far more complete.
 %    \begin{macrocode}
 \DeclareEncodingSubset{TS1}{NotoSans-*}               {7}
 \DeclareEncodingSubset{TS1}{NotoSerif-*}              {7}
@@ -1700,7 +1579,12 @@
      {\PackageInfo{textcomp}{Setting #2 sub-encoding to #1/#3}}%
      {\PackageInfo{textcomp}{Changing #2 sub-encoding to #1/#3}}%
    \@namedef{#1:#2}{#3}}
-\@onlypreamble\DeclareEncodingSubset
+%    \end{macrocode}
+%    In the original code this was only allowed in the preamble but
+%    now \texttt{.fd}s might contain it so that even in a rollback
+%    situation it is necessary to allow it everywhere in the document.
+%    \begin{macrocode}
+%\@onlypreamble\DeclareEncodingSubset
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/base/testfiles-legacy/github-1333-rollback.tlg b/base/testfiles-legacy/github-1333-rollback.tlg
index e645127cb..990aed905 100644
--- a/base/testfiles-legacy/github-1333-rollback.tlg
+++ b/base/testfiles-legacy/github-1333-rollback.tlg
@@ -25,7 +25,7 @@ LaTeX Info: Redefining \oldstylenums on input line ....
 Package textcomp Info: Changing cmr sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmss sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmtt sub-encoding to TS1/0 on input line ....
-Package textcomp Info: Changing cmvtt sub-encoding to TS1/0 on input line ....
+Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmbr sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmtl sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing ccr sub-encoding to TS1/0 on input line ....
diff --git a/base/testfiles-legacy/tlb-textcomp-006.tlg b/base/testfiles-legacy/tlb-textcomp-006.tlg
index a49933689..e15283bb6 100644
--- a/base/testfiles-legacy/tlb-textcomp-006.tlg
+++ b/base/testfiles-legacy/tlb-textcomp-006.tlg
@@ -3,14 +3,12 @@ Don't change this file in any respect.
 oldstyle in cmr cmss or cmtt from TS1
 LaTeX Info: Oldstyle digits unavailable for family lmr.
             Default oldstyle digits used instead on input line ....
-LaTeX Font Info:    Trying to load font information for TS1+cmss on input line ....
 LaTeX Font Info:    Trying to load font information for OT1+lmtt on input line ....
 LaTeX Font Info:    No file OT1lmtt.fd. on input line ....
 LaTeX Font Warning: Font shape `OT1/lmtt/m/n' undefined
 (Font)              using `OT1/cmr/m/n' instead on input line ....
 LaTeX Info: Oldstyle digits unavailable for family lmtt.
             Default oldstyle digits used instead on input line ....
-LaTeX Font Info:    Trying to load font information for TS1+cmtt on input line ....
 LaTeX Font Info:    Trying to load font information for OML+lmr on input line ....
 LaTeX Font Info:    No file OMLlmr.fd. on input line ....
 LaTeX Font Warning: Font shape `OML/lmr/m/it' undefined
diff --git a/base/testfiles/github-1336.tlg b/base/testfiles/github-1336.tlg
index e974b9a56..d98988150 100644
--- a/base/testfiles/github-1336.tlg
+++ b/base/testfiles/github-1336.tlg
@@ -46,7 +46,7 @@ LaTeX Info: Redefining \oldstylenums on input line ....
 Package textcomp Info: Changing cmr sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmss sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmtt sub-encoding to TS1/0 on input line ....
-Package textcomp Info: Changing cmvtt sub-encoding to TS1/0 on input line ....
+Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmbr sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing cmtl sub-encoding to TS1/0 on input line ....
 Package textcomp Info: Changing ccr sub-encoding to TS1/0 on input line ....





More information about the latex3-commits mailing list.