diff --git a/base/changes.txt b/base/changes.txt index b27bb1399..a83adde21 100644 --- a/base/changes.txt +++ b/base/changes.txt @@ -45,6 +45,11 @@ are not part of the distribution. * ltclass.dtx (section{Implementation}): Initialize \...-h@@k only when loading the package or class (gh/198) +2019-10-11 Frank Mittelbach + + * ltfsstrc.dtx (subsection{Sizefunctions}): + Added 'alias' size function (mainly for autoinst fonts) + ######################### # 2019-10-01 PL 3 Release ######################### diff --git a/base/doc/fntguide.tex b/base/doc/fntguide.tex index f3231a818..59c649996 100644 --- a/base/doc/fntguide.tex +++ b/base/doc/fntguide.tex @@ -38,7 +38,7 @@ \author{\copyright~Copyright 1995--2019, \LaTeX3 Project Team.\\ All rights reserved.} -\date{July 2019} +\date{October 2019} \begin{document} @@ -170,7 +170,7 @@ \section{Text fonts} This section describes the commands available to class and package writers for specifying and selecting fonts. -\subsection{Text font attributes} +\subsection{Text font attributes} \label{sec:textfontattributes} Every text font in \LaTeX{} has five \emph{attributes}: \begin{description} @@ -1214,6 +1214,13 @@ \subsection{Size functions} \item[ssub] Silent variant of `sub', only loggings. +\item[alias] +\NEWfeature{2019/10/15} +Same as `ssub' but with a different logging message. Intended for +cases where the substitution is only done to change the name, e.g., +going from \texttt{regular} series to the official name \texttt{m}. In +that case given a warning that some shape is not found is not correct. + \item[subf] Like the empty function but issues a warning that it has to substitute the external font \m{fontarg} because the desired font shape was not @@ -1603,6 +1610,9 @@ \subsection{Default definitions} \DeclareFontSubstitution{T1}{cmr}{m}{n} \end{verbatim} + + + \subsection{Case changing} \label{sec:case} @@ -1810,15 +1820,25 @@ \subsection{Naming conventions} start with |E|, whilst |U| is for Unknown or Unclassified encodings. \item -Font family names should contain up to five lower case letters. -Where possible, these should conform to the \emph{Filenames for fonts} -font naming scheme. +\NEWdescription{2019/10/15} +Font family names should contain only upper and lower case letters and +hyphen characters. Where possible, these should conform to the +\emph{Filenames for fonts} font naming scheme of the scheme +implemented by \texttt{autoinst} with suffixes such as \texttt{-LF}, +\texttt{-OsF}, etc.\ to indicate different figure styles. \item -Font series names should contain up to four lower case letters. +\NEWdescription{2019/10/15} +Font series names should contain up to four lower case letters. If at +all possible standard names as suggested in +Section~\ref{sec:textfontattributes} should be used. Font specific +names such as \texttt{regular} or \texttt{black}, etc.\ should be at +least aliased to a corresponding standard name. \item -Font shapes should contain up to two letters lower case. +\NEWdescription{2019/10/15} +Font shapes should contain up to four letters lower case. Use the +names suggested in Section~\ref{sec:textfontattributes}. \item Names for symbol fonts are built from lower and upper case letters @@ -1844,6 +1864,63 @@ \subsection{Naming conventions} Note that commands defined in this way must be robust, in case they get put into a section title or other moving argument. + + +\subsection{The order of declaration} + + +\NEWdescription{2019/10/15} +\NFSS{} forces you to give all declarations in a specific order so +that it can check whether you have specified all necessary +information. If you declare objects in the wrong order, it will +complain. Here are the dependencies that you have to obey: +\begin{itemize} +\item +|\DeclareFontFamily| checks that the encoding scheme was previously +declared with |\DeclareFontEncoding|. + +\item +|\DeclareFontShape| checks that the font +family was declared to be available in the requested +encoding (|\DeclareFontFamily|). + +\item +|\DeclareSymbolFont| checks that the encoding scheme is valid. + +\item +|\SetSymbolFont| additionally ensures that the requested math +version was declared (|\DeclareMathVersion|) and that the requested +symbol font was declared (|\DeclareSymbolFont|). + + +\item +|\DeclareSymbolFontAlphabet| checks that the command name for the +alphabet identifier can be used and that the symbol font was declared. + +\item +|\DeclareMathAlphabet| checks that the chosen command name can be +used and that the encoding scheme was declared. + +\item +|\SetMathAlphabet| checks that the alphabet identifier was +previously declared with |\DeclareMathAlphabet| or +|\DeclareSymbolFontAlphabet| and that the math version and the +encoding scheme are known. + +\item +|\DeclareMathSymbol| makes sure that the command name can be used +(i.e., is undefined or was previously declared to be a math symbol) +and that the symbol font was previously declared. + +\item +When the |\begin{document}| command is reached, \NFSS{} makes +some additional checks---for example, verifying that substitution +defaults for every encoding scheme point to known font shape group +declarations. +\end{itemize} + + + \section{If you need to know more \ldots} \NEWdescription{1996/06/01} diff --git a/base/doc/ltnews31.tex b/base/doc/ltnews31.tex index 019b0c41d..deb7df861 100644 --- a/base/doc/ltnews31.tex +++ b/base/doc/ltnews31.tex @@ -248,6 +248,8 @@ \section{Emphasis handling generalized} \section{Other changes to the \LaTeX{} kernel} +\emph{added \texttt{alias} size function} + \emph{fixed gh52} \emph{fixed gh172} @@ -259,6 +261,7 @@ \section{Other changes to the \LaTeX{} kernel} \emph{fixed gh203} + \section{Changes to packages in the \pkg{tools} category} \emph{fixed gh190} diff --git a/base/latexrelease.ins b/base/latexrelease.ins index e51514374..7bdb86cf8 100644 --- a/base/latexrelease.ins +++ b/base/latexrelease.ins @@ -116,7 +116,7 @@ extension .ins) which are part of the distribution. \from{fontdef.dtx} {latexrelease}% (covering fontmath and fonttext) \from{ltfntcmd.dtx} {latexrelease}% empty \from{ltfssbas.dtx} {latexrelease}% - \from{ltfsstrc.dtx} {latexrelease}% empty + \from{ltfsstrc.dtx} {latexrelease}% \from{ltfsscmp.dtx} {latexrelease}% \from{ltpageno.dtx} {latexrelease}% empty \from{ltxref.dtx} {latexrelease}% empty diff --git a/base/ltfsstrc.dtx b/base/ltfsstrc.dtx index 05dafa20c..376faa70a 100644 --- a/base/ltfsstrc.dtx +++ b/base/ltfsstrc.dtx @@ -34,10 +34,10 @@ % %\NeedsTeXFormat{LaTeX2e}[1995/05/16] %\ProvidesPackage{tracefnt} -% [2015/02/21 v3.0k Standard LaTeX package (font tracing)] +% [2019/10/11 v3.0l Standard LaTeX package (font tracing)] % \fi % \ProvidesFile{ltfsstrc.dtx} -% [2015/02/21 v3.0k LaTeX Kernel (NFSS tracing)] +% [2019/10/11 v3.0l LaTeX Kernel (NFSS tracing)] % % \iffalse %<+checkmem>\CHECKMEM @@ -1731,7 +1731,7 @@ % the optional argument (if present) is ignored. The font encoding % scheme cannot be changed. Therefore, the first thing we do is to % prepend the encoding scheme. -% \changes{v2.0b}{1992/07/26}{} +% {documentation fixes} % \begin{macrocode} \DeclareSizeFunction{sub}{\sub@sfcnt\@font@warning} \DeclareSizeFunction{ssub}{\sub@sfcnt\@font@info} @@ -1787,6 +1787,40 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@font@aliasinfo} +% \changes{v3.0l}{2019/10/11}{Added 'alias' size function} +% Sometimes a substitution is only done to map a long font name to +% a standard shape or series, e.g., +%\begin{verbatim} +%\DeclareFontShape{T1}{Roboto-LF}{b}{it}{<-> alias * Roboto-LF/bold/it}{} +%\end{verbatim} +% Using the \texttt{ssub} function in that case will give a strange +% (and incorrect) warning. As an alternative we therefore offer the +% size function \texttt{alias}. It will still add some info into +% the \texttt{.log} file, but no longer complains that the font +% shape is not available. It is implemented by grabbing the default +% warning text and replacing it with a new one. +% \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2020/02/01}% +% {\@font@aliasinfo}{alias size function}% +\DeclareSizeFunction{alias}{\sub@sfcnt\@font@aliasinfo} +\def\@font@aliasinfo#1{% + \@font@info{Font\space shape\space `\curr@fontshape'\space + aliased\space to\MessageBreak `\mandatory@arg'}% +} +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {\@font@aliasinfo}{alias size function}% +%\let\s@fct@alias\@undefined +%\let\@font@aliasinfo\@undefined +% +%\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% \end{macro} % % \begin{macro}{\s@fct@subf} % The |subf| size function allows substitution of another font. The diff --git a/base/testfiles/tlb-latexrelease-003.luatex.tlg b/base/testfiles/tlb-latexrelease-003.luatex.tlg index 8998a3ea4..100546422 100644 --- a/base/testfiles/tlb-latexrelease-003.luatex.tlg +++ b/base/testfiles/tlb-latexrelease-003.luatex.tlg @@ -197,6 +197,8 @@ Skipping: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] Font substituation in preamble on input line .... Skipping: [....-..-..] XeTeX support for \showhyphens on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Skipping: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Skipping: [....-..-..] Add \labelformat and \Ref on input line .... @@ -510,6 +512,8 @@ Already applied: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... LaTeX Info: Redefining \showhyphens on input line .... Already applied: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Already applied: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] Add \labelformat and \Ref on input line .... diff --git a/base/testfiles/tlb-latexrelease-003.tlg b/base/testfiles/tlb-latexrelease-003.tlg index fd942350a..2b0283b0f 100644 --- a/base/testfiles/tlb-latexrelease-003.tlg +++ b/base/testfiles/tlb-latexrelease-003.tlg @@ -195,6 +195,8 @@ Skipping: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] Font substituation in preamble on input line .... Skipping: [....-..-..] XeTeX support for \showhyphens on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Skipping: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Skipping: [....-..-..] Add \labelformat and \Ref on input line .... @@ -502,6 +504,8 @@ Already applied: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... LaTeX Info: Redefining \showhyphens on input line .... Already applied: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Already applied: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] Add \labelformat and \Ref on input line .... diff --git a/base/testfiles/tlb-latexrelease-003.xetex.tlg b/base/testfiles/tlb-latexrelease-003.xetex.tlg index 8923626e6..9b6502683 100644 --- a/base/testfiles/tlb-latexrelease-003.xetex.tlg +++ b/base/testfiles/tlb-latexrelease-003.xetex.tlg @@ -195,6 +195,8 @@ Skipping: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] Font substituation in preamble on input line .... Skipping: [....-..-..] XeTeX support for \showhyphens on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Skipping: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Skipping: [....-..-..] Add \labelformat and \Ref on input line .... @@ -511,6 +513,8 @@ Already applied: [....-..-..] Font substituation in preamble on input line .... Applying: [....-..-..] XeTeX support for \showhyphens on input line .... LaTeX Info: Redefining \showhyphens on input line .... Already applied: [....-..-..] XeTeX support for \showhyphens on input line .... +Skipping: [....-..-..] alias size function on input line .... +Applying: [....-..-..] alias size function on input line .... Applying: [....-..-..] NFSS version1 commands on input line .... Already applied: [....-..-..] NFSS version1 commands on input line .... Applying: [....-..-..] Add \labelformat and \Ref on input line ....