% \iffalse meta-comment % % Copyright (C) 2019-2024 % The LaTeX Project and any individual authors listed elsewhere % in this file. % % This file is part of the LaTeX base system. % ------------------------------------------- % % It may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in % https://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of LaTeX % version 2008 or later. % % This file has the LPPL maintenance status "maintained". % % The list of all files belonging to the LaTeX base distribution is % given in the file `manifest.txt'. See also `legal.txt' for additional % information. % % The list of derived (unpacked) files belonging to the distribution % and covered by LPPL is defined by the unpacking scripts (with % extension .ins) which are part of the distribution. % %%% From File: lttextcomp.dtx % % \fi % % % \iffalse % %<*driver> % \fi % % \ProvidesFile{lttextcomp.dtx} [2024/02/08 v1.1a LaTeX Kernel (text companion symbols)] % \iffalse \documentclass{ltxdoc} \begin{document} \DocInput{lttextcomp.dtx} \end{document} % % \fi % % % % % \GetFileInfo{lttextcomp.dtx} % \title{Providing additional text symbols\\ % (previously available through the \texttt{textcomp} package)\thanks % {This file has version number % \fileversion\ dated \filedate}} % % \author{Frank Mittelbach} % % \MaintainedByLaTeXTeam{latex} % \maketitle % % This file contains the implementation for accessing the glyphs % provided by the \texttt{TS1} encoding (Text Companion % Encoding). This is now offered as part of the kernel and so the % \texttt{textcomp} package which used to provide the definitions is % now mainly needed for compatibility reasons (and doesn't do much any % more). % % % % \MaybeStop{} % % \changes{v1.0e}{2021/03/19} % {Use \cs{NewModuleRelease}} % \begin{macrocode} %<*2ekernel|latexrelease> %\NewModuleRelease{2020/02/02}{lttextcomp} % {Text Companion symbols} % \end{macrocode} % % \begin{macro}{\oldstylenums} % \begin{macro}{\legacyoldstylenums} % % Preserve the old definition of \cs{oldstylenums} under a different name. % % This macro implements old style numerals but only works if we % assume that the standard math fonts are used. Thus it needs % changing in case other math encodings are used. % \begin{macrocode} \DeclareRobustCommand\legacyoldstylenums[1]{% \begingroup % \end{macrocode} % Provide spacing using the interword space of the current font. % \begin{macrocode} \spaceskip\fontdimen\tw@\font % \end{macrocode} % Then switch to the math italic font. We don't change the current % value of |\f@series| which means that you can use bold numerals % if |\bfseries| is in force. As family we use |\rmdefault| which % means that this only works if there exist an |OML| encoded % version of that font or rather a corresponding |.fd| file (which % is the case for standard \LaTeX{} fonts even though they only % contain substitutions). % \changes{v3.0j}{1999/02/12}{Use \cs{rmdefault} instead of \texttt{cmm} % (pr/2954)} % \begin{macrocode} \usefont{OML}{\rmdefault}{\f@series}{it}% \mathgroup\symletters #1% \endgroup } % \end{macrocode} % % And here is the improved one that adjusts depending on surroundings. % \begin{macrocode} \DeclareRobustCommand\oldstylenums[1]{% \begingroup \ifmmode \mathgroup\symletters #1% \else % \end{macrocode} % The \cs{CheckEncodingSubset} is discussed below. % \begin{macrocode} \CheckEncodingSubset\@use@text@encoding{TS1}\tc@oldstylesubst2{{#1}}% \fi \endgroup } % \end{macrocode} % The helper to select the substitution if needed. % \begin{macrocode} \def\tc@oldstylesubst#1{% \tc@errorwarn {Oldstyle digits unavailable for family \f@family.\MessageBreak Default oldstyle digits used instead}\@eha \bgroup \expand@font@defaults % \end{macrocode} % The substitution defaults are provided in the file \texttt{fonttext.ltx}. % \begin{macrocode} \ifx\f@family\rmdef@ult \fontfamily\rmsubstdefault \else\ifx\f@family\sfdef@ult \fontfamily\sfsubstdefault \else\ifx\f@family\ttdef@ult \fontfamily\ttsubstdefault \else \fontfamily\textcompsubstdefault \fi\fi\fi \fontencoding{TS1}\selectfont#1% \egroup } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\textcompsubstdefault} % Here is the default for the ``unknown'' case: % \begin{macrocode} \def\textcompsubstdefault{\rmsubstdefault} % \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@aux{#1}#2*\DeclareEncodingSubset@aux } % \end{macrocode} % % \begin{macrocode} \def\DeclareEncodingSubset@aux#1#2*#3\DeclareEncodingSubset@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@info{Setting #2 sub-encoding to #1/#3}}% {\@font@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@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@family\endcsname\relax 0\csname #2:?\endcsname \else \csname #2:\f@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@errorwarn} % To we produce errors, warnings, or only info in the transcripts % if glyphs require substitutions? By default it is ``info'' % only. With the \texttt{textcomp} package that can be changed. % \begin{macrocode} \def\tc@errorwarn#1#2{\@latex@info{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\tc@subst} % % \changes{v1.0b}{2020/01/22}{The overall default is \cs{textcompsubstdefault} % not \cs{substdefault}} % \begin{macrocode} \def\tc@subst#1{% \tc@errorwarn {Symbol \string#1 not provided by\MessageBreak font family \f@family\space in TS1 encoding.\MessageBreak Default family used instead}\@eha \bgroup \expand@font@defaults \ifx\f@family\rmdef@ult \fontfamily\rmsubstdefault \else\ifx\f@family\sfdef@ult \fontfamily\sfsubstdefault \else\ifx\f@family\ttdef@ult \fontfamily\ttsubstdefault \else \fontfamily\textcompsubstdefault \fi\fi\fi % \end{macrocode} % Whatever default was chosen, we claim now (locally hopefully) % that it can handle all slots (even if not true) to avoid looping % in certain situations, e.g., when something was set up incorrectly. % \begin{macrocode} \@namedef{TS1:\f@family}{0}% \selectfont#1% \egroup } % \end{macrocode} % \end{macro} % % % % % % \begin{macro}{\tc@fake@euro} % |\tc@fake@euro| is an example of a ``fake'' definition to use in arg |#3| of % the command |\CheckEncodingSubset| when a symbol is not available in a % certain font family. Here we produce a poor man's Euro symbol by combining % a ``C'' with a ``=''. % \begin{macrocode} \def\tc@fake@euro#1{% \leavevmode \@font@info{Faking \noexpand#1for font family \f@family\MessageBreak in TS1 encoding}% \valign{##\cr \vfil\hbox to 0.07em{\dimen@\f@size\p@ \math@fontsfalse \fontsize{.7\dimen@}\z@\selectfont=\hss}% \vfil\cr% \hbox{C}\crcr }% } % \end{macrocode} % \end{macro} % % % % % \begin{macro}{\tc@check@symbol} % \begin{macro}{\tc@check@accent} % These are two abbreviations that we use below to check symbols % and accents in TS1. Only there to save some space, e.g., we can % then write %\begin{verbatim} %\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency} %\end{verbatim} % to ensure that |\textcurrency| is only typeset if the current % font has a \texttt{TS1} subset id of less than 3. Otherwise % |\tc@error| is called telling the user that for this font family % |\textcurrency| is not available. % \begin{macrocode} \def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst} % \end{macrocode} % % Accents have been made an error in the \texttt{textcomp} package when % not available. Now that we provide the functionality in the % kernel we avoid the error by swapping in a \texttt{T1} accent if % the \texttt{TS1} accent is not available. % \begin{macrocode} %\def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error} % \end{macrocode} % % \begin{macrocode} \def\tc@check@accent#1{\CheckEncodingSubset\UseTextAccent {TS1}{\tc@swap@accent#1}} \def\tc@swap@accent#1#2{\UseTextAccent{T1}#1} % \end{macrocode} % \end{macro} % \end{macro} % % \section{Sub-encodings} % % Here are the default definitions for the \texttt{TS1} symbols. % First those that we assume are always available if a font % implements \texttt{TS1}. % % \begin{macrocode} \DeclareTextSymbolDefault{\textdollar}{TS1} \UndeclareTextCommand{\textdollar}{OT1} % don't use the OT1 def any longer % \end{macrocode} % % \begin{macrocode} \DeclareTextSymbolDefault{\textsterling}{TS1} \UndeclareTextCommand{\textsterling}{OT1}% don't use the OT1 def any longer % \end{macrocode} % % \begin{macrocode} \DeclareTextSymbolDefault{\textperthousand}{TS1} \UndeclareTextCommand{\textperthousand}{T1} % don't use the T1 def % \end{macrocode} % Using \cs{UndeclareTextCommand} above is enough only if the % encoding definition files are not reloaded afterwards. In the % past that happened if \texttt{fontenc} was used in the document % preamble (not any longer). So in some sense it is better to fully remove % them from the encoding files, but for rollbacks it is easier to % keep them in for now. % % These are the standard \texttt{itemize} and footnote symbols % originally taken from \texttt{OMS} and now from \texttt{TS1}: % \begin{macrocode} \DeclareTextSymbolDefault{\textasteriskcentered}{TS1} \DeclareTextSymbolDefault{\textbullet}{TS1} \DeclareTextSymbolDefault{\textdaggerdbl}{TS1} \DeclareTextSymbolDefault{\textdagger}{TS1} \DeclareTextSymbolDefault{\textparagraph}{TS1} \DeclareTextSymbolDefault{\textperiodcentered}{TS1} \DeclareTextSymbolDefault{\textsection}{TS1} % \end{macrocode} % % And here are the other \texttt{TS1} glyphs that are implemented % by every font (or nearly every)---a few are commented out and % moved to sub-encoding 9, % because they aren't around in some fonts. % \begin{macrocode} %%\DeclareTextSymbolDefault{\textbardbl}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\textbrokenbar}{TS1} %%\DeclareTextSymbolDefault{\textcelsius}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\textcent}{TS1} \DeclareTextSymbolDefault{\textcopyright}{TS1} \DeclareTextSymbolDefault{\textdegree}{TS1} \DeclareTextSymbolDefault{\textdiv}{TS1} \DeclareTextSymbolDefault{\textlnot}{TS1} \DeclareTextSymbolDefault{\textonehalf}{TS1} \DeclareTextSymbolDefault{\textonequarter}{TS1} %%\DeclareTextSymbolDefault{\textonesuperior}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\textordfeminine}{TS1} \DeclareTextSymbolDefault{\textordmasculine}{TS1} \DeclareTextSymbolDefault{\textpm}{TS1} \DeclareTextSymbolDefault{\textquotesingle}{TS1} \DeclareTextSymbolDefault{\textquotestraightbase}{TS1} \DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1} \DeclareTextSymbolDefault{\textregistered}{TS1} %%\DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\textthreequarters}{TS1} %%\DeclareTextSymbolDefault{\textthreesuperior}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\texttimes}{TS1} \DeclareTextSymbolDefault{\texttrademark}{TS1} %%\DeclareTextSymbolDefault{\texttwelveudash}{TS1} % subst in sub-enc 9 above %%\DeclareTextSymbolDefault{\texttwosuperior}{TS1} % subst in sub-enc 9 above \DeclareTextSymbolDefault{\textyen}{TS1} % \end{macrocode} % % \begin{macrocode} \DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1} \DeclareTextSymbolDefault{\textascendercompwordmark}{TS1} % \end{macrocode} % % % In the following sections the remaining default definitions are % ordered by sub-encoding in which they are become % \textbf{unavailable}, i.e., they are not provided in the % sub-encoding with that number and all sub-encodings with higher % numbers. % % Thus the symbols that are available in sub-encoding $x$ are the % symbols above (always available) and the symbols listed as becoming % unavailable in sub-encodings $x+1$ and higher. % % \subsection{Unavailable in sub-encoding \texttt{1} and higher (drop symbols not working in % Latin Modern)} % % The \cs{textcircled} is available but the glyph is simply too % small so we keep using the \texttt{OMS} glyph. % \begin{macrocode} \DeclareTextCommandDefault{\textcircled} {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OMS}}1\textcircled} % \end{macrocode} % % % % % % \subsection{Unavailable in sub-encoding \texttt{2} (majority of new OTF fonts via autoinst) and higher} % % \begin{macrocode} \DeclareTextCommandDefault{\t} {\CheckEncodingSubset\UseTextAccent{TS1}{\UseTextAccent{OML}}2\t} % \end{macrocode} % % Capital accents are really only very seldom implemented, so from % sub-encoding \texttt{2} onwards we use the normal \texttt{T1} % accents if they are asked for in the document. % % In Unicode engines we don't implement them at all but always use % the basic accents instead. whether that works or not really % depends on the font, something like \verb=\"X= usually comes out % wrong in Unicode engines. % % \begin{macrocode} \ifx\Umathcode\@undefined \DeclareTextCommandDefault{\capitalacute} {\tc@check@accent{\'}2\capitalacute} \DeclareTextCommandDefault{\capitalbreve} {\tc@check@accent{\u}2\capitalbreve} \DeclareTextCommandDefault{\capitalcaron} {\tc@check@accent{\v}2\capitalcaron} \DeclareTextCommandDefault{\capitalcedilla} {\tc@check@accent{\c}2\capitalcedilla} \DeclareTextCommandDefault{\capitalcircumflex} {\tc@check@accent{\^}2\capitalcircumflex} \DeclareTextCommandDefault{\capitaldieresis} {\tc@check@accent{\"}2\capitaldieresis} \DeclareTextCommandDefault{\capitaldotaccent} {\tc@check@accent{\.}2\capitaldotaccent} \DeclareTextCommandDefault{\capitalgrave} {\tc@check@accent{\`}2\capitalgrave} \DeclareTextCommandDefault{\capitalhungarumlaut} {\tc@check@accent{\H}2\capitalhungarumlaut} \DeclareTextCommandDefault{\capitalmacron} {\tc@check@accent{\=}2\capitalmacron} \DeclareTextCommandDefault{\capitalogonek} {\tc@check@accent{\k}2\capitalogonek} \DeclareTextCommandDefault{\capitalring} {\tc@check@accent{\r}2\capitalring} \DeclareTextCommandDefault{\capitaltie} {\tc@check@accent{\t}2\capitaltie} \DeclareTextCommandDefault{\capitaltilde} {\tc@check@accent{\~}2\capitaltilde} % \end{macrocode} % For \cs{newtie} and \cs{capitalnewtie} this is actually wrong, they should pick up % the accent from the substitution font (not done yet). % \begin{macrocode} \DeclareTextCommandDefault{\newtie} {\tc@check@accent{\t}2\newtie} \DeclareTextCommandDefault{\capitalnewtie} {\tc@check@accent{\t}2\capitalnewtie} % \end{macrocode} % % In Unicode engines we just execute the simple accents: % \changes{v1.0c}{2020/02/10}{Use \cs{@tabacckludge} for % tabbing where necessary (gh/271)} % \changes{v1.0d}{2020/04/29}{Make all capital accents text % commands for hyperref (gh/332)} % \begin{macrocode} \else \DeclareTextCommandDefault\capitalacute{\@tabacckludge'} \DeclareTextCommandDefault\capitalbreve{\u} \DeclareTextCommandDefault\capitalcaron{\v} \DeclareTextCommandDefault\capitalcedilla{\c} \DeclareTextCommandDefault\capitalcircumflex{\^} \DeclareTextCommandDefault\capitaldieresis{\"} \DeclareTextCommandDefault\capitaldotaccent{\.} \DeclareTextCommandDefault\capitalgrave{\@tabacckludge`} \DeclareTextCommandDefault\capitalhungarumlaut{\H} \DeclareTextCommandDefault\capitalmacron{\@tabacckludge=} \DeclareTextCommandDefault\capitalnewtie{\t} \DeclareTextCommandDefault\capitalogonek{\k} \DeclareTextCommandDefault\capitalring{\r} \DeclareTextCommandDefault\capitaltie{\t} \DeclareTextCommandDefault\capitaltilde{\~} \DeclareTextCommandDefault\newtie{\t} \fi % \end{macrocode} % % % % % The next two symbols exist in some fonts (faked?), but we ignore % that to keep the subsets reasonable compact and most important linear. % \begin{macrocode} \DeclareTextCommandDefault{\textlbrackdbl} {\tc@check@symbol2\textlbrackdbl} \DeclareTextCommandDefault{\textrbrackdbl} {\tc@check@symbol2\textrbrackdbl} % \end{macrocode} % % % Old style numerals are again in some fonts but using % \texttt{-OsF}, etc.\ is the better approach to get them, so we % claim they aren't in sub-encoding 2 as that's true for most % fonts. % \begin{macrocode} \DeclareTextCommandDefault{\texteightoldstyle} {\tc@check@symbol2\texteightoldstyle} \DeclareTextCommandDefault{\textfiveoldstyle} {\tc@check@symbol2\textfiveoldstyle} \DeclareTextCommandDefault{\textfouroldstyle} {\tc@check@symbol2\textfouroldstyle} \DeclareTextCommandDefault{\textnineoldstyle} {\tc@check@symbol2\textnineoldstyle} \DeclareTextCommandDefault{\textoneoldstyle} {\tc@check@symbol2\textoneoldstyle} \DeclareTextCommandDefault{\textsevenoldstyle} {\tc@check@symbol2\textsevenoldstyle} \DeclareTextCommandDefault{\textsixoldstyle} {\tc@check@symbol2\textsixoldstyle} \DeclareTextCommandDefault{\textthreeoldstyle} {\tc@check@symbol2\textthreeoldstyle} \DeclareTextCommandDefault{\texttwooldstyle} {\tc@check@symbol2\texttwooldstyle} \DeclareTextCommandDefault{\textzerooldstyle} {\tc@check@symbol2\textzerooldstyle} % \end{macrocode} % % % % The next set of glyphs is special to \TeX{} fonts (and available % with a few older PS fonts supported through 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. % \begin{macrocode} \DeclareTextCommandDefault{\textacutedbl} {\tc@check@symbol2\textacutedbl} \DeclareTextCommandDefault{\textasciiacute} {\tc@check@symbol2\textasciiacute} \DeclareTextCommandDefault{\textasciibreve} {\tc@check@symbol2\textasciibreve} \DeclareTextCommandDefault{\textasciicaron} {\tc@check@symbol2\textasciicaron} \DeclareTextCommandDefault{\textasciidieresis} {\tc@check@symbol2\textasciidieresis} \DeclareTextCommandDefault{\textasciigrave} {\tc@check@symbol2\textasciigrave} \DeclareTextCommandDefault{\textasciimacron} {\tc@check@symbol2\textasciimacron} \DeclareTextCommandDefault{\textgravedbl} {\tc@check@symbol2\textgravedbl} \DeclareTextCommandDefault{\texttildelow} {\tc@check@symbol2\texttildelow} % \end{macrocode} % % % Finally those below are only available in CM-based fonts but in % no font that has its origin outside of the \TeX{} world. % \begin{macrocode} \DeclareTextCommandDefault{\textbaht} {\tc@check@symbol2\textbaht} \DeclareTextCommandDefault{\textbigcircle} {\tc@check@symbol2\textbigcircle} \DeclareTextCommandDefault{\textborn} {\tc@check@symbol2\textborn} \DeclareTextCommandDefault{\textcentoldstyle} {\tc@check@symbol2\textcentoldstyle} \DeclareTextCommandDefault{\textcircledP} {\tc@check@symbol2\textcircledP} \DeclareTextCommandDefault{\textcopyleft} {\tc@check@symbol2\textcopyleft} \DeclareTextCommandDefault{\textdblhyphenchar} {\tc@check@symbol2\textdblhyphenchar} \DeclareTextCommandDefault{\textdblhyphen} {\tc@check@symbol2\textdblhyphen} \DeclareTextCommandDefault{\textdied} {\tc@check@symbol2\textdied} \DeclareTextCommandDefault{\textdiscount} {\tc@check@symbol2\textdiscount} \DeclareTextCommandDefault{\textdivorced} {\tc@check@symbol2\textdivorced} \DeclareTextCommandDefault{\textdollaroldstyle} {\tc@check@symbol2\textdollaroldstyle} \DeclareTextCommandDefault{\textguarani} {\tc@check@symbol2\textguarani} \DeclareTextCommandDefault{\textleaf} {\tc@check@symbol2\textleaf} \DeclareTextCommandDefault{\textlquill} {\tc@check@symbol2\textlquill} \DeclareTextCommandDefault{\textmarried} {\tc@check@symbol2\textmarried} \DeclareTextCommandDefault{\textmho} {\tc@check@symbol2\textmho} \DeclareTextCommandDefault{\textmusicalnote} {\tc@check@symbol2\textmusicalnote} \DeclareTextCommandDefault{\textnaira} {\tc@check@symbol2\textnaira} \DeclareTextCommandDefault{\textopenbullet} {\tc@check@symbol2\textopenbullet} \DeclareTextCommandDefault{\textpeso} {\tc@check@symbol2\textpeso} \DeclareTextCommandDefault{\textpilcrow} {\tc@check@symbol2\textpilcrow} \DeclareTextCommandDefault{\textrecipe} {\tc@check@symbol2\textrecipe} \DeclareTextCommandDefault{\textreferencemark} {\tc@check@symbol2\textreferencemark} \DeclareTextCommandDefault{\textrquill} {\tc@check@symbol2\textrquill} \DeclareTextCommandDefault{\textservicemark} {\tc@check@symbol2\textservicemark} \DeclareTextCommandDefault{\textsurd} {\tc@check@symbol2\textsurd} % \end{macrocode} % % The \cs{textpertenthousand} also belongs in this group but here % we have a choice: in T1 there is a definition for % \cs{textpertenthousand} making the symbol up from \% and % \verb=\char 24= (twice) but in many fonts that char doesn't exist % and the slot is reused for random ligatures. So better not use it % because often it is wrong. But pointing to TS1 is also not great % as only a few fonts have it as a real symbol, so we get a % substitution to CM or LM. % % Alternatively we could just state that the symbol is unavailable in % those fonts. For now I substitute. % \begin{macrocode} \DeclareTextCommandDefault{\textpertenthousand} {\tc@check@symbol2\textpertenthousand} \UndeclareTextCommand{\textpertenthousand}{T1} % \end{macrocode} % % % % \subsection{Unavailable in sub-encoding \texttt{3} and higher} % % Sub-encoding \texttt{2} is the one where we loose many % symbols. In the higher-numbered sub-encodings we see only a few % dropped additionally. % \begin{macrocode} \DeclareTextCommandDefault{\textlangle} {\tc@check@symbol3\textlangle} \DeclareTextCommandDefault{\textrangle} {\tc@check@symbol3\textrangle} % \end{macrocode} % % % % % % \subsection{Unavailable in sub-encoding \texttt{4} and higher} % % \begin{macrocode} \DeclareTextCommandDefault{\textcolonmonetary} {\tc@check@symbol4\textcolonmonetary} \DeclareTextCommandDefault{\textdong} {\tc@check@symbol4\textdong} \DeclareTextCommandDefault{\textdownarrow} {\tc@check@symbol4\textdownarrow} \DeclareTextCommandDefault{\textleftarrow} {\tc@check@symbol4\textleftarrow} \DeclareTextCommandDefault{\textlira} {\tc@check@symbol4\textlira} \DeclareTextCommandDefault{\textrightarrow} {\tc@check@symbol4\textrightarrow} \DeclareTextCommandDefault{\textuparrow} {\tc@check@symbol4\textuparrow} \DeclareTextCommandDefault{\textwon} {\tc@check@symbol4\textwon} % \end{macrocode} % % % % % % \subsection{Unavailable in sub-encoding \texttt{5} (most older PS fonts) and higher} % % Most older PS fonts (supported in \TeX{} since the early nineties % when virtual fonts became available) are sorted under this % sub-encoding. But in reality, many of them don't have all glyphs % that should be available in sub-encoding \texttt{5}. Instead they % show little squares, i.e., they produce ``tofu'' if you are % unlucky. % % But the coverage is so random that it is impossible to sort them % properly and if we tried to ensure that they only typeset those % glyphs that are really always available, we would have to put them all into % sub-encoding \texttt{9}; so putting them into 5 is really a compromise. % % Modern fonts usually don't typeset a tofu character if a glyph is % missing. They are therefore only classified as sub-encoding \texttt{5} if they % really support its glyph set completely. % \begin{macrocode} \DeclareTextCommandDefault{\textestimated} {\tc@check@symbol5\textestimated} \DeclareTextCommandDefault{\textnumero} {\tc@check@symbol5\textnumero} % \end{macrocode} % % % % % \subsection{Unavailable in sub-encoding \texttt{6} and higher} % % \begin{macrocode} \DeclareTextCommandDefault{\textflorin} {\tc@check@symbol6\textflorin} \DeclareTextCommandDefault{\textcurrency} {\tc@check@symbol6\textcurrency} % \end{macrocode} % % % % \subsection{Unavailable in sub-encoding \texttt{7} and higher} % % \begin{macrocode} \DeclareTextCommandDefault{\textfractionsolidus} {\tc@check@symbol7\textfractionsolidus} \DeclareTextCommandDefault{\textohm} {\tc@check@symbol7\textohm} \DeclareTextCommandDefault{\textmu} {\tc@check@symbol7\textmu} \DeclareTextCommandDefault{\textminus} {\tc@check@symbol7\textminus} % \end{macrocode} % % % % \subsection{Unavailable in sub-encoding \texttt{8} and higher} % % \begin{macrocode} \DeclareTextCommandDefault{\textblank} {\tc@check@symbol{8}\textblank} \DeclareTextCommandDefault{\textinterrobangdown} {\tc@check@symbol{8}\textinterrobangdown} \DeclareTextCommandDefault{\textinterrobang} {\tc@check@symbol{8}\textinterrobang} % \end{macrocode} % % Fonts with this sub-encoding don't have a Euro symbol, but % instead of substituting we fake it. % \begin{macrocode} \DeclareTextCommandDefault{\texteuro} {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro{8}\texteuro} % \end{macrocode} % % % % % \subsection{Unavailable in Sub-encoding \texttt{9} (most missing)} % % \begin{macrocode} \DeclareTextCommandDefault{\textcelsius} {\tc@check@symbol{9}\textcelsius} \DeclareTextCommandDefault{\textonesuperior} {\tc@check@symbol{9}\textonesuperior} \DeclareTextCommandDefault{\textthreequartersemdash} {\tc@check@symbol{9}\textthreequartersemdash} \DeclareTextCommandDefault{\textthreesuperior} {\tc@check@symbol{9}\textthreesuperior} \DeclareTextCommandDefault{\texttwelveudash} {\tc@check@symbol{9}\texttwelveudash} \DeclareTextCommandDefault{\texttwosuperior} {\tc@check@symbol{9}\texttwosuperior} \DeclareTextCommandDefault{\textbardbl} {\tc@check@symbol{9}\textbardbl} % \end{macrocode} % % % % % \section{Unicode engine specials} % % If we are using a unicode engine we handle some glyphs differently, % so this here are the definitions for the Unicode encoding % (overwriting the defaults above). % \begin{macrocode} \ifx \Umathcode\@undefined \else % \end{macrocode} % % This set should be taken from \texttt{TS1} encoding even if it % means you get it from the default font for that encoding. % \begin{macrocode} %\DeclareTextSymbol{\textcopyleft}{TS1}{171} %\DeclareTextSymbol{\textdblhyphen}{TS1}{45} %\DeclareTextSymbol{\textdblhyphenchar}{TS1}{127} %\DeclareTextSymbol{\textquotestraightbase}{TS1}{13} %\DeclareTextSymbol{\textquotestraightdblbase}{TS1}{18} %\DeclareTextSymbol{\textleaf}{TS1}{108} %\DeclareTextSymbol{\texttwelveudash}{TS1}{21} %\DeclareTextSymbol{\textthreequartersemdash}{TS1}{22} % \end{macrocode} % % If oldstyle numerals are asked for we just use \cs{oldstylenums}. % \begin{macrocode} \DeclareTextCommand{\textzerooldstyle} \UnicodeEncodingName{\oldstylenums{0}} \DeclareTextCommand{\textoneoldstyle} \UnicodeEncodingName{\oldstylenums{1}} \DeclareTextCommand{\texttwooldstyle} \UnicodeEncodingName{\oldstylenums{2}} \DeclareTextCommand{\textthreeoldstyle}\UnicodeEncodingName{\oldstylenums{3}} \DeclareTextCommand{\textfouroldstyle} \UnicodeEncodingName{\oldstylenums{4}} \DeclareTextCommand{\textfiveoldstyle} \UnicodeEncodingName{\oldstylenums{5}} \DeclareTextCommand{\textsixoldstyle} \UnicodeEncodingName{\oldstylenums{6}} \DeclareTextCommand{\textsevenoldstyle}\UnicodeEncodingName{\oldstylenums{7}} \DeclareTextCommand{\texteightoldstyle}\UnicodeEncodingName{\oldstylenums{8}} \DeclareTextCommand{\textnineoldstyle} \UnicodeEncodingName{\oldstylenums{9}} % \end{macrocode} % These have Unicode slots so this should be integrated into TU explicitly % \begin{macrocode} \DeclareTextSymbol{\textpilcrow} \UnicodeEncodingName{"00B6} \DeclareTextSymbol{\textborn} \UnicodeEncodingName{"002A} \DeclareTextSymbol{\textdied} \UnicodeEncodingName{"2020} \DeclareTextSymbol{\textlbrackdbl} \UnicodeEncodingName{"27E6} \DeclareTextSymbol{\textrbrackdbl} \UnicodeEncodingName{"27E7} \DeclareTextSymbol{\textguarani} \UnicodeEncodingName{"20B2} % \end{macrocode} % We could make \cs{textcentoldstyle} and \cs{textdollaroldstyle} % point to dollar and cent in the Unicode encoding % \begin{macrocode} %\DeclareTextSymbol{\textcentoldstyle} \UnicodeEncodingName{"00A2} %\DeclareTextSymbol{\textdollaroldstyle}\UnicodeEncodingName{"0024} % \end{macrocode} % but I think it is better to pick them up from TS1 even if that % usually means LMR fonts % \begin{macrocode} \DeclareTextSymbol{\textdollaroldstyle}{TS1}{138} \DeclareTextSymbol{\textcentoldstyle} {TS1}{139} % \end{macrocode} % % % \begin{macrocode} \fi % --- END of Unicode engines specials % \end{macrocode} % % \section{Font family sub-encodings setup} % % We declare the subsets for a good number of fonts in the kernel % \ldots % % But first the default for anything that is not declared. We use % \texttt{9} which is most likely much too conservative, but with the % advantage that we aren't getting missing glyphs (or at least that % this is very unlikely). % For nearly all font in the \TeX{} Live distribution of 2019 % ``correct'' classifications are given below, so that this default % is only used for new font families, and over time the right % classifications can be added here too. % \begin{macrocode} \DeclareEncodingSubset{TS1}{?}{9} % \end{macrocode} % % This first block contains the fonts that have been already % supported by the \texttt{textcomp} package way back, i.e., the % font families that have \TeX{} support since the mid-nineties. % \changes{v1.1a}{2024/01/27}{Adjusted/corrected TS1 sub-encoding % declarations for various families (gh/1257)} % \begin{macrocode} \DeclareEncodingSubset{TS1}{ccr} {0} \DeclareEncodingSubset{TS1}{cmbr} {0} \DeclareEncodingSubset{TS1}{cmr} {0} \DeclareEncodingSubset{TS1}{cmss} {0} \DeclareEncodingSubset{TS1}{cmtl} {0} \DeclareEncodingSubset{TS1}{cmtt} {0} \DeclareEncodingSubset{TS1}{cmvtt} {0} \DeclareEncodingSubset{TS1}{pxr} {0} \DeclareEncodingSubset{TS1}{pxss} {0} \DeclareEncodingSubset{TS1}{pxtt} {0} \DeclareEncodingSubset{TS1}{qag} {0} \DeclareEncodingSubset{TS1}{qbk} {0} \DeclareEncodingSubset{TS1}{qcr} {0} \DeclareEncodingSubset{TS1}{qcs} {0} \DeclareEncodingSubset{TS1}{qhvc} {0} \DeclareEncodingSubset{TS1}{qhv} {0} \DeclareEncodingSubset{TS1}{qpl} {0} \DeclareEncodingSubset{TS1}{qtm} {0} \DeclareEncodingSubset{TS1}{qzc} {0} \DeclareEncodingSubset{TS1}{txr} {0} \DeclareEncodingSubset{TS1}{txss} {0} \DeclareEncodingSubset{TS1}{txtt} {0} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{lmr} {1} \DeclareEncodingSubset{TS1}{lmdh} {1} \DeclareEncodingSubset{TS1}{lmss} {1} \DeclareEncodingSubset{TS1}{lmssq} {1} \DeclareEncodingSubset{TS1}{lmvtt} {1} % \end{macrocode} % The lmtt family is missing TM, SM, and perthousand for some % reason, so the first safe sub-encoding would be 2, but that is % then missing out a huge number of glyphs that are available, so % we claim it is sub-encoding 1 even if this can lead to missing glyphs. % \begin{macrocode} \DeclareEncodingSubset{TS1}{lmtt} {1} % missing TM, SM and pertenthousand % \end{macrocode} % % The next three families have been removed from TeX Live, but we % keep the definitions % \begin{macrocode} \DeclareEncodingSubset{TS1}{ptmx} {2} \DeclareEncodingSubset{TS1}{ptmj} {2} \DeclareEncodingSubset{TS1}{ul8} {2} % \end{macrocode} % % The next set are the early PostScript font implementations, these % days there are better alternatives, but \ldots. Note that, their % virtual fonts contain a lot of ``tofu'' in form of black squares, % thus they don't even give a missing character warning if you % select such a glyph. This is why they are set as sub-encoding 5. % \begin{macrocode} \DeclareEncodingSubset{TS1}{bch} {5} % tofu for blank, ohm \DeclareEncodingSubset{TS1}{futj}{5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{futs}{5} % tofu for blank, ohm \DeclareEncodingSubset{TS1}{futx}{5} % probably (currently broken distrib) \DeclareEncodingSubset{TS1}{pag} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{pbk} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{pcr} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{phv} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{pnc} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{pplj}{5} % tofu for blank \DeclareEncodingSubset{TS1}{pplx}{5} % tofu for blank \DeclareEncodingSubset{TS1}{ppl} {5} % tofu for blank interrobang/down \DeclareEncodingSubset{TS1}{ptm} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{pzc} {5} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{ul9} {5} % tofu for blank, interrobang/down, ohm % \end{macrocode} % % The next set suffers from the same problem and they contain even % fewer real glyphs. % \begin{macrocode} \DeclareEncodingSubset{TS1}{dayroms}{6} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{dayrom} {6} % tofu for blank, interrobang/down, ohm \DeclareEncodingSubset{TS1}{augie}{8} % really only missing euro \DeclareEncodingSubset{TS1}{put} {8} \DeclareEncodingSubset{TS1}{uag} {8} % probably (currently broken distrib) \DeclareEncodingSubset{TS1}{ugq} {8} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{zi4} {9} % \end{macrocode} % % LucidaBright (sold through TUG) probably not quite correct, I % guess as I have the older fonts \ldots % \begin{macrocode} \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} % \end{macrocode} % % Below are the newer fonts that have support files for % \LaTeX{}. With very few exceptions the classifications are done % so that all characters are correctly produced (either being % available in the font or substituted). % % There are a few fonts that contain ``tofu'' squares in places % (instead of a real glyph) and in a few cases some really seldom % needed chars are unavailable, i.e., produce missing glyphs (to % avoid that a large number of available chars are unnecessarily % substituted). % % Encoding declarations for these font families shouldn't really be % in the kernel, but part of the \texttt{.fd} files for the % family. When we introduced the concept in 2021 we had some hope % that this would happen over time and that we could take the % declarations out---after all it is nearly impossible to maintain % it correctly in the kernel, given that fonts may get new glyphs % added (happened for several of them in the recent year) which is % something we wouldn't notice. However, so far this hasn't % happened, so in 2024, I went through the current set and adjusted % the declarations in several places. % % Next four are wrong and still need adjustment: % \begin{macrocode} \DeclareEncodingSubset{TS1}{lato-*} {0} % with a bunch of tofu inside \DeclareEncodingSubset{TS1}{opensans-*} {0} % with a bunch of tofu inside \DeclareEncodingSubset{TS1}{cantarell-*} {0} % with a bunch of tofu inside \DeclareEncodingSubset{TS1}{tli} {1} % with lots of tofu inside % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{fbb-*} {2} % missing centoldstyle % \end{macrocode} % % % \begin{macrocode} \DeclareEncodingSubset{TS1}{Alegreya-*} {2} \DeclareEncodingSubset{TS1}{AlegreyaSans-*} {2} \DeclareEncodingSubset{TS1}{BaskervilleF-*} {2} \DeclareEncodingSubset{TS1}{DejaVuSans-TLF} {2} \DeclareEncodingSubset{TS1}{DejaVuSansCondensed-TLF} {2} % \end{macrocode} % Next one is missing \cs{textfractionsolidus} but is otherwise % completely sub-encoding 2 so we use that sub-encoding. % \begin{macrocode} \DeclareEncodingSubset{TS1}{DejaVuSansMono-TLF} {2} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{EBGaramond-*} {2} \DeclareEncodingSubset{TS1}{Merriwthr-OsF} {2} \DeclareEncodingSubset{TS1}{MerriwthrSans-OsF} {2} \DeclareEncodingSubset{TS1}{Montserrat-*} {2} \DeclareEncodingSubset{TS1}{MontserratAlternates-*} {2} \DeclareEncodingSubset{TS1}{NotoSansMono-TLF} {2} \DeclareEncodingSubset{TS1}{NotoSansMono-TOsF} {2} \DeclareEncodingSubset{TS1}{Tempora-TLF} {2} \DeclareEncodingSubset{TS1}{Tempora-TOsF} {2} \DeclareEncodingSubset{TS1}{XCharter-TLF} {2} \DeclareEncodingSubset{TS1}{XCharter-TOsF} {2} \DeclareEncodingSubset{TS1}{erewhon-*} {2} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{Arimo-TLF} {3} \DeclareEncodingSubset{TS1}{Crlt-*} {3} \DeclareEncodingSubset{TS1}{IBMPlexMono-TLF} {3} \DeclareEncodingSubset{TS1}{IBMPlexSans-TLF} {3} \DeclareEncodingSubset{TS1}{IBMPlexSerif-TLF} {3} \DeclareEncodingSubset{TS1}{SourceCodePro-TLF} {3} \DeclareEncodingSubset{TS1}{SourceCodePro-TOsF} {3} \DeclareEncodingSubset{TS1}{SourceSansPro-*} {3} \DeclareEncodingSubset{TS1}{SourceSerifPro-*} {3} \DeclareEncodingSubset{TS1}{Tinos-TLF} {3} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{AccanthisADFStdNoThree-LF}{4} \DeclareEncodingSubset{TS1}{Cabin-TLF} {4} \DeclareEncodingSubset{TS1}{Caladea-TLF} {4} \DeclareEncodingSubset{TS1}{Chivo-*} {4} \DeclareEncodingSubset{TS1}{ClearSans-TLF} {4} \DeclareEncodingSubset{TS1}{Coelacanth-LF} {4} \DeclareEncodingSubset{TS1}{CrimsonPro-*} {4} \DeclareEncodingSubset{TS1}{FiraMono-TLF} {4} \DeclareEncodingSubset{TS1}{FiraMono-TOsF} {4} \DeclareEncodingSubset{TS1}{FiraSans-*} {4} \DeclareEncodingSubset{TS1}{Go-TLF} {4} \DeclareEncodingSubset{TS1}{GoMono-TLF} {4} \DeclareEncodingSubset{TS1}{InriaSans-*} {4} \DeclareEncodingSubset{TS1}{InriaSerif-*} {4} \DeclareEncodingSubset{TS1}{LibertinusSans-*} {4} \DeclareEncodingSubset{TS1}{LibertinusSerif-*} {4} \DeclareEncodingSubset{TS1}{LibreBodoni-TLF} {4} \DeclareEncodingSubset{TS1}{LibreFranklin-TLF} {4} \DeclareEncodingSubset{TS1}{LinguisticsPro-LF} {4} \DeclareEncodingSubset{TS1}{LinguisticsPro-OsF} {4} \DeclareEncodingSubset{TS1}{LinuxBiolinumT-*} {4} \DeclareEncodingSubset{TS1}{LinuxLibertineT-*} {4} \DeclareEncodingSubset{TS1}{MintSpirit-*} {4} \DeclareEncodingSubset{TS1}{MintSpiritNoTwo-*} {4} \DeclareEncodingSubset{TS1}{PTMono-TLF} {4} \DeclareEncodingSubset{TS1}{PTSans-TLF} {4} \DeclareEncodingSubset{TS1}{PTSansCaption-TLF} {4} \DeclareEncodingSubset{TS1}{PTSansNarrow-TLF} {4} \DeclareEncodingSubset{TS1}{PTSerif-TLF} {4} \DeclareEncodingSubset{TS1}{PTSerifCaption-TLF} {4} \DeclareEncodingSubset{TS1}{Raleway-TLF} {4} \DeclareEncodingSubset{TS1}{Raleway-TOsF} {4} \DeclareEncodingSubset{TS1}{Roboto-*} {4} \DeclareEncodingSubset{TS1}{RobotoMono-TLF} {4} \DeclareEncodingSubset{TS1}{RobotoSlab-TLF} {4} \DeclareEncodingSubset{TS1}{Rosario-*} {4} \DeclareEncodingSubset{TS1}{SticksTooText-*} {4} \DeclareEncodingSubset{TS1}{UniversalisADFStd-LF} {4} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{Almndr-OsF} {5} \DeclareEncodingSubset{TS1}{Baskervaldx-*} {5} \DeclareEncodingSubset{TS1}{Bttr-TLF} {5} \DeclareEncodingSubset{TS1}{Cinzel-LF} {5} \DeclareEncodingSubset{TS1}{CinzelDecorative-LF} {5} \DeclareEncodingSubset{TS1}{Cochineal-*} {5} \DeclareEncodingSubset{TS1}{DejaVuSerif-TLF} {5} \DeclareEncodingSubset{TS1}{DejaVuSerifCondensed-TLF} {5} \DeclareEncodingSubset{TS1}{GilliusADF-LF} {5} \DeclareEncodingSubset{TS1}{GilliusADFCond-LF} {5} \DeclareEncodingSubset{TS1}{GilliusADFNoTwo-LF} {5} \DeclareEncodingSubset{TS1}{GilliusADFNoTwoCond-LF} {5} \DeclareEncodingSubset{TS1}{OldStandard-TLF} {5} \DeclareEncodingSubset{TS1}{PlyfrDisplay-TLF} {5} \DeclareEncodingSubset{TS1}{PlyfrDisplay-TOsF} {5} \DeclareEncodingSubset{TS1}{TheanoDidot-TLF} {5} \DeclareEncodingSubset{TS1}{TheanoDidot-TOsF} {5} \DeclareEncodingSubset{TS1}{TheanoModern-TLF} {5} \DeclareEncodingSubset{TS1}{TheanoModern-TOsF} {5} \DeclareEncodingSubset{TS1}{TheanoOldStyle-TLF} {5} \DeclareEncodingSubset{TS1}{TheanoOldStyle-TOsF} {5} \DeclareEncodingSubset{TS1}{charssil-TLF} {5} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{Crimson-TLF} {6} \DeclareEncodingSubset{TS1}{LibertinusSerifDisplay-LF}{6} \DeclareEncodingSubset{TS1}{LinuxLibertineDisplayT-*} {6} \DeclareEncodingSubset{TS1}{LinuxLibertineMonoT-LF} {6} \DeclareEncodingSubset{TS1}{LinuxLibertineMonoT-TLF} {6} \DeclareEncodingSubset{TS1}{Ovrlck-LF} {6} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{ComicNeue-TLF} {7} \DeclareEncodingSubset{TS1}{ComicNeueAngular-TLF} {7} \DeclareEncodingSubset{TS1}{CormorantGaramond-*} {7} \DeclareEncodingSubset{TS1}{Heuristica-TLF} {7} \DeclareEncodingSubset{TS1}{Heuristica-TOsF} {7} \DeclareEncodingSubset{TS1}{IMFELLEnglish-TLF} {7} \DeclareEncodingSubset{TS1}{LibreBskrvl-TLF} {7} \DeclareEncodingSubset{TS1}{LibreCsln-*} {7} \DeclareEncodingSubset{TS1}{Lbstr-LF} {7} \DeclareEncodingSubset{TS1}{Mrcls-LF} {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. % \begin{macrocode} \DeclareEncodingSubset{TS1}{NotoSans-*} {7} \DeclareEncodingSubset{TS1}{NotoSerif-*} {7} \DeclareEncodingSubset{TS1}{Quattro-LF} {7} \DeclareEncodingSubset{TS1}{QuattroSans-LF} {7} \DeclareEncodingSubset{TS1}{Frm-LF} {7} % the superiors are missing % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{LibertinusMono-TLF} {8} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{AlgolRevived-TLF} {9} % \end{macrocode} % % % % % \section{Legacy symbol support for lists and footnote symbols} % % \begin{macro}{\UseLegacyTextSymbols} % % \begin{macrocode} \def\UseLegacyTextSymbols{% \DeclareTextSymbolDefault{\textasteriskcentered}{OMS}% \DeclareTextSymbolDefault{\textbardbl}{OMS}% \DeclareTextSymbolDefault{\textbullet}{OMS}% \DeclareTextSymbolDefault{\textdaggerdbl}{OMS}% \DeclareTextSymbolDefault{\textdagger}{OMS}% \DeclareTextSymbolDefault{\textparagraph}{OMS}% \DeclareTextSymbolDefault{\textperiodcentered}{OMS}% \DeclareTextSymbolDefault{\textsection}{OMS}% \UndeclareTextCommand{\textsection}{T1}% \expandafter\let\csname oldstylenums \expandafter\endcsname \csname legacyoldstylenums \endcsname } % \end{macrocode} % \end{macro} % \begin{macro}{\textlegacyasteriskcentered} % \begin{macro}{\textlegacybardbl} % \begin{macro}{\textlegacybullet} % \begin{macro}{\textlegacydaggerdbl} % \begin{macro}{\textlegacydagger} % \begin{macro}{\textlegacyparagraph} % \begin{macro}{\textlegacyperiodcentered} % \begin{macro}{\textlegacysection} % % Here are new names for the legacy symbols that \LaTeX{} used to % pick up from the \texttt{OMS} encoded fonts (and used for itemize % lists or footnote symbols). % % We go the roundabout way via separate OMS declarations so that %\begin{verbatim} % \renewcommand\textbullet{\textlegacybullet} %\end{verbatim} % doesn't produce an endless loop. % \begin{macrocode} \DeclareTextSymbol{\textlegacyasteriskcentered}{OMS}{3} % "03 \DeclareTextSymbol{\textlegacybardbl}{OMS}{107} % "6B \DeclareTextSymbol{\textlegacybullet}{OMS}{15} % "0F \DeclareTextSymbol{\textlegacydaggerdbl}{OMS}{122} % "7A \DeclareTextSymbol{\textlegacydagger}{OMS}{121} % "79 \DeclareTextSymbol{\textlegacyparagraph}{OMS}{123} % "7B \DeclareTextSymbol{\textlegacyperiodcentered}{OMS}{1} % "01 \DeclareTextSymbol{\textlegacysection}{OMS}{120} % "78 % \end{macrocode} % % \begin{macrocode} \DeclareTextSymbolDefault{\textlegacyasteriskcentered}{OMS} \DeclareTextSymbolDefault{\textlegacybardbl}{OMS} \DeclareTextSymbolDefault{\textlegacybullet}{OMS} \DeclareTextSymbolDefault{\textlegacydaggerdbl}{OMS} \DeclareTextSymbolDefault{\textlegacydagger}{OMS} \DeclareTextSymbolDefault{\textlegacyparagraph}{OMS} \DeclareTextSymbolDefault{\textlegacyperiodcentered}{OMS} \DeclareTextSymbolDefault{\textlegacysection}{OMS} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % % Supporting rollback \ldots % \begin{macrocode} % % %\IncludeInRelease{0000/00/00}% % {lttextcomp}{Undefine text companion symbols}% % %\DeclareRobustCommand\oldstylenums[1]{% % \begingroup % \spaceskip\fontdimen\tw@\font % \usefont{OML}{\rmdefault}{\f@series}{it}% % \mathgroup\symletters #1% % \endgroup %} %\let\legacyoldstylenums\@undefined %\def\textcompsubstdefault{cmr} % %\let\DeclareEncodingSubset\@undefined %\let\CheckEncodingSubset\@undefined % %\DeclareTextSymbolDefault{\textdollar}{OT1} %\DeclareTextSymbolDefault{\textsterling}{OT1} %\DeclareTextCommand{\textdollar}{OT1}{\hmode@bgroup % \ifdim \fontdimen\@ne\font >\z@ % \slshape % \else % \upshape % \fi % \char`\$\egroup} %\DeclareTextCommand{\textsterling}{OT1}{\hmode@bgroup % \ifdim \fontdimen\@ne\font >\z@ % \itshape % \else % \fontshape{ui}\selectfont % \fi % \char`\$\egroup} %\DeclareTextCommand{\textperthousand}{T1} % {\%\char 24 } % %\DeclareTextSymbolDefault{\textasteriskcentered}{OMS} %\DeclareTextSymbolDefault{\textbullet}{OMS} %\DeclareTextSymbolDefault{\textdaggerdbl}{OMS} %\DeclareTextSymbolDefault{\textdagger}{OMS} %\DeclareTextSymbolDefault{\textparagraph}{OMS} %\DeclareTextSymbolDefault{\textperiodcentered}{OMS} %\DeclareTextSymbolDefault{\textsection}{OMS} % %\DeclareTextSymbolDefault{\textbardbl}{OMS} %\let\textbrokenbar\@undefined %\let\textcelsius\@undefined %\let\textcent\@undefined %\DeclareTextCommandDefault{\textcopyright} % {\textcircled{c}} %\let\textdegree\@undefined %\let\textdiv\@undefined %\let\textlnot\@undefined %\let\textonehalf\@undefined %\let\textonequarter\@undefined %\let\textonesuperior\@undefined %\DeclareTextCommandDefault{\textordfeminine} % {\textsuperscript{a}} %\DeclareTextCommandDefault{\textordmasculine} % {\textsuperscript{o}} %\let\textpm\@undefined %\let\textquotesingle\@undefined %\let\textquotestraightbase\@undefined %\let\textquotestraightdblbase\@undefined %\DeclareTextCommandDefault{\textregistered} % {\textcircled{% % \check@mathfonts\fontsize\sf@size\z@ % \math@fontsfalse\selectfont R}} %\let\textthreequartersemdash\@undefined %\let\textthreequarters\@undefined %\let\textthreesuperior\@undefined %\let\texttimes\@undefined %\DeclareTextCommandDefault{\texttrademark} % {\textsuperscript{TM}} %\let\texttwelveudash\@undefined %\let\texttwosuperior\@undefined %\let\textyen\@undefined % %\let\textcapitalcompwordmark\@undefined %\let\textascendercompwordmark\@undefined % %\DeclareTextAccentDefault{\textcircled}{OMS} %\DeclareTextAccentDefault{\t}{OML} % %\let\capitalacute\@undefined %\let\capitalbreve\@undefined %\let\capitalcaron\@undefined %\let\capitalcedilla\@undefined %\let\capitalcircumflex\@undefined %\let\capitaldieresis\@undefined %\let\capitaldotaccent\@undefined %\let\capitalgrave\@undefined %\let\capitalhungarumlaut\@undefined %\let\capitalmacron\@undefined %\let\capitalnewtie\@undefined %\let\capitalogonek\@undefined %\let\capitalring\@undefined %\let\capitaltie\@undefined %\let\capitaltilde\@undefined %\let\newtie\@undefined % %\let\textlbrackdbl\@undefined %\let\textrbrackdbl\@undefined % %\let\texteightoldstyle\@undefined %\let\textfiveoldstyle\@undefined %\let\textfouroldstyle\@undefined %\let\textnineoldstyle\@undefined %\let\textoneoldstyle\@undefined %\let\textsevenoldstyle\@undefined %\let\textsixoldstyle\@undefined %\let\textthreeoldstyle\@undefined %\let\texttwooldstyle\@undefined %\let\textzerooldstyle\@undefined % %\let\textacutedbl\@undefined %\let\textasciiacute\@undefined %\let\textasciibreve\@undefined %\let\textasciicaron\@undefined %\let\textasciidieresis\@undefined %\let\textasciigrave\@undefined %\let\textasciimacron\@undefined %\let\textgravedbl\@undefined %\let\texttildelow\@undefined % %\let\textbaht\@undefined %\let\textbigcircle\@undefined %\let\textborn\@undefined %\let\textcentoldstyle\@undefined %\let\textcircledP\@undefined %\let\textcopyleft\@undefined %\let\textdblhyphenchar\@undefined %\let\textdblhyphen\@undefined %\let\textdied\@undefined %\let\textdiscount\@undefined %\let\textdivorced\@undefined %\let\textdollaroldstyle\@undefined %\let\textguarani\@undefined %\let\textleaf\@undefined %\let\textlquill\@undefined %\let\textmarried\@undefined %\let\textmho\@undefined %\let\textmusicalnote\@undefined %\let\textnaira\@undefined %\let\textopenbullet\@undefined %\let\textpeso\@undefined %\let\textpilcrow\@undefined %\let\textrecipe\@undefined %\let\textreferencemark\@undefined %\let\textrquill\@undefined %\let\textservicemark\@undefined %\let\textsurd\@undefined % %\DeclareTextCommand{\textpertenthousand}{T1} % {\%\char 24\char 24 } % %\let\textlangle\@undefined %\let\textrangle\@undefined % %\let\textcolonmonetary\@undefined %\let\textdong\@undefined %\let\textdownarrow\@undefined %\let\textleftarrow\@undefined %\let\textlira\@undefined %\let\textrightarrow\@undefined %\let\textuparrow\@undefined %\let\textwon\@undefined % %\let\textestimated\@undefined %\let\textnumero\@undefined % %\let\textflorin\@undefined %\let\textcurrency\@undefined % %\let\textfractionsolidus\@undefined %\let\textohm\@undefined %\let\textmu\@undefined %\let\textminus\@undefined % %\let\textblank\@undefined %\let\textinterrobangdown\@undefined %\let\textinterrobang\@undefined % %\let\texteuro\@undefined % %\let\textcelsius\@undefined %\let\textonesuperior\@undefined %\let\textthreequartersemdash\@undefined %\let\textthreesuperior\@undefined %\let\texttwelveudash\@undefined %\let\texttwosuperior\@undefined %\let\textbardbl\@undefined % %\let\UseLegacyTextSymbols\@undefined %\let\textlegacyasteriskcentered\@undefined %\let\textlegacybardbl\@undefined %\let\textlegacybullet\@undefined %\let\textlegacydaggerdbl\@undefined %\let\textlegacydagger\@undefined %\let\textlegacyparagraph\@undefined %\let\textlegacyperiodcentered\@undefined %\let\textlegacysection\@undefined % %\EndModuleRelease % \end{macrocode} % % % % \section{The \texttt{textcomp} package} % % % \begin{macrocode} %<*TS1sty> \providecommand\DeclareRelease[3]{} \providecommand\DeclareCurrentRelease[2]{} \DeclareRelease{}{2018-08-11}{textcomp-2018-08-11.sty} \DeclareCurrentRelease{}{2020-02-02} \ProvidesPackage{textcomp} [2020/02/02 v2.0n Standard LaTeX package] % \end{macrocode} % % A precaution in case this is used without rebuilding the format. % \changes{v2.0n}{2020/02/05}{Ensure we are on a new format (gh/260)} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[2020/02/02] % \end{macrocode} % % This is implemented by defining the default subset: % \begin{macrocode} \DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}} \DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}} \DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{8}} \DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{9}} % \end{macrocode} % The default is set up in the kernel is ``safe'' these days for % unknown fonts but LaTeX has definitions for most families so it % seldom applies. % % If a different default is used then one needs to check the % results to ensure that there aren't ``missing glyphs''. % % The next set of options define the warning level (default in the % kernel is info only). Using the package options you can change this behavior. % \changes{v2.0n}{2020/02/05}{Changed the package default to info (gh/262)} % \begin{macrocode} \DeclareOption{error} {\gdef\tc@errorwarn{\PackageError{textcomp}}} \DeclareOption{warn} {\gdef\tc@errorwarn#1#2{\PackageWarning{textcomp}{#1}}} \DeclareOption{info} {\gdef\tc@errorwarn#1#2{\PackageInfo{textcomp}{#1}}} \DeclareOption{quiet}{\gdef\tc@errorwarn#1#2{}} % \end{macrocode} % % The ``force'' option basically changes the sub-encoding to that % of the default (which, unless changes, is 9 these days), i.e., it % no longer depends on the font in use. This is mainly there % because it might have been used in older documents, but not % something that is recommended. % \begin{macrocode} \DeclareOption{force}{% \def\CheckEncodingSubset#1#2#3#4#5{% \ifnum #4>% 0\csname #2:?\endcsname \relax \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {#1{#2}}{#3}% #5}% } % \end{macrocode} % % \begin{macrocode} \ExecuteOptions{info} \ProcessOptions\relax % \end{macrocode} % % There is not much else to do nowadays, because everything is % already set up in the \LaTeX{} kernel. % % \begin{macrocode} \InputIfFileExists{textcomp.cfg} {\PackageInfo{textcomp}{Local configuration file used}}{} % \end{macrocode} % % \begin{macrocode} % % \end{macrocode} % % % % \subsection{The old textcomp package code} % % This section contains the old code for the textcomp package and % its documentation. It is only used if we roll back prior to 2020. % Thus all the rest is mainly for historians. Note that the old % code categorized in the sub-encodings only into 6 classes not 10. % % \begin{macrocode} %<*TS1oldsty> \ProvidesPackage{textcomp} [2018/08/11 v2.0j Standard LaTeX package] % \end{macrocode} % % This one is for the |TS1| encoding which contains text symbols % for use with the |T1|-encoded text fonts. It therefore first % inputs the file |TS1enc.def| and then sets (or resets) the % defaults for the symbols it contains. The result of this is that % when one of these symbols is accessed and the current encoding % does not provide it, the symbol will be supplied by a silent, % local change to this encoding. % % Since many PostScript fonts only implement a subset of |TS1| many % commands only produce black blobs of ink. To resolve the % resulting problems a number of options have been introduced and % some code has been developed to distinguish sub-encodings. % % The sub-encodings have a numerical id and are defined as follows % for \texttt{TS1}: % \begin{description} % % \item[\#5] those \texttt{TS1} symbols that are also in the ISO-Adobe % character set; without \verb=textcurrency=, which is often % misused for the Euro. Older Type1 fonts from the non-\TeX{} % world provide only this subset. % % \item[\#4] = \#5 + \verb=\texteuro=. Most newer fonts provide this. % % \item[\#3] = \#4 + \verb=\textomega=. Can also be described as % $\texttt{TS1} \cap (\texttt{ISO-Adobe} \cup % \texttt{MacRoman})$. (Except for the missing "currency".) % % \item[\#2] = \#3 + \verb=\textestimated= + \verb=\textcurrency=. Can % also be described as $\texttt{TS1} \cap % \texttt{Adobe-Western-2}$. This may be relevant for OpenType % fonts, which usually show the Adobe-Western-2 character set. % % \item[\#1] = \texttt{TS1} without \verb=\textcircled= and \verb=\t=. % These two glyphs are often not implemented and if their kernel % defaults are changed commands like \verb=\copyright= % unnecessarily fail. % % \item[\#0] = full \texttt{TS1} % \end{description} % % And here a summary to go in the transcript file: % \begin{macrocode} \PackageInfo{textcomp}{Sub-encoding information:\MessageBreak \space\space 5 = only ISO-Adobe without \string\textcurrency\MessageBreak \space\space 4 = 5 + \string\texteuro\MessageBreak \space\space 3 = 4 + \string\textohm\MessageBreak \space\space 2 = 3 + \noexpand\textestimated+ \string\textcurrency\MessageBreak \space\space 1 = TS1 - \noexpand\textcircled- \string\t\MessageBreak \space\space 0 = TS1 (full)\MessageBreak Font families with sub-encoding setting implement\MessageBreak only a restricted character set as indicated.\MessageBreak Family '?' is the default used for unknown fonts.\MessageBreak See the documentation for details\@gobble} % \end{macrocode} % % \begin{macro}{\DeclareEncodingSubset} % An encoding subset to which a font family belongs is declared by % the command |\DeclareEncodingSubset| that takes the major encoding as the % first argument (e.g., |TS1|), the family name as the second % argument (e.g., |cmr|), and the subset encoding id as a third, % (e.g., |0| for |cmr|). % % The default encoding subset to use when nothing is known about % the current font family is named |?|. % \begin{macrocode} \def\DeclareEncodingSubset#1#2#3{% \@ifundefined{#1:#2}% {\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} % \end{macro} % % % The options for the package are the following: % \begin{description} % \item[safe] % for unknown font families enables only symbols that are also % in the ISO-Adobe character set; without "currency", which is % often misused for the Euro. Older Type1 fonts from the % non-TeX world provide only this subset. % % \item[euro] % enables the ``safe'' symbols plus the |\texteuro| % command. Most newer fonts provide this. % % \item[full] enables all |TS1| commands; useful only with fonts % like EC or CM bright. % % \item[almostfull] % same as ``full'', except that |\textcircled| % and |\t| are \emph{not} redefined from their defaults to avoid % that commands like |\copyright| suddenly no longer work. % % \item[force] % ignore all subset encoding definitions stored in the package % itself or in the configuration file and always use the default % subset as specified by one of the other options (seldom useful, % only dangerous). % \end{description} % % \begin{macro}{\iftc@forced} % Switch used to implement the \texttt{force} option % \begin{macrocode} \newif\iftc@forced \tc@forcedfalse % \end{macrocode} % \end{macro} % This is implemented by defining the default subset: % \begin{macrocode} \DeclareOption{full}{\DeclareEncodingSubset{TS1}{?}{0}} \DeclareOption{almostfull}{\DeclareEncodingSubset{TS1}{?}{1}} \DeclareOption{euro}{\DeclareEncodingSubset{TS1}{?}{4}} \DeclareOption{safe}{\DeclareEncodingSubset{TS1}{?}{5}} % \end{macrocode} % The default is ``almostfull'' which means that old documents will % work except that |\textcircled| and |\t| will use the kernel % defaults (with the advantage that this also works if the current % font, as often the case, doesn't implement these glyphs). % % The ``force'' option simply sets the switch to true. % \begin{macrocode} \DeclareOption{force}{\tc@forcedtrue} % \end{macrocode} % % The suggestions to user is to use the ``safe'' option always % unless that balks in which case they could switch to % ``almostfull'' but then better check their output manually. % % \begin{macrocode} \def\tc@errorwarn{\PackageError} \DeclareOption{warn}{\gdef\tc@errorwarn#1#2#3{\PackageWarning{#1}{#2}}} \DeclareOption{quiet}{\gdef\tc@errorwarn#1#2#3{}} % \end{macrocode} % % \begin{macrocode} \ExecuteOptions{almostfull} \ProcessOptions\relax % \end{macrocode} % % % % % \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} \iftc@forced % \end{macrocode} % If the ``force'' option was given we always use the default for % testing against. % \begin{macrocode} \def\CheckEncodingSubset#1#2#3#4#5{% \ifnum #4>% 0\csname #2:?\endcsname \relax \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {#1{#2}}{#3}% #5% } % \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 \def\CheckEncodingSubset#1#2#3#4#5{% \ifnum #4>% \expandafter\ifx\csname #2:\f@family\endcsname\relax 0\csname #2:?\endcsname \else \csname #2:\f@family\endcsname \fi \relax \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {#1{#2}}{#3}% #5% } \fi % \end{macrocode} % \end{macro} % % \begin{macro}{\tc@subst} % \begin{macrocode} \def\tc@subst#1{% \tc@errorwarn{textcomp}% {Symbol \string#1 not provided by\MessageBreak font family \f@family\space in TS1 encoding.\MessageBreak Default family used instead}\@eha \bgroup\fontfamily\textcompsubstdefault\selectfont#1\egroup } % \end{macrocode} % \end{macro} % % \begin{macro}{\tc@error} % |\tc@error| is going to be used in arg |#3| of % |\CheckEncodingSubset| when a symbol is not available in a % certain font family. It gets pass the encoding it normally lives % in (arg one) and the name of the symbol or accent that has a % problem. % % \begin{macrocode} % error commands take argument: % #1 symbol to be used \def\tc@error#1{% \PackageError{textcomp}% % should be latex error if general {Accent \string#1 not provided by\MessageBreak font family \f@family\space in TS1 encoding}\@eha } % \end{macrocode} % \end{macro} % % % \begin{macro}{\tc@fake@euro} % |\tc@fake@euro| is an example of a ``fake'' definition to use in arg |#3| of % |\CheckEncodingSubset| when a symbol is not available in a % certain font family. Here we produce an Euro symbol by combining % a ``C'' with a ``=''. % \begin{macrocode} \def\tc@fake@euro#1{% \leavevmode \PackageInfo{textcomp}{Faking \noexpand#1for font family \f@family\MessageBreak in TS1 encoding}% \valign{##\cr \vfil\hbox to 0.07em{\dimen@\f@size\p@ \math@fontsfalse \fontsize{.7\dimen@}\z@\selectfont=\hss}% \vfil\cr% \hbox{C}\crcr }% } % \end{macrocode} % \end{macro} % % \begin{macro}{\tc@check@symbol} % \begin{macro}{\tc@check@accent} % These are two abbreviations that we use below to check symbols % and accents in TS1. Only there to save some space, e.g., we can % then write %\begin{verbatim} %\DeclareTextCommandDefault{\textcurrency}{\tc@check@symbol3\textcurrency} %\end{verbatim} % to ensure that |\textcurrency| is only typeset if the current % font has a \texttt{TS1} subset id of less than 3. Otherwise % |\tc@error| is called telling the user that for this font family % |\textcurrency| is not available. % \begin{macrocode} \def\tc@check@symbol{\CheckEncodingSubset\UseTextSymbol{TS1}\tc@subst} \def\tc@check@accent{\CheckEncodingSubset\UseTextAccent{TS1}\tc@error} % \end{macrocode} % \end{macro} % \end{macro} % % We start with the commands that are ``safe'' and which can be % unconditionally set up, first the accents\ldots % \begin{macrocode} \DeclareTextAccentDefault{\capitalcedilla}{TS1} \DeclareTextAccentDefault{\capitalogonek}{TS1} \DeclareTextAccentDefault{\capitalgrave}{TS1} \DeclareTextAccentDefault{\capitalacute}{TS1} \DeclareTextAccentDefault{\capitalcircumflex}{TS1} \DeclareTextAccentDefault{\capitaltilde}{TS1} \DeclareTextAccentDefault{\capitaldieresis}{TS1} \DeclareTextAccentDefault{\capitalhungarumlaut}{TS1} \DeclareTextAccentDefault{\capitalring}{TS1} \DeclareTextAccentDefault{\capitalcaron}{TS1} \DeclareTextAccentDefault{\capitalbreve}{TS1} \DeclareTextAccentDefault{\capitalmacron}{TS1} \DeclareTextAccentDefault{\capitaldotaccent}{TS1} % \end{macrocode} % \ldots and then the other glyphs. % \changes{v1.9p}{1998/06/12}{Renamed \cs{textmacron} pr/2840} % \begin{macrocode} \DeclareTextSymbolDefault{\textcapitalcompwordmark}{TS1} \DeclareTextSymbolDefault{\textascendercompwordmark}{TS1} \DeclareTextSymbolDefault{\textquotestraightbase}{TS1} \DeclareTextSymbolDefault{\textquotestraightdblbase}{TS1} \DeclareTextSymbolDefault{\texttwelveudash}{TS1} \DeclareTextSymbolDefault{\textthreequartersemdash}{TS1} \DeclareTextSymbolDefault{\textdollar}{TS1} \DeclareTextSymbolDefault{\textquotesingle}{TS1} \DeclareTextSymbolDefault{\textasteriskcentered}{TS1} \DeclareTextSymbolDefault{\textfractionsolidus}{TS1} \DeclareTextSymbolDefault{\textminus}{TS1} \DeclareTextSymbolDefault{\textlbrackdbl}{TS1} \DeclareTextSymbolDefault{\textrbrackdbl}{TS1} \DeclareTextSymbolDefault{\textasciigrave}{TS1} \DeclareTextSymbolDefault{\texttildelow}{TS1} \DeclareTextSymbolDefault{\textasciibreve}{TS1} \DeclareTextSymbolDefault{\textasciicaron}{TS1} \DeclareTextSymbolDefault{\textgravedbl}{TS1} \DeclareTextSymbolDefault{\textacutedbl}{TS1} \DeclareTextSymbolDefault{\textdagger}{TS1} \DeclareTextSymbolDefault{\textdaggerdbl}{TS1} \DeclareTextSymbolDefault{\textbardbl}{TS1} \DeclareTextSymbolDefault{\textperthousand}{TS1} \DeclareTextSymbolDefault{\textbullet}{TS1} \DeclareTextSymbolDefault{\textcelsius}{TS1} \DeclareTextSymbolDefault{\textflorin}{TS1} \DeclareTextSymbolDefault{\texttrademark}{TS1} \DeclareTextSymbolDefault{\textcent}{TS1} \DeclareTextSymbolDefault{\textsterling}{TS1} \DeclareTextSymbolDefault{\textyen}{TS1} \DeclareTextSymbolDefault{\textbrokenbar}{TS1} \DeclareTextSymbolDefault{\textsection}{TS1} \DeclareTextSymbolDefault{\textasciidieresis}{TS1} \DeclareTextSymbolDefault{\textcopyright}{TS1} \DeclareTextSymbolDefault{\textordfeminine}{TS1} \DeclareTextSymbolDefault{\textlnot}{TS1} \DeclareTextSymbolDefault{\textregistered}{TS1} \DeclareTextSymbolDefault{\textasciimacron}{TS1} \DeclareTextSymbolDefault{\textdegree}{TS1} \DeclareTextSymbolDefault{\textpm}{TS1} \DeclareTextSymbolDefault{\texttwosuperior}{TS1} \DeclareTextSymbolDefault{\textthreesuperior}{TS1} \DeclareTextSymbolDefault{\textasciiacute}{TS1} \DeclareTextSymbolDefault{\textmu}{TS1} \DeclareTextSymbolDefault{\textparagraph}{TS1} \DeclareTextSymbolDefault{\textperiodcentered}{TS1} \DeclareTextSymbolDefault{\textonesuperior}{TS1} \DeclareTextSymbolDefault{\textordmasculine}{TS1} \DeclareTextSymbolDefault{\textonequarter}{TS1} \DeclareTextSymbolDefault{\textonehalf}{TS1} \DeclareTextSymbolDefault{\textthreequarters}{TS1} \DeclareTextSymbolDefault{\texttimes}{TS1} \DeclareTextSymbolDefault{\textdiv}{TS1} % \end{macrocode} % % The |\texteuro| is only available for subsets with id 4 or % less. Otherwise we fake the glyph using |\tc@fake@euro| % \begin{macrocode} \DeclareTextCommandDefault{\texteuro} {\CheckEncodingSubset\UseTextSymbol{TS1}\tc@fake@euro5\texteuro} % \end{macrocode} % % The |\textohm| is only available for subsets with id 3 or % less. Otherwise we produce an error. % \begin{macrocode} \DeclareTextCommandDefault{\textohm}{\tc@check@symbol4\textohm} % \end{macrocode} % The |\textestimated| and |\textcurrency| are only provided for % fonts with subset encoding with id 2 or less. % \begin{macrocode} \DeclareTextCommandDefault{\textestimated}% {\tc@check@symbol3\textestimated} \DeclareTextCommandDefault{\textcurrency}% {\tc@check@symbol3\textcurrency} % \end{macrocode} % Nearly all of the remaining glyphs are provided only with fonts % with id 1 or 0, i.e., are essentially complete. % \begin{macrocode} \DeclareTextCommandDefault{\capitaltie}% {\tc@check@accent2\capitaltie} \DeclareTextCommandDefault{\newtie}% {\tc@check@accent2\newtie} \DeclareTextCommandDefault{\capitalnewtie}% {\tc@check@accent2\capitalnewtie} \DeclareTextCommandDefault{\textleftarrow}% {\tc@check@symbol2\textleftarrow} \DeclareTextCommandDefault{\textrightarrow}% {\tc@check@symbol2\textrightarrow} \DeclareTextCommandDefault{\textblank}% {\tc@check@symbol2\textblank} \DeclareTextCommandDefault{\textdblhyphen}% {\tc@check@symbol2\textdblhyphen} \DeclareTextCommandDefault{\textzerooldstyle}% {\tc@check@symbol2\textzerooldstyle} \DeclareTextCommandDefault{\textoneoldstyle}% {\tc@check@symbol2\textoneoldstyle} \DeclareTextCommandDefault{\texttwooldstyle}% {\tc@check@symbol2\texttwooldstyle} \DeclareTextCommandDefault{\textthreeoldstyle}% {\tc@check@symbol2\textthreeoldstyle} \DeclareTextCommandDefault{\textfouroldstyle}% {\tc@check@symbol2\textfouroldstyle} \DeclareTextCommandDefault{\textfiveoldstyle}% {\tc@check@symbol2\textfiveoldstyle} \DeclareTextCommandDefault{\textsixoldstyle}% {\tc@check@symbol2\textsixoldstyle} \DeclareTextCommandDefault{\textsevenoldstyle}% {\tc@check@symbol2\textsevenoldstyle} \DeclareTextCommandDefault{\texteightoldstyle}% {\tc@check@symbol2\texteightoldstyle} \DeclareTextCommandDefault{\textnineoldstyle}% {\tc@check@symbol2\textnineoldstyle} \DeclareTextCommandDefault{\textlangle}% {\tc@check@symbol2\textlangle} \DeclareTextCommandDefault{\textrangle}% {\tc@check@symbol2\textrangle} \DeclareTextCommandDefault{\textmho}% {\tc@check@symbol2\textmho} \DeclareTextCommandDefault{\textbigcircle}% {\tc@check@symbol2\textbigcircle} \DeclareTextCommandDefault{\textuparrow}% {\tc@check@symbol2\textuparrow} \DeclareTextCommandDefault{\textdownarrow}% {\tc@check@symbol2\textdownarrow} \DeclareTextCommandDefault{\textborn}% {\tc@check@symbol2\textborn} \DeclareTextCommandDefault{\textdivorced}% {\tc@check@symbol2\textdivorced} \DeclareTextCommandDefault{\textdied}% {\tc@check@symbol2\textdied} \DeclareTextCommandDefault{\textleaf}% {\tc@check@symbol2\textleaf} \DeclareTextCommandDefault{\textmarried}% {\tc@check@symbol2\textmarried} \DeclareTextCommandDefault{\textmusicalnote}% {\tc@check@symbol2\textmusicalnote} \DeclareTextCommandDefault{\textdblhyphenchar}% {\tc@check@symbol2\textdblhyphenchar} \DeclareTextCommandDefault{\textdollaroldstyle}% {\tc@check@symbol2\textdollaroldstyle} \DeclareTextCommandDefault{\textcentoldstyle}% {\tc@check@symbol2\textcentoldstyle} \DeclareTextCommandDefault{\textcolonmonetary}% {\tc@check@symbol2\textcolonmonetary} \DeclareTextCommandDefault{\textwon}% {\tc@check@symbol2\textwon} \DeclareTextCommandDefault{\textnaira}% {\tc@check@symbol2\textnaira} \DeclareTextCommandDefault{\textguarani}% {\tc@check@symbol2\textguarani} \DeclareTextCommandDefault{\textpeso}% {\tc@check@symbol2\textpeso} \DeclareTextCommandDefault{\textlira}% {\tc@check@symbol2\textlira} \DeclareTextCommandDefault{\textrecipe}% {\tc@check@symbol2\textrecipe} \DeclareTextCommandDefault{\textinterrobang}% {\tc@check@symbol2\textinterrobang} \DeclareTextCommandDefault{\textinterrobangdown}% {\tc@check@symbol2\textinterrobangdown} \DeclareTextCommandDefault{\textdong}% {\tc@check@symbol2\textdong} \DeclareTextCommandDefault{\textpertenthousand}% {\tc@check@symbol2\textpertenthousand} \DeclareTextCommandDefault{\textpilcrow}% {\tc@check@symbol2\textpilcrow} \DeclareTextCommandDefault{\textbaht}% {\tc@check@symbol2\textbaht} \DeclareTextCommandDefault{\textnumero}% {\tc@check@symbol2\textnumero} \DeclareTextCommandDefault{\textdiscount}% {\tc@check@symbol2\textdiscount} \DeclareTextCommandDefault{\textopenbullet}% {\tc@check@symbol2\textopenbullet} \DeclareTextCommandDefault{\textservicemark}% {\tc@check@symbol2\textservicemark} \DeclareTextCommandDefault{\textlquill}% {\tc@check@symbol2\textlquill} \DeclareTextCommandDefault{\textrquill}% {\tc@check@symbol2\textrquill} \DeclareTextCommandDefault{\textcopyleft}% {\tc@check@symbol2\textcopyleft} \DeclareTextCommandDefault{\textcircledP}% {\tc@check@symbol2\textcircledP} \DeclareTextCommandDefault{\textreferencemark}% {\tc@check@symbol2\textreferencemark} \DeclareTextCommandDefault{\textsurd}% {\tc@check@symbol2\textsurd} % \end{macrocode} % The |\textcircled| and |\t| are handled specially, unless the % current font has a subset id of 0 (i.e. full \texttt{TS1}) we % pick the symbols up from the math font encodings, i.e., the % third argument to |\CheckEncodingSubset| uses |\UseTextAccent| to % get them from there. % \begin{macrocode} \DeclareTextCommandDefault{\textcircled} {\CheckEncodingSubset\UseTextAccent{TS1}% {\UseTextAccent{OMS}}1\textcircled} \DeclareTextCommandDefault{\t} {\CheckEncodingSubset\UseTextAccent{TS1}% {\UseTextAccent{OML}}1\t} % \end{macrocode} % % Finally input the encoding-specific definitions for % \texttt{TS1} thus making the top-level definitions % optimized for this encoding (and not for the default % encoding). % \changes{v1.9o}{1998/03/20}{Load decls after defaults for speed.} % \begin{macrocode} \input{ts1enc.def} % \end{macrocode} % Now having the new glyphs available we also want to make sure % that they are used. For most cases this will automatically happen % but for some glyphs there are inferior definitions already known % to \LaTeX{} which will prevent the usage of the \texttt{TS1} % versions. So we better % get rid of them: % \changes{v1.9o}{1998/03/20}{Added various \cs{UndeclareTextCommand} % declarations for pr/2783} % \begin{macrocode} \UndeclareTextCommand{\textsterling}{OT1} \UndeclareTextCommand{\textdollar} {OT1} % \end{macrocode} % Similar declarations should probably be made for other encodings % like \texttt{OT4} if they are in use. % \begin{macrocode} %\UndeclareTextCommand{\textsterling}{OT4} %\UndeclareTextCommand{\textdollar} {OT4} % \end{macrocode} % From the \texttt{T1} encoding there are two candidates for removal: % \textperthousand{} and \textpertenthousand{} since these are both % constructed from \% followed by a tiny % `{\fontencoding{T1}\selectfont \char 24}' % rather than being a single glyph. The problem with this % approach is that in PostScript fonts this small zero is usually not % available resulting in \%\rule{3pt}{3pt} rather than % \textperthousand{} while the real glyph (at least for % |\textperthousand|) is available in the PostScript version of % \texttt{TS1}. So for the moment we compromise by removing the % \texttt{T1} declaration for |\textperthousand| but keeping the one % for |\textpertenthousand|. This will have the effect that with % Computer Modern fonts everything will come out (although % \textperthousand{} and \textpertenthousand{} are not taken from the % same physical font) and with PostScript fonts \textperthousand{} % will come out correctly while \textpertenthousand{} will most % likely look like \%\rule{6pt}{3pt} --- which is probably an % improvement over just getting a single `\rule{3pt}{3pt}' to % indicate a completely missing glyph, which would happen if we % also `undeclared' |\textpertenthousand|. % \begin{macrocode} \UndeclareTextCommand{\textperthousand}{T1} %\UndeclareTextCommand{\textpertenthousand}{T1} % \end{macrocode} % % % \subsubsection{Supporting oldstyle digits} % % \begin{macrocode} \DeclareRobustCommand\oldstylenums[1]{% \begingroup \ifmmode \mathgroup\symletters #1% \else \CheckEncodingSubset\@use@text@encoding{TS1}% {\PackageWarning{textcomp}% {Oldstyle digits unavailable for family \f@family.\MessageBreak Lining digits used instead}}% \tw@{#1}% \fi \endgroup } % \end{macrocode} % % \subsubsection{Subset encoding defaults} % % For many font families commonly used in the \TeX{} world we % provide the subset encoding data here. Users can add additional % font families in the file \texttt{textcomp.cfg} if they own other % fonts. % % However, if the option ``forced'' was given then all subset % encoding specifications are ignored, so there is no point in % setting any of them up: % \begin{macrocode} \iftc@forced \else % \end{macrocode} % % Computer modern based fonts (e.g., CM, CM-Bright, Concrete): % \begin{macrocode} \DeclareEncodingSubset{TS1}{cmr} {0} \DeclareEncodingSubset{TS1}{cmss} {0} \DeclareEncodingSubset{TS1}{cmtt} {0} \DeclareEncodingSubset{TS1}{cmvtt} {0} \DeclareEncodingSubset{TS1}{cmbr} {0} \DeclareEncodingSubset{TS1}{cmtl} {0} \DeclareEncodingSubset{TS1}{ccr} {0} % \end{macrocode} % % PSNFSS fonts: % \begin{macrocode} \DeclareEncodingSubset{TS1}{ptm} {4} \DeclareEncodingSubset{TS1}{pcr} {4} \DeclareEncodingSubset{TS1}{phv} {4} \DeclareEncodingSubset{TS1}{ppl} {3} \DeclareEncodingSubset{TS1}{pag} {4} \DeclareEncodingSubset{TS1}{pbk} {4} \DeclareEncodingSubset{TS1}{pnc} {4} \DeclareEncodingSubset{TS1}{pzc} {4} \DeclareEncodingSubset{TS1}{bch} {4} \DeclareEncodingSubset{TS1}{put} {5} % \end{macrocode} % % Other CTAN fonts (probably not complete): % \begin{macrocode} \DeclareEncodingSubset{TS1}{uag} {5} \DeclareEncodingSubset{TS1}{ugq} {5} \DeclareEncodingSubset{TS1}{ul8} {4} \DeclareEncodingSubset{TS1}{ul9} {4} % (LuxiSans, one day) \DeclareEncodingSubset{TS1}{augie} {5} \DeclareEncodingSubset{TS1}{dayrom} {3} \DeclareEncodingSubset{TS1}{dayroms} {3} \DeclareEncodingSubset{TS1}{pxr} {0} \DeclareEncodingSubset{TS1}{pxss} {0} \DeclareEncodingSubset{TS1}{pxtt} {0} \DeclareEncodingSubset{TS1}{txr} {0} \DeclareEncodingSubset{TS1}{txss} {0} \DeclareEncodingSubset{TS1}{txtt} {0} % \end{macrocode} % % Latin Modern and TeX Gyre: % \changes{v1.99k}{2009/10/28}{Added Latin Modern and TeX Gyre subsets} % \changes{v1.99l}{2009/11/04}{Added more Latin Modern and TeX Gyre subsets} % \changes{v1.99m}{2015/02/16}{Added lmtt (Heiko Oberdiek) latex/4415} % \begin{macrocode} \DeclareEncodingSubset{TS1}{lmr} {0} \DeclareEncodingSubset{TS1}{lmdh} {0} \DeclareEncodingSubset{TS1}{lmss} {0} \DeclareEncodingSubset{TS1}{lmssq} {0} \DeclareEncodingSubset{TS1}{lmvtt} {0} \DeclareEncodingSubset{TS1}{lmtt} {0} % \end{macrocode} % % \begin{macrocode} \DeclareEncodingSubset{TS1}{qhv} {0} \DeclareEncodingSubset{TS1}{qag} {0} \DeclareEncodingSubset{TS1}{qbk} {0} \DeclareEncodingSubset{TS1}{qcr} {0} \DeclareEncodingSubset{TS1}{qcs} {0} \DeclareEncodingSubset{TS1}{qpl} {0} \DeclareEncodingSubset{TS1}{qtm} {0} \DeclareEncodingSubset{TS1}{qzc} {0} \DeclareEncodingSubset{TS1}{qhvc} {0} % \end{macrocode} % % Fourier-GUTenberg: % \begin{macrocode} \DeclareEncodingSubset{TS1}{futs} {4} \DeclareEncodingSubset{TS1}{futx} {4} \DeclareEncodingSubset{TS1}{futj} {4} % \end{macrocode} % % Y\&Y's Lucida Bright % \begin{macrocode} \DeclareEncodingSubset{TS1}{hlh} {3} \DeclareEncodingSubset{TS1}{hls} {3} \DeclareEncodingSubset{TS1}{hlst} {3} % \end{macrocode} % The remaining settings for Lucida are conservative: the following % fonts contain the |\textohm| character but not the |\texteuro|, % i.e., belong to neither subset~4 nor subset~3. If you want to % use the |\textohm| with these fonts copy these definition to % \texttt{textcomp.cfg} and change the subset to~3. However in that % case make sure that you do not use the |\texteuro|. % \begin{macrocode} \DeclareEncodingSubset{TS1}{hlct} {5} \DeclareEncodingSubset{TS1}{hlx} {5} \DeclareEncodingSubset{TS1}{hlce} {5} \DeclareEncodingSubset{TS1}{hlcn} {5} \DeclareEncodingSubset{TS1}{hlcw} {5} \DeclareEncodingSubset{TS1}{hlcf} {5} % \end{macrocode} % % Other commercial families\ldots % \begin{macrocode} \DeclareEncodingSubset{TS1}{pplx} {3} \DeclareEncodingSubset{TS1}{pplj} {3} \DeclareEncodingSubset{TS1}{ptmx} {4} \DeclareEncodingSubset{TS1}{ptmj} {4} % \end{macrocode} % % If the file \texttt{textcomp.cfg} exists it will be loaded at % this point. This allows to define further subset encodings for % font families not covered by default. % % \begin{macrocode} \InputIfFileExists{textcomp.cfg} {\PackageInfo{textcomp}{Local configuration file used}}{} % \end{macrocode} % % \begin{macrocode} \fi % \end{macrocode} % % \begin{macrocode} % % \end{macrocode} % % % % % \section{The \texttt{checkencodingsubset.tex} file} % % This is a simple file that asks for a name of a font family and % then displays information about the TS1 encoding for this family % and recommends the right encoding subset (to be used with % \cs{DeclareEncodingsubset}) for this family. % \changes{v1.1a}{2024/01/27}{Added check file for encoding subset} % \begin{macrocode} %<*TS1check> \Providesfile{checkencodingsubset.tex} [2024/01/27 v0.5a Figure out safe TS1 encoding subsets] % \end{macrocode} % % \begin{macrocode} \let\typeoutdetails\typeout %\def\typeoutdetails#1{} % alternative definition used below % \end{macrocode} % % For the purpose of this check a glyph exists if the font slot is % occupied---too bad if that contains the wrong glyph or some tofu. % If it ``exists'' we return 0 otherwise 1. This way we can call % this macro several times in a row and obtain a number that is 0 % if all glyphs are existing or greater than 0 if any of them is % missing. % % The second argument (holding the command name for a symbol) is % not used during these tests. % \begin{macrocode} \def\doesglyphexist#1#2{\iffontchar\testFont #1 0\else 1\relax \fi} % \end{macrocode} % % This macro also tests and outputs some information about the % symbol if it is missing. This time we make use of the second % argument. % \begin{macrocode} \def\glyphmissingdetails#1#2{\iffontchar\testFont #1 \else \typeoutdetails{\space\space\space ==> \string#2 (#1) is missing}\fi} % \end{macrocode} % % \begin{macrocode} \newif\ifsafesubencodingfound \newif\ifcoremisses % \end{macrocode} % % Testing a group of symbols that belong to one sub-encoding. More % precisely, the symbols that become unavailable if you change from % sub-encoding $x$ (\texttt{\#2}) to $x+1$ (\texttt{\#3}). As far % as the code is concerned, the % symbols that are supposed to be always available (the core) % become available if we test the group \texttt{-1} and \texttt{0}. % % The first argument contains the testing code and is supposed to % return a single number greater or equal to zero. % \begin{macrocode} \def\testgroup#1#2#3{% \ifnum 0 = #1% \ifnum #2<0 \typeoutdetails{All glyphs in core exist}% \else \typeoutdetails{All glyphs between sub-encoding #2 and #3 exist}% \fi \else \ifnum #2<0 \typeoutdetails{**********************************}% \typeoutdetails{Some glyphs are missing from core:}% \coremissestrue \ifsafesubencodingfound \else \def\subencodingresult{#2}% \fi \else \typeoutdetails{Some glyphs are missing from sub-encoding #2:}% \ifsafesubencodingfound \else \def\subencodingresult{#3}% \fi \fi % \end{macrocode} % If some glyphs are missing, we rerun the test code but this time % using \cs{glyphmissingdetails}. % \begin{macrocode} {\let\doesglyphexist \glyphmissingdetails #1}% % \end{macrocode} % And because we had misses we have definitely found the subset. % \begin{macrocode} \safesubencodingfoundtrue \fi } % \end{macrocode} % % The currently defined subset for the family is either stored in % \cs{TS1:\meta{family}} if it was declared, or it is the default % subset which is stored in \cs{TS1:?}. % \begin{macrocode} \def\currsubencoding#1{\csname TS1:\ifcsname TS1:#1\endcsname #1\else ?\fi\endcsname} % \end{macrocode} % % If a font family is not found when declaring it with % \cs{DeclareFixedFont} we end up with the following font. This can % then be used as a simple test if we failed loading the TS1 font. % \begin{macrocode} \DeclareFixedFont\cmrFont{TS1}{cmr}{m}{n}{10pt} % \end{macrocode} % % Check for all glyphs in all encoding subsets \ldots % \begin{macrocode} \def\testallgroups#1{% \DeclareFixedFont\testFont{TS1}{#1}{m}{n}{10pt}% \ifx\testFont\cmrFont \typeout{***** Font family #1 not found ****}% \else % \end{macrocode} % We haven't checked anything yet. % \begin{macrocode} \safesubencodingfoundfalse \coremissesfalse \typeoutdetails{^^J-----------------------------------------}% \typeoutdetails{Testing font family #1^^J(currently TS1-sub-encoding \currsubencoding{#1})}% \typeout{-----------------------------------------}% % \end{macrocode} % Then we start testing the groups beginning with the glyphs % between sub-encoding 8 and 9. If any of them is missing (checked % with \cs{doesglyphexist}) then we already know that 9 is the % correct answer. % \begin{macrocode} \testgroup{% \doesglyphexist{21}{\texttwelveudash}% \doesglyphexist{22}{\textthreequartersemdash}% \doesglyphexist{134}{\textbardbl}% \doesglyphexist{137}{\textcelsius}% \doesglyphexist{178}{\texttwosuperior}% \doesglyphexist{179}{\textthreesuperior}% \doesglyphexist{185}{\textonesuperior}% }{8}{9}% % \end{macrocode} % Nevertheless we go on with further groups so that the output % lists all missing glyphs. % \begin{macrocode} \testgroup{% \doesglyphexist{32}{\textblank}% \doesglyphexist{148}{\textinterrobang}% \doesglyphexist{149}{\textinterrobangdown}% \doesglyphexist{191}{\texteuro}% }{7}{8}% \testgroup{% \doesglyphexist{47}{\textfractionsolidus}% \doesglyphexist{61}{\textminus}% \doesglyphexist{87}{\textohm}% \doesglyphexist{181}{\textmu}% }{6}{7}% \testgroup{% \doesglyphexist{140}{\textflorin}% \doesglyphexist{164}{\textcurrency}% }{5}{6}% \testgroup{% \doesglyphexist{155}{\textnumero}% \doesglyphexist{157}{\textestimated}% }{4}{5}% \testgroup{% \doesglyphexist{24}{\textleftarrow}% \doesglyphexist{25}{\textrightarrow}% \doesglyphexist{94}{\textuparrow}% \doesglyphexist{95}{\textdownarrow}% \doesglyphexist{141}{\textcolonmonetary}% \doesglyphexist{142}{\textwon}% \doesglyphexist{146}{\textlira}% \doesglyphexist{150}{\textdong}% }{3}{4}% \testgroup{% \doesglyphexist{60}{\textlangle}% \doesglyphexist{62}{\textrangle}% }{2}{3}% \testgroup{% \doesglyphexist{0}{\capitalgrave}% \doesglyphexist{1}{\capitalacute}% \doesglyphexist{2}{\capitalcircumflex}% \doesglyphexist{3}{\capitaltilde}% \doesglyphexist{4}{\capitaldieresis}% \doesglyphexist{5}{\capitalhungarumlaut}% \doesglyphexist{6}{\capitalring}% \doesglyphexist{7}{\capitalcaron}% \doesglyphexist{8}{\capitalbreve}% \doesglyphexist{9}{\capitalmacron}% \doesglyphexist{10}{\capitaldotaccent}% \doesglyphexist{11}{\capitalcedilla}% \doesglyphexist{12}{\capitalogonek}% \doesglyphexist{26}{\t}% \doesglyphexist{27}{\capitaltie}% \doesglyphexist{28}{\newtie}% \doesglyphexist{29}{\capitalnewtie}% \doesglyphexist{45}{\textdblhyphen}% \doesglyphexist{48}{\textzerooldstyle}% \doesglyphexist{49}{\textoneoldstyle}% \doesglyphexist{50}{\texttwooldstyle}% \doesglyphexist{51}{\textthreeoldstyle}% \doesglyphexist{52}{\textfouroldstyle}% \doesglyphexist{53}{\textfiveoldstyle}% \doesglyphexist{54}{\textsixoldstyle}% \doesglyphexist{55}{\textsevenoldstyle}% \doesglyphexist{56}{\texteightoldstyle}% \doesglyphexist{57}{\textnineoldstyle}% \doesglyphexist{77}{\textmho}% \doesglyphexist{79}{\textbigcircle}% \doesglyphexist{91}{\textlbrackdbl}% \doesglyphexist{93}{\textrbrackdbl}% \doesglyphexist{96}{\textasciigrave}% \doesglyphexist{98}{\textborn}% \doesglyphexist{99}{\textdivorced}% \doesglyphexist{100}{\textdied}% \doesglyphexist{108}{\textleaf}% \doesglyphexist{109}{\textmarried}% \doesglyphexist{110}{\textmusicalnote}% \doesglyphexist{126}{\texttildelow}% \doesglyphexist{127}{\textdblhyphenchar}% \doesglyphexist{128}{\textasciibreve}% \doesglyphexist{129}{\textasciicaron}% \doesglyphexist{175}{\textasciimacron}% \doesglyphexist{130}{\textacutedbl}% \doesglyphexist{131}{\textgravedbl}% \doesglyphexist{138}{\textdollaroldstyle}% \doesglyphexist{139}{\textcentoldstyle}% \doesglyphexist{143}{\textnaira}% \doesglyphexist{144}{\textguarani}% \doesglyphexist{145}{\textpeso}% \doesglyphexist{147}{\textrecipe}% \doesglyphexist{152}{\textpertenthousand}% \doesglyphexist{153}{\textpilcrow}% \doesglyphexist{154}{\textbaht}% \doesglyphexist{156}{\textdiscount}% \doesglyphexist{158}{\textopenbullet}% \doesglyphexist{159}{\textservicemark}% \doesglyphexist{160}{\textlquill}% \doesglyphexist{161}{\textrquill}% \doesglyphexist{168}{\textasciidieresis}% \doesglyphexist{171}{\textcopyleft}% \doesglyphexist{173}{\textcircledP}% \doesglyphexist{180}{\textasciiacute}% \doesglyphexist{184}{\textreferencemark}% \doesglyphexist{187}{\textsurd}% }{1}{2}% % \end{macrocode} % All fonts (up to now) that belong to sub-encoding 1 do have the % \cs{textcircled} glyph, but it is too small to be usable. So this % test for this group currently doesn't do much good---but who % knows maybe one day a font shows up in which this glyph is % actually missing. % \begin{macrocode} \testgroup{% \doesglyphexist{79}{\textcircled}% this is not a proper test because the symbol is % usually available but not usable }{0}{1}% \testgroup{% \doesglyphexist{13}{\textquotestraightbase}% \doesglyphexist{18}{\textquotestraightdblbase}% \doesglyphexist{23}{\textcapitalcompwordmark}% \doesglyphexist{31}{\textascendercompwordmark}% \doesglyphexist{36}{\textdollar}% \doesglyphexist{39}{\textquotesingle}% \doesglyphexist{42}{\textasteriskcentered}% \doesglyphexist{132}{\textdagger}% \doesglyphexist{133}{\textdaggerdbl}% \doesglyphexist{135}{\textperthousand}% \doesglyphexist{136}{\textbullet}% \doesglyphexist{151}{\texttrademark}% \doesglyphexist{162}{\textcent}% \doesglyphexist{163}{\textsterling}% \doesglyphexist{165}{\textyen}% \doesglyphexist{166}{\textbrokenbar}% \doesglyphexist{167}{\textsection}% \doesglyphexist{169}{\textcopyright}% \doesglyphexist{170}{\textordfeminine}% \doesglyphexist{172}{\textlnot}% \doesglyphexist{174}{\textregistered}% \doesglyphexist{176}{\textdegree}% \doesglyphexist{177}{\textpm}% \doesglyphexist{182}{\textparagraph}% \doesglyphexist{183}{\textperiodcentered}% \doesglyphexist{186}{\textordmasculine}% \doesglyphexist{188}{\textonequarter}% \doesglyphexist{189}{\textonehalf}% \doesglyphexist{190}{\textthreequarters}% \doesglyphexist{214}{\texttimes}% \doesglyphexist{246}{\textdiv}% }{-1}{0}% % \end{macrocode} % If all groups have all glyphs then we have the full encoding % (subset 0). % \begin{macrocode} \ifsafesubencodingfound\else \def\subencodingresult{0}% \fi % \end{macrocode} % If the font is missing some of the core glyphs we make a remark % about this, because they will never display. % \begin{macrocode} \typeoutdetails{-----------------------------------------}% \typeout{TS1 encoding subset for #1\ifcoremisses \space(ignoring core misses)\fi \space (\ifnum\subencodingresult = \currsubencoding{#1} ok\else bad\fi)}% \typeout{Use sub-encoding \subencodingresult \ifnum\subencodingresult = \currsubencoding{#1}\else \space (not \currsubencoding{#1})\fi} \typeout{-----------------------------------------^^J}% \fi } % \end{macrocode} % % This tests all declarations (or most of them) that have been % added to the kernel. It is called if no family is given interactively. % \begin{macrocode} \long\def\testallkerneldefinedfamilies{% \testallgroups{ccr}% {0} \testallgroups{cmbr}% {0} %%\testallgroups{cmr}% {0} % don't test this one as it is the fallback % thus reports that the family is not found \testallgroups{cmss}% {0} \testallgroups{cmtl}% {0} \testallgroups{cmtt}% {0} \testallgroups{cmvtt}% {0} \testallgroups{pxr}% {0} \testallgroups{pxss}% {0} \testallgroups{pxtt}% {0} \testallgroups{qag}% {0} \testallgroups{qbk}% {0} \testallgroups{qcr}% {0} \testallgroups{qcs}% {0} \testallgroups{qhvc}% {0} \testallgroups{qhv}% {0} \testallgroups{qpl}% {0} \testallgroups{qtm}% {0} \testallgroups{qzc}% {0} \testallgroups{txr}% {0} \testallgroups{txss}% {0} \testallgroups{txtt}% {0} % % Next would claim to be 0 (or 2) % %\testallgroups{lmr}% {1} %\testallgroups{lmdh}% {1} %\testallgroups{lmss}% {1} %\testallgroups{lmssq}% {1} %\testallgroups{lmvtt}% {1} %\testallgroups{lmtt}% {1} % missing TM, SM and pertenthousand so really 2 % % these are no longer in TeX Live % %\testallgroups{ptmx}% {2} % gone for a long time it seems %\testallgroups{ptmj}% {2} % ditto %\testallgroups{ul8}% {2} % ditto % % next block has tofu chars so results are wrong % %\testallgroups{bch}% {5} % tofu for blank, ohm %\testallgroups{futj}%{5} % tofu for blank, interrobang/down, ohm %\testallgroups{futs}%{5} % tofu for blank, ohm %\testallgroups{futx}%{5} % probably (currently broken distrib) %\testallgroups{pag}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{pbk}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{pcr}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{phv}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{pnc}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{pplj}%{5} % tofu for blank %\testallgroups{pplx}%{5} % tofu for blank %\testallgroups{ppl}% {5} % tofu for blank interrobang/down %\testallgroups{ptm}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{pzc}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{ul9}% {5} % tofu for blank, interrobang/down, ohm %\testallgroups{dayroms}%{6} % tofu for blank, interrobang/down, ohm %\testallgroups{dayrom}% {6} % tofu for blank, interrobang/down, ohm %\testallgroups{augie}%{8} % really only missing euro and full of tofu %\testallgroups{put}% {8} %\testallgroups{uag}% {8} % probably (currently broken distrib) %\testallgroups{ugq}% {8} % \testallgroups{zi4}% {9} % %% not installed normally % %\testallgroups{hls}% {5} %\testallgroups{hlst}% {5} %\testallgroups{hlct}% {5} %\testallgroups{hlh}% {5} %\testallgroups{hlx}% {8} %\testallgroups{hlce}% {8} %\testallgroups{hlcn}% {8} %\testallgroups{hlcw}% {8} %\testallgroups{hlcf}% {8} \testallgroups{lato-LF}% {0} % with a bunch of tofu inside --- should probably be changed \testallgroups{opensans-TLF}%{0} % with a bunch of tofu inside --- should probably be changed \testallgroups{cantarell-TLF}% {0} % with a bunch of tofu inside --- should probably be changed \testallgroups{fbb-LF}% {0} % missing centoldstyle ---> 2 \testallgroups{tli}% {1} % with lots of tofu inside --- should probably be changed \testallgroups{Alegreya-OsF}% {2} \testallgroups{AlegreyaSans-OsF}% {2} \testallgroups{DejaVuSans-TLF}% {2} \testallgroups{DejaVuSansCondensed-TLF}% {2} \testallgroups{DejaVuSansMono-TLF}% {2} this is missing \textfractionsolidus which makes it 7 really \testallgroups{EBGaramond-LF}% {2} \testallgroups{Tempora-TLF}% {2} \testallgroups{Tempora-TOsF}% {2} \testallgroups{Arimo-TLF}% {3} \testallgroups{Crlt-TLF}% {3} changed from Carlito- \testallgroups{FiraSans-LF}% {3} should be 4 \testallgroups{IBMPlexSans-TLF}% {3} \testallgroups{Merriwthr-OsF}% {3} changed from Merriweather- and should be 2 \testallgroups{Montserrat-LF}% {3} now 2 \testallgroups{MontserratAlternates-LF}%{3} now 2 \testallgroups{SourceCodePro-TLF}% {3} \testallgroups{SourceCodePro-TOsF}% {3} \testallgroups{SourceSansPro-OsF}% {3} \testallgroups{SourceSerifPro-LF}% {3} \testallgroups{Tinos-TLF}% {3} \testallgroups{AccanthisADFStdNoThree-LF}%{4} \testallgroups{Cabin-TLF}% {4} \testallgroups{Caladea-TLF}% {4} \testallgroups{Chivo-LF}% {4} \testallgroups{ClearSans-TLF}% {4} \testallgroups{Coelacanth-LF}% {4} \testallgroups{CrimsonPro-LF}% {4} \testallgroups{FiraMono-TLF}% {4} \testallgroups{FiraMono-TOsF}% {4} \testallgroups{Go-TLF}% {4} \testallgroups{GoMono-TLF}% {4} \testallgroups{InriaSans-LF}% {4} \testallgroups{InriaSerif-LF}% {4} \testallgroups{LibertinusSans-LF}% {4} \testallgroups{LibertinusSerif-LF}% {4} \testallgroups{LibreBodoni-TLF}% {4} \testallgroups{LibreFranklin-TLF}% {4} \testallgroups{LinguisticsPro-LF}% {4} \testallgroups{LinguisticsPro-OsF}% {4} \testallgroups{LinuxBiolinumT-LF}% {4} \testallgroups{LinuxLibertineT-LF}% {4} \testallgroups{MerriwthrSans-OsF}% {4} name change and now 2 \testallgroups{MintSpirit-LF}% {4} \testallgroups{MintSpiritNoTwo-LF}% {4} \testallgroups{PTMono-TLF}% {4} \testallgroups{PTSans-TLF}% {4} \testallgroups{PTSansCaption-TLF}% {4} \testallgroups{PTSansNarrow-TLF}% {4} \testallgroups{PTSerif-TLF}% {4} \testallgroups{PTSerifCaption-TLF}% {4} \testallgroups{Raleway-TLF}% {4} \testallgroups{Raleway-TOsF}% {4} \testallgroups{Roboto-LF}% {4} \testallgroups{RobotoMono-TLF}% {4} \testallgroups{RobotoSlab-TLF}% {4} \testallgroups{Rosario-LF}% {4} \testallgroups{SticksTooText-LF}% {4} \testallgroups{UniversalisADFStd-LF}%{4} \testallgroups{Almndr-OsF}% {5} name change \testallgroups{Baskervaldx-LF}% {5} \testallgroups{BaskervilleF-LF}% {5} now 2 \testallgroups{Bttr-TLF}% {5} name changed from Bitter-... \testallgroups{Cinzel-LF}% {5} \testallgroups{CinzelDecorative-LF}%{5} \testallgroups{DejaVuSerif-TLF}% {5} \testallgroups{DejaVuSerifCondensed-TLF}% {5} \testallgroups{GilliusADF-LF}% {5} \testallgroups{charssil-TLF} %% missing should be 5 \testallgroups{GilliusADFCond-LF}%{5} \testallgroups{GilliusADFNoTwo-LF}%{5} \testallgroups{GilliusADFNoTwoCond-LF}%{5} \testallgroups{Lbstr-LF}% {5} name change and should be 7 \testallgroups{OldStandard-TLF}% {5} \testallgroups{PlyfrDisplay-LF}%{5} name change \testallgroups{PlyfrDisplay-OsF}% {5} name change \testallgroups{TheanoDidot-TLF}% {5} \testallgroups{TheanoDidot-TOsF}% {5} \testallgroups{TheanoModern-TLF}% {5} \testallgroups{TheanoModern-TOsF}%{5} \testallgroups{TheanoOldStyle-TLF}%{5} \testallgroups{TheanoOldStyle-TOsF}%{5} \testallgroups{Crimson-TLF}% {6} \testallgroups{IBMPlexMono-TLF}% {6} now 3 \testallgroups{IBMPlexSerif-TLF}% {6} now 3 \testallgroups{LibertinusMono-TLF}%{6} should be 8 \testallgroups{LibertinusSerifDisplay-LF}%{6} \testallgroups{LinuxLibertineDisplayT-LF}%{6} \testallgroups{LinuxLibertineMonoT-LF}%{6} \testallgroups{LinuxLibertineMonoT-TLF}%{6} \testallgroups{Ovrlck-LF}% {6} name changed \testallgroups{CormorantGaramond-LF}%{7} \testallgroups{Heuristica-TLF}% {7} \testallgroups{Heuristica-TOsF}% {7} \testallgroups{IMFELLEnglish-TLF}%{7} \testallgroups{LibreBskvl-LF}% {7} %% wrong name LibreBaskerville-TLF \testallgroups{LibreCsln-LF}% {7} changed from LibreCaslon- \testallgroups{Mrcls-LF}% {7} %% wrong name Marcellus-LF \testallgroups{NotoSans-LF}% {7} \testallgroups{NotoSansMono-TLF}%{7} now 2 \testallgroups{NotoSansMono-TOsF}%{7} now 2 \testallgroups{NotoSerif-LF}% {7} \testallgroups{Quattro-LF}% {7} changed from Quattrocento- \testallgroups{QuattroSans-LF}% {7} changed from QuattrocentoSans- \testallgroups{XCharter-TLF}% {7} now 2 \testallgroups{XCharter-TOsF}% {7} now 2 \testallgroups{erewhon-LF}% {7} now 2 \testallgroups{ComicNeue-TLF}% {7} \testallgroups{ComicNeueAngular-TLF}%{7} \testallgroups{Frm-LF}%{7} % the superiors are missing; name changed from Forum-LF \testallgroups{Cochineal-TLF}% {8} now 5 \testallgroups{AlgolRevived-TLF}%{9} } % \end{macrocode} % % There interaction with the user. % \begin{macrocode} \typeout{^^J=====================================================================} \typeout{| Enter font family to check (or for kernel defined families)} \typeout{=====================================================================} \typein[\FontFamilyToCheck]{} % \end{macrocode} % % \begin{macrocode} \if!\FontFamilyToCheck! \typeout{=====================================================================} \typeout{| Detailed output? (default no)} \typeout{=====================================================================} \typein[\Details]{} \if!\Details! \def\typeoutdetails#1{} \else \let\typeoutdetails\typeout \fi \testallkerneldefinedfamilies \else \let\typeoutdetails\typeout \testallgroups\FontFamilyToCheck \fi % \end{macrocode} % % \begin{macrocode} \stop % % \end{macrocode} % % \Finale % \endinput