summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/base/ltfssbas.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltfssbas.dtx')
-rw-r--r--Master/texmf-dist/source/latex/base/ltfssbas.dtx160
1 files changed, 148 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltfssbas.dtx b/Master/texmf-dist/source/latex/base/ltfssbas.dtx
index da9dab5d382..b59b0fafdd6 100644
--- a/Master/texmf-dist/source/latex/base/ltfssbas.dtx
+++ b/Master/texmf-dist/source/latex/base/ltfssbas.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2019
+% Copyright (C) 1993-2020
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
%
@@ -35,7 +35,7 @@
%
%
\ProvidesFile{ltfssbas.dtx}
- [2019/08/27 v3.2d LaTeX Kernel (NFSS Basic Macros)]
+ [2019/12/17 v3.2e LaTeX Kernel (NFSS Basic Macros)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -800,16 +800,11 @@
% \begin{macro}{\f@shape}
% \begin{macrocode}
\DeclareRobustCommand\fontfamily[1]{\edef\f@family{#1}}
-\DeclareRobustCommand\fontseries[1]{\edef\f@series{#1}}
-\DeclareRobustCommand\fontshape [1]{\edef\f@shape{#1}}
% \end{macrocode}
-% Some handy abbreviation if you want to get some particular font
-% in the current size. If also the size should change one has to
-% issue a |\fontsize| command first.
+% There are now defined later (and differently).
% \begin{macrocode}
-\DeclareRobustCommand\usefont[4]{\fontencoding{#1}\fontfamily{#2}%
- \fontseries{#3}\fontshape{#4}\selectfont
- \ignorespaces}
+%\DeclareRobustCommand\fontseries[1]{\edef\f@series{#1}}
+%\DeclareRobustCommand\fontshape [1]{\edef\f@shape{#1}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -819,6 +814,31 @@
% \end{macro}
%
%
+%
+% \begin{macro}{\usefont}
+% Some handy abbreviation if you want to get some particular font
+% in the current size. If also the size should change one has to
+% issue a |\fontsize| command first.
+%
+% \cs{fontencoding} needs to do some setup work so we call that,
+% but instead of calling \cs{fontfamily}, \cs{fontseries} and
+% \cs{fontshape} it earlier versions of this code did, we now set
+% \cs{f@family}, etc.\ directly. If we would call \cs{fontseries}
+% or \cs{fontshape} as it
+% was done in the past, they would now interact with the existing
+% series and shape which is not desired if we intend to use an
+% explicit font shape!
+% \changes{v3.2e}{2019/12/17}{Don't call \cs{fontseries} or \cs{fontshape}}
+% \begin{macrocode}
+\DeclareRobustCommand\usefont[4]{\fontencoding{#1}%
+ \edef\f@family{#2}%
+ \edef\f@series{#3}%
+ \edef\f@shape{#4}\selectfont
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\linespread}
% \changes{v2.1j}{1994/05/12}{New macro}
% \changes{v2.1p}{1994/05/16}{Remove surplus braces}
@@ -1269,6 +1289,122 @@
% \end{macro}
%
%
+%
+% \begin{macro}{\LoadFontDefinitionFile}
+% Load and \texttt{.fd} files for some encoding and family (if it exists).
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease> {\LoadFontDefinitionFile}{Loading .fd files}%
+\def\LoadFontDefinitionFile#1#2{%
+ \begingroup
+ \edef\f@encoding{#1}%
+ \edef\f@family{#2}%
+ \try@load@fontshape
+ \endgroup
+}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\LoadFontDefinitionFile}{Loading .fd files}%
+%<latexrelease>
+%<latexrelease>\let\LoadFontDefinitionFile\@undefined
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+
+% \begin{macro}{\DeclareFontFamilySubstitution}
+% The idea for this macro is stolen from the \texttt{substitutefont}
+% package by Günter Milde, with some modifications and a new name.
+%
+% Its purpose is to provide characters in a special encoding tht
+% are not available in the current font family to be taken from a
+% different family that is visually compatible (or not if you
+% choose badly). For example, you can match the GFS Didot Greek
+% characters with \TeX{} Gyre Pagella (Palatino) by specifying
+%\begin{verbatim}
+% \DeclareFontFamilySubstitution{LGR}{qpl}{udidot}
+%\end{verbatim}
+% This way if you ask for the \texttt{LGR} encoding in for the
+% \texttt{qpl} family you get the characters from the
+% \texttt{udidot} family substituted.
+%
+% We need to ensure that the macro is defined with
+% \cs{nfss@catcodes} in force (not quite sure why at the moment to
+% be honest).
+% \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease> {\DeclareFontFamilySubstitution}{Provide family substituation}%
+\begingroup
+\nfss@catcodes
+\gdef\DeclareFontFamilySubstitution#1#2#3{%
+% \end{macrocode}
+% We only provide a set of silent substitutions. The package also
+% (re)declared the family, but this is incorrect in my eyes and it
+% is better to handle that differently.
+%
+% Of course the families may still need loading at
+% this point and so we arange for this. Otherwise we might run into
+% trouble because the necessary \cs{DeclareFontFamily} has not been
+% seen.
+% \begin{macrocode}
+ \LoadFontDefinitionFile{#1}{#2}%
+ \LoadFontDefinitionFile{#1}{#3}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \DeclareFontShape{#1}{#2}{m}{it}{<->ssub * #3/m/it}{}%
+ \DeclareFontShape{#1}{#2}{m}{n}{<->ssub * #3/m/n}{}%
+ \DeclareFontShape{#1}{#2}{m}{sc}{<->ssub * #3/m/sc}{}%
+ \DeclareFontShape{#1}{#2}{m}{sl}{<->ssub * #3/m/sl}{}%
+% \end{macrocode}
+% These days a few more shapes might be around, so we declare those
+% too. If they don't exist then after the first substitution normal
+% fallbacks will happen.
+% \begin{macrocode}
+ \DeclareFontShape{#1}{#2}{m}{sw}{<->ssub * #3/m/sw}{}%
+ \DeclareFontShape{#1}{#2}{m}{scit}{<->ssub * #3/m/scit}{}%
+ \DeclareFontShape{#1}{#2}{m}{scsl}{<->ssub * #3/m/scsl}{}%
+% \end{macrocode}
+% Same game with \texttt{b} and \texttt{bx}, for other weights you
+% are on your own:
+% \begin{macrocode}
+ \DeclareFontShape{#1}{#2}{b}{it}{<->ssub * #3/b/it}{}%
+ \DeclareFontShape{#1}{#2}{b}{n}{<->ssub * #3/b/n}{}%
+ \DeclareFontShape{#1}{#2}{b}{scit}{<->ssub * #3/b/scit}{}%
+ \DeclareFontShape{#1}{#2}{b}{scsl}{<->ssub * #3/b/scsl}{}%
+ \DeclareFontShape{#1}{#2}{b}{sc}{<->ssub * #3/b/sc}{}%
+ \DeclareFontShape{#1}{#2}{b}{sl}{<->ssub * #3/b/sl}{}%
+ \DeclareFontShape{#1}{#2}{b}{sw}{<->ssub * #3/b/sw}{}%
+ \DeclareFontShape{#1}{#2}{bx}{it}{<->ssub * #3/bx/it}{}%
+ \DeclareFontShape{#1}{#2}{bx}{n}{<->ssub * #3/bx/n}{}%
+ \DeclareFontShape{#1}{#2}{bx}{scit}{<->ssub * #3/bx/scit}{}%
+ \DeclareFontShape{#1}{#2}{bx}{scsl}{<->ssub * #3/bx/scsl}{}%
+ \DeclareFontShape{#1}{#2}{bx}{sc}{<->ssub * #3/bx/sc}{}%
+ \DeclareFontShape{#1}{#2}{bx}{sl}{<->ssub * #3/bx/sl}{}%
+ \DeclareFontShape{#1}{#2}{bx}{sw}{<->ssub * #3/bx/sw}{}%
+}
+\endgroup
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease> {\DeclareFontFamilySubstitution}{Provide family substituation}%
+%<latexrelease>
+%<latexrelease>\let\DeclareFontFamilySubstitution\@undefined
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
% \begin{macro}{\DeclareErrorFont}
% Declare the last resort shape! We assume that in this fontshape
% there is a 10pt font but it doesn't really matter. We only loose
@@ -1323,7 +1459,7 @@
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
-%
+%
% \begin{macrocode}
\@onlypreamble\DeclareErrorFont
% \end{macrocode}
@@ -1389,7 +1525,7 @@
% \begin{macrocode}
\begingroup
\try@load@fontshape
- \endgroup
+ \endgroup
\fi \fi
\fi
% \end{macrocode}