[latex3-commits] [git/LaTeX3-latex3-latex2e] nfssaxes: provide substitution info in log (e84bc11c)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Oct 8 23:40:23 CEST 2019


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

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

commit e84bc11c2534d561d4e97a591db77e9488c27c7a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Oct 8 23:40:23 2019 +0200

    provide substitution info in log


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

e84bc11c2534d561d4e97a591db77e9488c27c7a
 base/nfssaxes.tex                          | 91 +++++++++++++++++-------------
 base/testfiles-search/tlb-nfssaxes-001.tlg | 10 ++++
 base/testfiles-search/tlb-nfssaxes-002.tlg |  8 +++
 base/testfiles-search/tlb-nfssaxes-003.tlg |  2 +
 base/testfiles/tl2e3.tlg                   |  6 ++
 base/testfiles/tnfss3.tlg                  |  6 ++
 6 files changed, 84 insertions(+), 39 deletions(-)

diff --git a/base/nfssaxes.tex b/base/nfssaxes.tex
index d9afb89c..f4177ae9 100644
--- a/base/nfssaxes.tex
+++ b/base/nfssaxes.tex
@@ -141,8 +141,6 @@
 %    This now defines the new \cs{f at series}:
 %    \begin{macrocode}
 \def\merge at font@series@#1#2#3\@nil{%
-  \def\@reserveda{#3}%
-  \edef\f at series{%
 %    \end{macrocode}
 %    If the third argument is empty there is no database entry for the
 %    combination and the second argument holds the new series so we
@@ -152,40 +150,57 @@
 %    dies if \texttt{\#3} starts with a conditional and in the
 %    definition of \cs{AmSfont} that is actually the case.
 %    \begin{macrocode}
-    \ifx\@reserveda\@empty
-      #2%
-    \else
+  \def\@reserveda{#3}%
+  \ifx\@reserveda\@empty
+    \edef\f at series{#2}%
+  \else
 %    \end{macrocode}
 %    Otherwise we check if the desired result for the series
 %    (\texttt{\#1}) exists for the font family and the current shape.
 %    \begin{macrocode}
-      \expandafter \ifx
-           \csname \f at encoding /\f at family /#1/\f at shape \endcsname
-           \relax
+    \edef\@reserveda{\f at encoding /\f at family /#1/\f at shape}%
+     \ifcsname \@reserveda \endcsname
 %    \end{macrocode}
-%    If not, then we try the alternate result (\texttt{\#2}).
+%     If the desired result is available then we use that:
 %    \begin{macrocode}
-         \expandafter \ifx
-               \csname \f at encoding /\f at family /#2/\f at shape \endcsname
-               \relax
+       \edef\f at series{#1}%
 %    \end{macrocode}
-%    If that doesn't exist either, then we use the requested series unmodified.
+%    If not, then we try the alternate result (\texttt{\#2}).
 %    \begin{macrocode}
-           #3%
+    \else
+       \ifcsname \f at encoding /\f at family /#2/\f at shape \endcsname
 %    \end{macrocode}
 %    If the alternate result exist we use that
 %    \begin{macrocode}
-         \else
-           #2%
-         \fi
+         \edef\f at series{#2}%
+         \@font at shape@subst at warning
+%    \end{macrocode}
+%    If that doesn't exist either, then we use the requested series unmodified.
+%    \begin{macrocode}
+       \else
+         \edef\f at series{#3}%
 %    \end{macrocode}
-%    and if the desired result is available then we use that:
+%    We issue a warning that we didn't managed to change to the desired font.
 %    \begin{macrocode}
-      \else
-         #1%
-      \fi
+         \@font at shape@subst at warning
+       \fi
     \fi
-}}
+  \fi
+}
+%    \end{macrocode}
+%    It is possible that the previous font and the new one are
+%    actually identical (and the font wasn not found because it still
+%    needs loading) in which case a warning  would look rather odd. So
+%    we make a quick check for that (which is the reason why we defined
+%    \cs{@reserveda} above.
+%    \begin{macrocode}
+\def\@font at shape@subst at warning{%
+   \edef\@reservedb{\curr at fontshape}%
+   \ifx\@reserveda\@reservedb \else
+     \@font at warning{Font shape `\@reserveda' undefined\MessageBreak
+                    using `\@reservedb' instead}%
+   \fi
+}
 %    \end{macrocode}
 %  \end{macro}
 
@@ -387,25 +402,23 @@
 %    \begin{macrocode}
 \def\merge at font@shape@#1#2#3\@nil{%
   \def\@reserveda{#3}%
-  \edef\f at shape{%
-    \ifx\@reserveda\@empty
-      #2%
+  \ifx\@reserveda\@empty
+    \edef\f at shape{#2}%
+  \else
+    \edef\@reserveda{\f at encoding /\f at family /\f at series/#1}%
+     \ifcsname \@reserveda\endcsname
+       \edef\f at shape{#1}%
     \else
-      \expandafter \ifx
-           \csname \f at encoding /\f at family /\f at series/#1\endcsname
-           \relax
-         \expandafter \ifx
-               \csname \f at encoding /\f at family /\f at series/#2\endcsname
-               \relax
-           #3%
-         \else
-           #2%
-         \fi
-      \else
-         #1%
-      \fi
+       \ifcsname \f at encoding /\f at family /\f at series/#2\endcsname
+         \edef\f at shape{#2}%
+         \@font at shape@subst at warning
+       \else
+         \edef\f at shape{#3}%
+         \@font at shape@subst at warning
+       \fi
     \fi
-}}
+  \fi
+}
 %    \end{macrocode}
 %  \end{macro}
 
diff --git a/base/testfiles-search/tlb-nfssaxes-001.tlg b/base/testfiles-search/tlb-nfssaxes-001.tlg
index 51ed476f..b55ce06c 100644
--- a/base/testfiles-search/tlb-nfssaxes-001.tlg
+++ b/base/testfiles-search/tlb-nfssaxes-001.tlg
@@ -4,6 +4,8 @@ LaTeX Font Info:    Trying to load font information for T1+lmr on input line ...
 =========== Testing standard shape declarations ==========
 \upshape -> n
 \scshape -> sc
+LaTeX Font Warning: Font shape `T1/lmr/m/scit' undefined
+(Font)              using `T1/lmr/m/scsl' instead on input line ....
 \itshape -> scsl
 \upshape -> sc
 \upshape -> n
@@ -14,17 +16,25 @@ LaTeX Font Info:    Trying to load font information for T1+lmr on input line ...
 =========== Testing low-level \fontshape declarations ==========
 \fontshape{n} -> n
 \fontshape{sc} -> sc
+LaTeX Font Warning: Font shape `T1/lmr/m/scit' undefined
+(Font)              using `T1/lmr/m/scsl' instead on input line ....
 \fontshape{it} -> scsl
 \fontshape{sl} -> scsl
 \fontshape{n} -> sc
 \fontshape{ulc} -> n
 =========== Testing low-level \fontseries declarations ==========
 \fontseries{bx} -> bx
+LaTeX Font Warning: Font shape `T1/lmr/lx/n' undefined
+(Font)              using `T1/lmr/l/n' instead on input line ....
 \fontseries{l} -> l
 LaTeX Font Warning: Font shape `T1/lmr/l/n' undefined
 (Font)              using `T1/lmr/m/n' instead on input line ....
+LaTeX Font Warning: Font shape `T1/lmr/c/n' undefined
+(Font)              using `T1/lmr/m/n' instead on input line ....
 \fontseries{c} -> m
 \fontseries{m} -> m
+LaTeX Font Warning: Font shape `T1/lmr/c/n' undefined
+(Font)              using `T1/lmr/m/n' instead on input line ....
 \fontseries{c} -> m
 \fontseries{b} -> b
 \fontseries{bx} -> bx
diff --git a/base/testfiles-search/tlb-nfssaxes-002.tlg b/base/testfiles-search/tlb-nfssaxes-002.tlg
index f76a4045..d18769cd 100644
--- a/base/testfiles-search/tlb-nfssaxes-002.tlg
+++ b/base/testfiles-search/tlb-nfssaxes-002.tlg
@@ -11,17 +11,25 @@ default nesting of emph
 extended nesting of emph using it,n+sc,it+sc
  -> it
  -> sc
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/it' instead on input line ....
  -> it
  -> n
  -> it
  -> sc
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/it' instead on input line ....
  -> it
 extended nesting of emph using it,n+sc,it+sc in T1/lmr
 LaTeX Font Info:    Trying to load font information for T1+lmr on input line ....
  -> it
  -> sc
+LaTeX Font Warning: Font shape `T1/lmr/m/scit' undefined
+(Font)              using `T1/lmr/m/scsl' instead on input line ....
  -> scsl
  -> n
  -> it
  -> sc
+LaTeX Font Warning: Font shape `T1/lmr/m/scit' undefined
+(Font)              using `T1/lmr/m/scsl' instead on input line ....
  -> scsl
diff --git a/base/testfiles-search/tlb-nfssaxes-003.tlg b/base/testfiles-search/tlb-nfssaxes-003.tlg
index a448558c..c225b5e3 100644
--- a/base/testfiles-search/tlb-nfssaxes-003.tlg
+++ b/base/testfiles-search/tlb-nfssaxes-003.tlg
@@ -1,4 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
 \usefont {OMS}{cmsy}{\if \expandafter \@car \f at series \@nil bb\else m\fi }{n} -> m
+LaTeX Font Warning: Font shape `OMS/cmsy/bx/n' undefined
+(Font)              using `OMS/cmsy/b/n' instead on input line ....
 \usefont {OMS}{cmsy}{\if \expandafter \@car \f at series \@nil bb\else m\fi }{n} -> b
diff --git a/base/testfiles/tl2e3.tlg b/base/testfiles/tl2e3.tlg
index a3dc7aee..a6e23da2 100644
--- a/base/testfiles/tl2e3.tlg
+++ b/base/testfiles/tl2e3.tlg
@@ -18,10 +18,16 @@ LaTeX Font Info:    Font shape `OT1/cmtt/bx/it' in size <9> not available
 (Font)              Font shape `OT1/cmtt/m/it' tried instead on input line ....
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/it' in size <12> not available
 (Font)              Font shape `OT1/cmtt/m/it' tried instead on input line ....
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/sc' instead on input line ....
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/it' instead on input line ....
 LaTeX Font Warning: Font shape `OT1/cmss/m/sc' in size <8> not available
 (Font)              Font shape `OT1/cmr/m/sc' tried instead on input line ...
 LaTeX Font Warning: Font shape `OT1/cmss/m/sc' in size <14.4> not available
 (Font)              Font shape `OT1/cmr/m/sc' tried instead on input line ...
+LaTeX Font Warning: Font shape `OT1/cmtt/m/scsl' undefined
+(Font)              using `OT1/cmtt/m/sl' instead on input line ....
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/sl' in size <14.4> not available
 (Font)              Font shape `OT1/cmtt/m/n' tried instead on input line ...
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/sl' in size <10> not available
diff --git a/base/testfiles/tnfss3.tlg b/base/testfiles/tnfss3.tlg
index ba98ddc8..7e98f8a1 100644
--- a/base/testfiles/tnfss3.tlg
+++ b/base/testfiles/tnfss3.tlg
@@ -19,10 +19,16 @@ LaTeX Font Info:    Font shape `OT1/cmtt/bx/it' in size <9> not available
 (Font)              Font shape `OT1/cmtt/m/it' tried instead on input line ....
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/it' in size <12> not available
 (Font)              Font shape `OT1/cmtt/m/it' tried instead on input line ....
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/sc' instead on input line ....
+LaTeX Font Warning: Font shape `OT1/cmr/m/scit' undefined
+(Font)              using `OT1/cmr/m/it' instead on input line ....
 LaTeX Font Warning: Font shape `OT1/cmss/m/sc' in size <8> not available
 (Font)              Font shape `OT1/cmr/m/sc' tried instead on input line ...
 LaTeX Font Warning: Font shape `OT1/cmss/m/sc' in size <14.4> not available
 (Font)              Font shape `OT1/cmr/m/sc' tried instead on input line ...
+LaTeX Font Warning: Font shape `OT1/cmtt/m/scsl' undefined
+(Font)              using `OT1/cmtt/m/sl' instead on input line ....
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/sl' in size <14.4> not available
 (Font)              Font shape `OT1/cmtt/m/n' tried instead on input line ...
 LaTeX Font Info:    Font shape `OT1/cmtt/bx/sl' in size <10> not available





More information about the latex3-commits mailing list