[latex3-commits] [git/LaTeX3-latex3-latex2e] textcomp: support stubst for oldstyle numbers (d04b0b74)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Nov 13 22:44:47 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : textcomp
Link       : https://github.com/latex3/latex2e/commit/d04b0b74aac1097d432c6f4bc86d825710eb37d2

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

commit d04b0b74aac1097d432c6f4bc86d825710eb37d2
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Nov 13 22:44:47 2019 +0100

    support stubst for oldstyle numbers


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

d04b0b74aac1097d432c6f4bc86d825710eb37d2
 base/testfiles-legacy/tlb-textcomp-005.lvt |  2 +-
 base/testfiles-legacy/tlb-textcomp-005.tlg |  2 +-
 base/testfiles-legacy/tlb-textcomp-006.lvt | 30 +++++++++++++
 base/testfiles-legacy/tlb-textcomp-006.tlg | 69 ++++++++++++++++++++++++++++++
 base/textcomp-adds.tex                     | 37 ++++++++++++++++
 5 files changed, 138 insertions(+), 2 deletions(-)

diff --git a/base/testfiles-legacy/tlb-textcomp-005.lvt b/base/testfiles-legacy/tlb-textcomp-005.lvt
index 1307ac9e..f58b491d 100644
--- a/base/testfiles-legacy/tlb-textcomp-005.lvt
+++ b/base/testfiles-legacy/tlb-textcomp-005.lvt
@@ -17,7 +17,7 @@
 
 \START
 
-\typeout{needs also nfssaxes to change defaults nd needs path search - not done}
+\typeout{needs also nfssaxes to change defaults and needs path search - not done}
 
 \rmfamily \textdollaroldstyle \textcentoldstyle
 \sffamily \textdollaroldstyle \textcentoldstyle
diff --git a/base/testfiles-legacy/tlb-textcomp-005.tlg b/base/testfiles-legacy/tlb-textcomp-005.tlg
index bbd66121..eecef8e2 100644
--- a/base/testfiles-legacy/tlb-textcomp-005.tlg
+++ b/base/testfiles-legacy/tlb-textcomp-005.tlg
@@ -1,6 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-needs also nfssaxes to change defaults nd needs path search - not done
+needs also nfssaxes to change defaults and needs path search - not done
 LaTeX Info: Symbol \textdollaroldstyle not provided by
             font family Alegreya-LF in TS1 encoding.
             Default family used instead on input line ....
diff --git a/base/testfiles-legacy/tlb-textcomp-006.lvt b/base/testfiles-legacy/tlb-textcomp-006.lvt
new file mode 100644
index 00000000..471c8115
--- /dev/null
+++ b/base/testfiles-legacy/tlb-textcomp-006.lvt
@@ -0,0 +1,30 @@
+% different defaults
+
+\documentclass{article}
+
+\input{test2e}
+
+\showoutput
+
+
+\renewcommand\rmdefault{lmr}
+\renewcommand\ttdefault{lmtt}
+\DeclareEncodingSubset{TS1}{lmr}     {3}  % pretend LM doesn't have oldstyle
+\DeclareEncodingSubset{TS1}{lmtt}    {3}  % pretend LM doesn't have oldstyle
+
+
+\begin{document}
+
+\START
+
+\typeout{oldstyle in cmr or cmss from TS1}
+
+\oldstylenums{123,4}           % here cmr gets substituted
+
+\sffamily\oldstylenums{567.8}  % this should give cmss
+
+\typeout{needs nfssaxes to work well}
+
+\ttfamily\oldstylenums{0.99}   % this should give cmtt but needs nfssaxes for that ...
+\end{document}
+
diff --git a/base/testfiles-legacy/tlb-textcomp-006.tlg b/base/testfiles-legacy/tlb-textcomp-006.tlg
new file mode 100644
index 00000000..14768285
--- /dev/null
+++ b/base/testfiles-legacy/tlb-textcomp-006.tlg
@@ -0,0 +1,69 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+oldstyle in cmr or cmss from TS1
+LaTeX Info: Oldstyle digits unavailable for family lmr.
+            Default oldstyle digits used instead on input line ....
+LaTeX Font Info:    Trying to load font information for TS1+cmss on input line ....
+needs nfssaxes to work well
+LaTeX Font Info:    Trying to load font information for OT1+lmtt on input line ....
+LaTeX Font Info:    No file OT1lmtt.fd. on input line ....
+LaTeX Font Warning: Font shape `OT1/lmtt/m/n' undefined
+(Font)              using `OT1/cmr/m/n' instead on input line ....
+LaTeX Info: Oldstyle digits unavailable for family lmtt.
+            Default oldstyle digits used instead on input line ....
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 515.94489fil
+...\write-{}
+...\glue(\topskip) 5.62607
+...\hbox(4.37393+1.94397)x345.0, glue set 307.22778fil
+....\hbox(0.0+0.0)x15.0
+....\TS1/cmr/m/n/10 1
+....\TS1/cmr/m/n/10 2
+....\TS1/cmr/m/n/10 3
+....\TS1/cmr/m/n/10 ,
+....\TS1/cmr/m/n/10 4
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 3.50208
+...\hbox(6.55396+1.94397)x345.0, glue set 307.22778fil
+....\hbox(0.0+0.0)x15.0
+....\TS1/cmss/m/n/10 5
+....\TS1/cmss/m/n/10 6
+....\TS1/cmss/m/n/10 7
+....\TS1/cmss/m/n/10 .
+....\TS1/cmss/m/n/10 8
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue(\parskip) 0.0 plus 1.0
+...\glue(\baselineskip) 5.6821
+...\hbox(4.37393+1.94397)x345.0, glue set 312.22656fil
+....\hbox(0.0+0.0)x15.0
+....\TS1/cmr/m/n/10 0
+....\TS1/cmr/m/n/10 .
+....\TS1/cmr/m/n/10 9
+....\TS1/cmr/m/n/10 9
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue -1.94397
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.70276
+..\hbox(6.29724+0.0)x345.0, glue set 170.0fil
+...\glue 0.0 plus 1.0fil
+...\OT1/lmr/m/n/10 1
+...\glue 0.0 plus 1.0fil
+(tlb-textcomp-006.aux)
+LaTeX Font Warning: Some font shapes were not available, defaults substituted.
diff --git a/base/textcomp-adds.tex b/base/textcomp-adds.tex
index 25876eab..01f00709 100644
--- a/base/textcomp-adds.tex
+++ b/base/textcomp-adds.tex
@@ -37,6 +37,38 @@
  \endgroup
 }
 
+\DeclareRobustCommand\oldstylenums[1]{%
+ \begingroup
+ \ifmmode
+   \mathgroup\symletters #1%
+  \else
+   \CheckEncodingSubset\@use at text@encoding{TS1}\tc at oldstyle2{{#1}}%
+ \fi
+ \endgroup
+}
+
+
+
+\def\tc at oldstyle#1{%
+   \tc at errorwarn
+          {Oldstyle digits unavailable for
+           family \f at family.\MessageBreak
+           Default oldstyle digits used instead}\@eha
+  \bgroup
+      \ifx\f at family\rmdef at ult
+         \fontfamily\rmsubstdefault
+      \else\ifx\f at family\sfdef at ult
+         \fontfamily\sfsubstdefault
+      \else\ifx\f at family\ttdef at ult
+         \fontfamily\ttsubstdefault
+      \else
+        \fontfamily\substdefault
+      \fi\fi\fi
+      \fontencoding{TS1}\selectfont#1%
+  \egroup
+}
+
+
 
 \else  % the unicode engine case
 
@@ -601,6 +633,9 @@
 \DeclareEncodingSubset{TS1}{uag}     {8}  % probably (currently broken distrib)
 \DeclareEncodingSubset{TS1}{ugq}     {8}  
 
+\DeclareEncodingSubset{TS1}{zi4}     {9}
+
+
 % LucidaBright (sold through TUG) probably not quite correct as I have the older fonts ...
 %
 \DeclareEncodingSubset{TS1}{hls}     {5}
@@ -614,6 +649,8 @@
 \DeclareEncodingSubset{TS1}{hlcf}    {8}
 
 
+
+
 \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





More information about the latex3-commits mailing list