[latex3-commits] [git/LaTeX3-latex3-latex2e] textcomp: use textcomp package to set warning -> error (9cb473d1)
Frank Mittelbach
frank.mittelbach at latex-project.org
Wed Nov 13 10:33:32 CET 2019
Repository : https://github.com/latex3/latex2e
On branch : textcomp
Link : https://github.com/latex3/latex2e/commit/9cb473d12ac50f950335c7aca4f8f6d681507de3
>---------------------------------------------------------------
commit 9cb473d12ac50f950335c7aca4f8f6d681507de3
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Wed Nov 13 10:33:32 2019 +0100
use textcomp package to set warning -> error
>---------------------------------------------------------------
9cb473d12ac50f950335c7aca4f8f6d681507de3
base/ltoutenc.dtx | 26 +++++----
base/testfiles-legacy/tlb-textcomp-005.tlg | 36 ++++++------
base/testfiles/tlb-isodate-001.tlg | 1 -
base/textcomp-adds.tex | 93 ++++++++++++++----------------
4 files changed, 76 insertions(+), 80 deletions(-)
diff --git a/base/ltoutenc.dtx b/base/ltoutenc.dtx
index 317dc055..be18f6ce 100644
--- a/base/ltoutenc.dtx
+++ b/base/ltoutenc.dtx
@@ -3661,8 +3661,8 @@
% \begin{macrocode}
\DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}}
\DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}}
-\DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}}
-\DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}}
+\DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{8}}
+\DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{8}}
% \end{macrocode}
% The default is ``almostfull'' which means that old documents will
% work except that |\textcircled| and |\t| will use the kernel
@@ -3679,20 +3679,18 @@
% ``almostfull'' but then better check their output manually.
%
% \begin{macrocode}
-\def\tc at errorwarn{\PackageError}
-\DeclareOption{warn}{\gdef\tc at errorwarn#1#2#3{\PackageWarning{#1}{#2}}}
+\def\tc at errorwarn{\PackageError{textcomp}}
+\DeclareOption{warn}{\gdef\tc at errorwarn#1#2{\PackageWarning{textcomp}{#1}}}
% \end{macrocode}
%
% \begin{macrocode}
-\ExecuteOptions{almostfull}
+\ExecuteOptions{}
\ProcessOptions\relax
+% \end{macrocode}
-\endinput %%% for now need to decide what textcomp should still do!
-% \end{macrocode}
-%
% \begin{macro}{\CheckEncodingSubset}
% The command |\CheckEncodingSubset| will check if the current font
% family has the right encoding subset to typeset a certain
@@ -3735,13 +3733,21 @@
{#1{#2}}{#3}%
#5%
}
+\fi
+
+
+
+\endinput %%% for now need to decide what textcomp should still do!
+
+
% \end{macrocode}
+%
% In normal circumstances the test is a bit more complicated: first
% check if there exists a macro
% |\|\meta{arg2}|:|\meta{current-family} and if so use that value
% to test against, otherwise use the default to test against.
% \begin{macrocode}
-\else
+%\else
\def\CheckEncodingSubset#1#2#3#4#5{%
\ifnum #4>%
\expandafter\ifx\csname #2:\f at family\endcsname\relax
@@ -3757,7 +3763,7 @@
{#1{#2}}{#3}%
#5%
}
-\fi
+%\fi
% \end{macrocode}
% \end{macro}
%
diff --git a/base/testfiles-legacy/tlb-textcomp-005.tlg b/base/testfiles-legacy/tlb-textcomp-005.tlg
index 8c50dd1e..52d623ab 100644
--- a/base/testfiles-legacy/tlb-textcomp-005.tlg
+++ b/base/testfiles-legacy/tlb-textcomp-005.tlg
@@ -1,32 +1,32 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
needs also nfssaxes to change defaults nd needs path search - not done
-Package textcomp Warning: Symbol \textdollaroldstyle not provided by
-(textcomp) font family Alegreya-LF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
-Package textcomp Warning: Symbol \textcentoldstyle not provided by
-(textcomp) font family Alegreya-LF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
+LaTeX Warning: Symbol \textdollaroldstyle not provided by
+ font family Alegreya-LF in TS1 encoding.
+ Default family used instead on input line ....
+LaTeX Warning: Symbol \textcentoldstyle not provided by
+ font family Alegreya-LF in TS1 encoding.
+ Default family used instead on input line ....
LaTeX Font Info: Trying to load font information for OT1+AlegreyaSans-LF on input line ....
LaTeX Font Info: No file OT1AlegreyaSans-LF.fd. on input line ....
LaTeX Font Warning: Font shape `OT1/AlegreyaSans-LF/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line ....
-Package textcomp Warning: Symbol \textdollaroldstyle not provided by
-(textcomp) font family AlegreyaSans-LF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
-Package textcomp Warning: Symbol \textcentoldstyle not provided by
-(textcomp) font family AlegreyaSans-LF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
+LaTeX Warning: Symbol \textdollaroldstyle not provided by
+ font family AlegreyaSans-LF in TS1 encoding.
+ Default family used instead on input line ....
+LaTeX Warning: Symbol \textcentoldstyle not provided by
+ font family AlegreyaSans-LF in TS1 encoding.
+ Default family used instead on input line ....
LaTeX Font Info: Trying to load font information for OT1+AlgolRevived-TLF on input line ....
LaTeX Font Info: No file OT1AlgolRevived-TLF.fd. on input line ....
LaTeX Font Warning: Font shape `OT1/AlgolRevived-TLF/m/n' undefined
(Font) using `OT1/cmr/m/n' instead on input line ....
-Package textcomp Warning: Symbol \textdollaroldstyle not provided by
-(textcomp) font family AlgolRevived-TLF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
-Package textcomp Warning: Symbol \textcentoldstyle not provided by
-(textcomp) font family AlgolRevived-TLF in TS1 encoding.
-(textcomp) Default family used instead on input line ....
+LaTeX Warning: Symbol \textdollaroldstyle not provided by
+ font family AlgolRevived-TLF in TS1 encoding.
+ Default family used instead on input line ....
+LaTeX Warning: Symbol \textcentoldstyle not provided by
+ font family AlgolRevived-TLF in TS1 encoding.
+ Default family used instead on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
diff --git a/base/testfiles/tlb-isodate-001.tlg b/base/testfiles/tlb-isodate-001.tlg
index 943c8097..22892bbc 100644
--- a/base/testfiles/tlb-isodate-001.tlg
+++ b/base/testfiles/tlb-isodate-001.tlg
@@ -76,5 +76,4 @@ Package textcomp Info: Sub-encoding information:
(textcomp) only a restricted character set as indicated.
(textcomp) Family '?' is the default used for unknown fonts.
(textcomp) See the documentation for details.
-Package textcomp Info: Changing ? sub-encoding to TS1/1 on input line ....
)
diff --git a/base/textcomp-adds.tex b/base/textcomp-adds.tex
index 76ae0543..bd0c6ac4 100644
--- a/base/textcomp-adds.tex
+++ b/base/textcomp-adds.tex
@@ -5,6 +5,11 @@
\input{ts1enc.def}
+% if we don't know what font to use for substituations we default to the ``rm'' family
+
+\def\substdefault{\rmsubstdefault}
+
+
\ifx\Umathcode\@undefined
\def\rmsubstdefault{cmr}
@@ -12,19 +17,7 @@
\def\ttsubstdefault{cmtt}
\input{ts1cmr.fd}
-% in pdftex pick up capital accents from TS1 if available
-%\DeclareTextAccent{\capitalacute}{TS1}{1}
-%\DeclareTextAccent{\capitalbreve}{TS1}{8}
-%\DeclareTextAccent{\capitalcaron}{TS1}{7}
-%\DeclareTextAccent{\capitalcircumflex}{TS1}{2}
-%\DeclareTextAccent{\capitaldieresis}{TS1}{4}
-%\DeclareTextAccent{\capitaldotaccent}{TS1}{10}
-%\DeclareTextAccent{\capitalgrave}{TS1}{0}
-%\DeclareTextAccent{\capitalhungarumlaut}{TS1}{5}
-%\DeclareTextAccent{\capitalmacron}{TS1}{9}
-%\DeclareTextAccent{\capitalring}{TS1}{6}
-%\DeclareTextAccent{\capitaltilde}{TS1}{3}
% use textcomp \oldstylenums if in pdftex
@@ -102,13 +95,14 @@
#5%
}
-% maybe \DeclareEncodingSubeset{TS1}{Alegreya-*}{2} should defines all std names, i.e.
+% \DeclareEncodingSubeset{TS1}{Alegreya-*}{2} defines all std names, i.e.
%
% \DeclareEncodingSubeset{TS1}{Alegreya-LF}{2}
% \DeclareEncodingSubeset{TS1}{Alegreya-OsF}{2}
% \DeclareEncodingSubeset{TS1}{Alegreya-TLF}{2}
% \DeclareEncodingSubeset{TS1}{Alegreya-TOsF}{2}
%
+% in one go. If only some are needed then one can define them individually.
% Below is a some primitive coding without error checking.
%
@@ -134,34 +128,33 @@
\@namedef{#1:#2}{#3}}
\@onlypreamble\DeclareEncodingSubset
+\@onlypreamble\DeclareEncodingSubset at aux
+\@onlypreamble\@DeclareEncodingSubset
% maybe that should be kernel error now ...
%\def\tc at errorwarn{\PackageError}
% or maybe not ...
-\def\tc at errorwarn#1#2#3{\PackageWarning{#1}{#2}}
+\def\tc at errorwarn#1#2{\@latex at warning{#1}}
-\def\tc at error#1{%
- \tc at errorwarn{textcomp}% % should be latex error if general
- {Accent \string#1 not provided by\MessageBreak
- font family \f at family\space
- in TS1 encoding}\@eha
-}
-% next macro only works when nfssaxes are also loaded. Otherwise it wll always select \rmsubstdefault
+% next macro only works when nfssaxes are also loaded. Otherwise it
+% will always select \substdefault
\def\tc at subst#1{%
- \tc at errorwarn{textcomp}% % should be latex error if general
+ \tc at errorwarn
{Symbol \string#1 not provided by\MessageBreak
font family \f at family\space
in TS1 encoding.\MessageBreak Default family used instead}\@eha
\bgroup
- \ifx\f at family\sfdef at ult
+ \ifx\f at family\rmdef at ult
+ \fontfamily\rmsubstdefault
+ \else\ifx\f at family\sfdef at ult
\fontfamily\sfsubstdefault
\else\ifx\f at family\ttdef at ult
\fontfamily\ttsubstdefault
\else
- \fontfamily\rmsubstdefault
- \fi\fi
+ \fontfamily\substdefault
+ \fi\fi\fi
% claim that the default can handle all slots (even if not true) to avoid looping
\@namedef{TS1:\f at family}{0}%
\selectfont#1%
@@ -255,19 +248,19 @@
\DeclareTextCommandDefault{\textzerooldstyle} {\tc at check@symbol2\textzerooldstyle}
% those are special to TeX fonts (and for a few older PS fonts
-% supported in the virtual fonts, but not any longer in the majority
+% supported in the virtual fonts), but not any longer in the majority
% of fonts provided through autoinst, so we pretend there aren't
% available in sub-encoding 2 and below.
-\DeclareTextCommandDefault{\textasciigrave} {\tc at check@symbol2\textasciigrave}
-\DeclareTextCommandDefault{\texttildelow} {\tc at check@symbol2\texttildelow}
+\DeclareTextCommandDefault{\textacutedbl} {\tc at check@symbol2\textacutedbl}
+\DeclareTextCommandDefault{\textasciiacute} {\tc at check@symbol2\textasciiacute}
\DeclareTextCommandDefault{\textasciibreve} {\tc at check@symbol2\textasciibreve}
\DeclareTextCommandDefault{\textasciicaron} {\tc at check@symbol2\textasciicaron}
-\DeclareTextCommandDefault{\textgravedbl} {\tc at check@symbol2\textgravedbl}
-\DeclareTextCommandDefault{\textacutedbl} {\tc at check@symbol2\textacutedbl}
\DeclareTextCommandDefault{\textasciidieresis} {\tc at check@symbol2\textasciidieresis}
+\DeclareTextCommandDefault{\textasciigrave} {\tc at check@symbol2\textasciigrave}
\DeclareTextCommandDefault{\textasciimacron} {\tc at check@symbol2\textasciimacron}
-\DeclareTextCommandDefault{\textasciiacute} {\tc at check@symbol2\textasciiacute}
+\DeclareTextCommandDefault{\textgravedbl} {\tc at check@symbol2\textgravedbl}
+\DeclareTextCommandDefault{\texttildelow} {\tc at check@symbol2\texttildelow}
% none of those are arround other than in CM based fonts
@@ -310,7 +303,6 @@
% Alternatively we could just state that the symbol is unavailable in
% those fonts. For now I substitute.
-
\DeclareTextCommandDefault{\textpertenthousand} {\tc at check@symbol2\textpertenthousand}
\UndeclareTextCommand{\textpertenthousand}{T1}
@@ -415,9 +407,9 @@
\DeclareTextAccentDefault{\capitalcedilla}{TS1}
\DeclareTextAccentDefault{\capitalogonek}{TS1}
-%%\DeclareTextSymbolDefault{\textbardbl}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\textbardbl}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textbrokenbar}{TS1}
-%%\DeclareTextSymbolDefault{\textcelsius}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\textcelsius}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textcent}{TS1}
\DeclareTextSymbolDefault{\textcopyright}{TS1}
\DeclareTextSymbolDefault{\textdegree}{TS1}
@@ -425,7 +417,7 @@
\DeclareTextSymbolDefault{\textlnot}{TS1}
\DeclareTextSymbolDefault{\textonehalf}{TS1}
\DeclareTextSymbolDefault{\textonequarter}{TS1}
-%%\DeclareTextSymbolDefault{\textonesuperior}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\textonesuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textordfeminine}{TS1}
\DeclareTextSymbolDefault{\textordmasculine}{TS1}
\DeclareTextSymbolDefault{\textpm}{TS1}
@@ -433,13 +425,13 @@
\DeclareTextSymbolDefault{\textquotestraightbase}{TS1}
\DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1}
\DeclareTextSymbolDefault{\textregistered}{TS1}
-%%\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textthreequarters}{TS1}
-%%\DeclareTextSymbolDefault{\textthreesuperior}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\textthreesuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\texttimes}{TS1}
\DeclareTextSymbolDefault{\texttrademark}{TS1}
-%%\DeclareTextSymbolDefault{\texttwelveudash}{TS1} % subst in sub-enc 9 below
-%%\DeclareTextSymbolDefault{\texttwosuperior}{TS1} % subst in sub-enc 9 below
+%%\DeclareTextSymbolDefault{\texttwelveudash}{TS1} % subst in sub-enc 9 above
+%%\DeclareTextSymbolDefault{\texttwosuperior}{TS1} % subst in sub-enc 9 above
\DeclareTextSymbolDefault{\textyen}{TS1}
@@ -596,17 +588,17 @@
\DeclareEncodingSubset{TS1}{uag} {8} % probably (currently broken distrib)
\DeclareEncodingSubset{TS1}{ugq} {8}
-% LucidaBright ...
+% LucidaBright (sold through TUG) probably not quite correct as I have the older fonts ...
%
-%\DeclareEncodingSubset{TS1}{hls} {?}
-%\DeclareEncodingSubset{TS1}{hlst} {?}
-%\DeclareEncodingSubset{TS1}{hlct} {?}
-%\DeclareEncodingSubset{TS1}{hlx} {?}
-%\DeclareEncodingSubset{TS1}{hlce} {?}
-%\DeclareEncodingSubset{TS1}{hlcn} {?}
-%\DeclareEncodingSubset{TS1}{hlcw} {?}
-%\DeclareEncodingSubset{TS1}{hlcf} {?}
-%\DeclareEncodingSubset{TS1}{hlh} {?}
+\DeclareEncodingSubset{TS1}{hls} {5}
+\DeclareEncodingSubset{TS1}{hlst} {5}
+\DeclareEncodingSubset{TS1}{hlct} {5}
+\DeclareEncodingSubset{TS1}{hlh} {5}
+\DeclareEncodingSubset{TS1}{hlx} {8}
+\DeclareEncodingSubset{TS1}{hlce} {8}
+\DeclareEncodingSubset{TS1}{hlcn} {8}
+\DeclareEncodingSubset{TS1}{hlcw} {8}
+\DeclareEncodingSubset{TS1}{hlcf} {8}
\DeclareEncodingSubset{TS1}{lato-*} {0} % with a bunch of tofu inside
@@ -733,13 +725,12 @@
\DeclareEncodingSubset{TS1}{ComicNeueAngular-TLF} {7}
\DeclareEncodingSubset{TS1}{Forum-LF} {7} % the superiors are missing
+\DeclareEncodingSubset{TS1}{Cochineal-*} {8}
\DeclareEncodingSubset{TS1}{AlgolRevived-TLF} {9}
-% Fix those
-\DeclareEncodingSubset{TS1}{Cochineal-*} {9}
% for item labels provide:
More information about the latex3-commits
mailing list