[latex3-commits] [git/LaTeX3-latex3-latex2e] nfssaxes: change \bfdefault to "b" (d62fed80)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Oct 10 15:19:47 CEST 2019


Repository : https://github.com/latex3/latex2e
On branch  : nfssaxes
Link       : https://github.com/latex3/latex2e/commit/d62fed80a6e0803f792eb163cd639ddba898ef14

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

commit d62fed80a6e0803f792eb163cd639ddba898ef14
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Oct 10 15:19:47 2019 +0200

    change \bfdefault to "b"


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

d62fed80a6e0803f792eb163cd639ddba898ef14
 base/nfssaxes.tex                            | 43 +++++++++++----
 base/testfiles-search/tlb-nfssaxes-005.lvt   | 76 ++++++++++++++++++++++++++
 base/testfiles-search/tlb-nfssaxes-005.tlg   | 80 ++++++++++++++++++++++++++++
 base/testfiles/github-robust-0123.luatex.tlg |  2 +-
 base/testfiles/github-robust-0123.tlg        |  2 +-
 base/testfiles/github-robust-0123.xetex.tlg  |  2 +-
 6 files changed, 193 insertions(+), 12 deletions(-)

diff --git a/base/nfssaxes.tex b/base/nfssaxes.tex
index cfb9a1fd..74a5e2c3 100644
--- a/base/nfssaxes.tex
+++ b/base/nfssaxes.tex
@@ -610,7 +610,13 @@
 %    If the test fails we are done and the declarations will be used.
 %    Otherwise we will try the next declaration in the sequence.
 %    \begin{macrocode}
-  \expandafter\ifx\csname\curr at fontshape/\f at size\em at force\expandafter\endcsname\em at currfont
+  \expandafter\ifx\csname \curr at fontshape/\f at size\em at force
+%    \end{macrocode}
+%    For the comparison with \cs{ifx} we have to exand
+%    \cs{em at currfont} once as the relevant info is inside.
+%    \begin{macrocode}
+                          \expandafter\endcsname
+                  \em at currfont
   \expandafter\do at emfont@update\emfontdeclare at clist\do at emfont@update
 %    \end{macrocode}
 %    If \cs{emforce} was used, we have to undo its effect:
@@ -753,11 +759,29 @@
 %    possibly directly).
 %    \begin{macrocode}
 \edef\mdseries at rm{\mddefault}
-\edef\bfseries at rm{\bfdefault}
 \edef\mdseries at sf{\mddefault}
-\edef\bfseries at sf{\bfdefault}
 \edef\mdseries at tt{\mddefault}
-\edef\bfseries at tt{\bfdefault}
+%    \end{macrocode}
+%
+%    Conceptual change: The \cs{bfdefault} will be \texttt{b} not
+%    \texttt{bx} because that is what it should be really for nearly
+%    every font except Computer/Latin Modern.
+%
+%    To account for the fact that by default we typeset in CM or LM we
+%    set up the \cs{bfseries at ..} defaults to use \texttt{bx} instead.
+%
+%    This means that it behaves like before because if the default
+%    fonts are used then \cs{bfseries at rm} etc kick in and make
+%    \cs{textbf} use \texttt{bx}. However, if the font gets changed
+%    then \cs{bfdefault} will get used.
+%    \begin{macrocode}
+\renewcommand\bfdefault{b}
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\edef\bfseries at rm{bx}        
+\edef\bfseries at sf{bx}
+\edef\bfseries at tt{bx}
 %    \end{macrocode}
 %  \end{macro}
 %  \end{macro}
@@ -968,11 +992,12 @@
 
 %  \begin{macro}{\AtBeginDocument}
 %    
-%    If the document preamble has changed the \cs{familydefault} or if the
-%    if the \cs{rmdefault} contains a new font family, we have to
-%    adjust the series defaults accordingly, before starting typesetting. So we run \cs{rmfamily},
-%    \cs{sffamily} or \cs{ttfamily} depending on the situation which
-%    does that (as a sideeffect) for us.
+%    If the document preamble has changed the \cs{familydefault} or if
+%    the if the \cs{rmdefault} contains a new font family, we have to
+%    adjust the series defaults accordingly, before starting
+%    typesetting. So we run \cs{rmfamily}, \cs{sffamily} or
+%    \cs{ttfamily} depending on the situation which does that (as a
+%    sideeffect) for us.
 %    \begin{macrocode}
 \AtBeginDocument{%
   \expand at font@defaults
diff --git a/base/testfiles-search/tlb-nfssaxes-005.lvt b/base/testfiles-search/tlb-nfssaxes-005.lvt
new file mode 100644
index 00000000..211cc04b
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-005.lvt
@@ -0,0 +1,76 @@
+\documentclass{article}
+
+\input{test2e}
+
+
+\makeatletter
+\def\showfont#1{\typeout{#1: \f at encoding/\f at family/\f at series/\f at shape}}
+\makeatother
+
+\begin{document}
+
+\START
+
+\typeout{========== std LaTeX OT1 ==========}
+
+\showfont{start}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\sffamily
+\showfont{sf}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\ttfamily
+\showfont{tt}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\fontfamily{qpl}
+\showfont{palatino}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+  
+ 
+\typeout{========== std LaTeX T1 ==========}
+
+\normalfont\fontencoding{T1}\selectfont
+\showfont{start}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\sffamily
+\showfont{sf}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\ttfamily
+\showfont{tt}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+
+\fontfamily{qpl}
+\showfont{palatino}
+
+Typesetting \textbf{\showfont{bf} bold \textit{\showfont{italic inside} italic}}
+\showfont{toplevel} back
+\textsl{\showfont{sl} slanted \textbf{\showfont{bf inside} bold}}
+  
+ 
+
+\END
diff --git a/base/testfiles-search/tlb-nfssaxes-005.tlg b/base/testfiles-search/tlb-nfssaxes-005.tlg
new file mode 100644
index 00000000..dab9b2a5
--- /dev/null
+++ b/base/testfiles-search/tlb-nfssaxes-005.tlg
@@ -0,0 +1,80 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+========== std LaTeX OT1 ==========
+start: OT1/cmr/m/n
+bf: OT1/cmr/bx/n
+italic inside: OT1/cmr/bx/it
+toplevel: OT1/cmr/m/n
+sl: OT1/cmr/m/sl
+bf inside: OT1/cmr/bx/sl
+sf: OT1/cmss/m/n
+bf: OT1/cmss/bx/n
+LaTeX Font Warning: Font shape `OT1/cmss/bx/it' undefined
+(Font)              using `OT1/cmss/bx/n' instead on input line ....
+italic inside: OT1/cmss/bx/it
+toplevel: OT1/cmss/m/n
+sl: OT1/cmss/m/sl
+LaTeX Font Warning: Font shape `OT1/cmss/bx/sl' undefined
+(Font)              using `OT1/cmss/bx/n' instead on input line ....
+bf inside: OT1/cmss/bx/sl
+tt: OT1/cmtt/m/n
+LaTeX Font Info:    Font shape `OT1/cmtt/bx/n' in size <10> not available
+(Font)              Font shape `OT1/cmtt/m/n' tried instead on input line ...
+bf: OT1/cmtt/bx/n
+LaTeX Font Info:    Font shape `OT1/cmtt/bx/it' in size <10> not available
+(Font)              Font shape `OT1/cmtt/m/it' tried instead on input line ....
+italic inside: OT1/cmtt/bx/it
+toplevel: OT1/cmtt/m/n
+sl: OT1/cmtt/m/sl
+LaTeX Font Info:    Font shape `OT1/cmtt/bx/sl' in size <10> not available
+(Font)              Font shape `OT1/cmtt/m/n' tried instead on input line ...
+bf inside: OT1/cmtt/bx/sl
+palatino: OT1/qpl/m/n
+LaTeX Font Info:    Trying to load font information for OT1+qpl on input line ....
+bf: OT1/qpl/b/n
+italic inside: OT1/qpl/b/it
+toplevel: OT1/qpl/m/n
+LaTeX Font Warning: Font shape `OT1/qpl/m/sl' in size <10> not available
+(Font)              Font shape `OT1/qpl/m/it' tried instead on input line ...
+sl: OT1/qpl/m/sl
+LaTeX Font Warning: Font shape `OT1/qpl/b/sl' in size <10> not available
+(Font)              Font shape `OT1/qpl/b/it' tried instead on input line ...
+bf inside: OT1/qpl/b/sl
+========== std LaTeX T1 ==========
+start: T1/cmr/m/n
+bf: T1/cmr/bx/n
+italic inside: T1/cmr/bx/it
+toplevel: T1/cmr/m/n
+sl: T1/cmr/m/sl
+bf inside: T1/cmr/bx/sl
+LaTeX Font Info:    Trying to load font information for T1+cmss on input line ....
+sf: T1/cmss/m/n
+bf: T1/cmss/bx/n
+italic inside: T1/cmss/bx/it
+toplevel: T1/cmss/m/n
+sl: T1/cmss/m/sl
+bf inside: T1/cmss/bx/sl
+LaTeX Font Info:    Trying to load font information for T1+cmtt on input line ....
+tt: T1/cmtt/m/n
+LaTeX Font Info:    Font shape `T1/cmtt/bx/n' in size <10> not available
+(Font)              Font shape `T1/cmtt/m/n' tried instead on input line ...
+bf: T1/cmtt/bx/n
+LaTeX Font Info:    Font shape `T1/cmtt/bx/it' in size <10> not available
+(Font)              Font shape `T1/cmtt/m/it' tried instead on input line ...
+italic inside: T1/cmtt/bx/it
+toplevel: T1/cmtt/m/n
+sl: T1/cmtt/m/sl
+LaTeX Font Warning: Font shape `T1/cmtt/bx/sl' undefined
+(Font)              using `T1/cmtt/bx/n' instead on input line ....
+bf inside: T1/cmtt/bx/sl
+palatino: T1/qpl/m/n
+LaTeX Font Info:    Trying to load font information for T1+qpl on input line ....
+bf: T1/qpl/b/n
+italic inside: T1/qpl/b/it
+toplevel: T1/qpl/m/n
+LaTeX Font Warning: Font shape `T1/qpl/m/sl' in size <10> not available
+(Font)              Font shape `T1/qpl/m/it' tried instead on input line ...
+sl: T1/qpl/m/sl
+LaTeX Font Warning: Font shape `T1/qpl/b/sl' in size <10> not available
+(Font)              Font shape `T1/qpl/b/it' tried instead on input line ...
+bf inside: T1/qpl/b/sl
diff --git a/base/testfiles/github-robust-0123.luatex.tlg b/base/testfiles/github-robust-0123.luatex.tlg
index f3704f6a..c21a2e32 100644
--- a/base/testfiles/github-robust-0123.luatex.tlg
+++ b/base/testfiles/github-robust-0123.luatex.tlg
@@ -447,7 +447,7 @@ and I'll forget about whatever was undefined.
 ---------------------------------------
 \bezier -> \bezier 
 ---------------------------------------
-\bfdefault -> bx
+\bfdefault -> b
 ---------------------------------------
 \bfseries -> \bfseries 
 ---------------------------------------
diff --git a/base/testfiles/github-robust-0123.tlg b/base/testfiles/github-robust-0123.tlg
index 0bec105e..8c247c65 100644
--- a/base/testfiles/github-robust-0123.tlg
+++ b/base/testfiles/github-robust-0123.tlg
@@ -439,7 +439,7 @@ l. ......fter\show\csname Downarrow\space\endcsname
 ---------------------------------------
 \bezier -> \bezier 
 ---------------------------------------
-\bfdefault -> bx
+\bfdefault -> b
 ---------------------------------------
 \bfseries -> \bfseries 
 ---------------------------------------
diff --git a/base/testfiles/github-robust-0123.xetex.tlg b/base/testfiles/github-robust-0123.xetex.tlg
index 8eda2ecd..61958234 100644
--- a/base/testfiles/github-robust-0123.xetex.tlg
+++ b/base/testfiles/github-robust-0123.xetex.tlg
@@ -447,7 +447,7 @@ and I'll forget about whatever was undefined.
 ---------------------------------------
 \bezier -> \bezier 
 ---------------------------------------
-\bfdefault -> bx
+\bfdefault -> b
 ---------------------------------------
 \bfseries -> \bfseries 
 ---------------------------------------





More information about the latex3-commits mailing list