Skip to content

Commit

Permalink
Set T1 as default encoding if \DocumentMetadata is used (#1388)
Browse files Browse the repository at this point in the history
* Switch to T1 as default with DocumentMetadata

* More testfile updates

* missing braces ...

* update version

* typos from review

* use correct texlive

* preload T1cmtt and T1cmss

* update testfiles

* update tests

* update testfiles

* another testfile

* styling corrections from review

* wording from review
  • Loading branch information
u-fischer authored Sep 4, 2024
1 parent 85f1635 commit 7a9e646
Show file tree
Hide file tree
Showing 178 changed files with 58,493 additions and 50,665 deletions.
3 changes: 3 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2024-09-03 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* fontdef.dtx: preload t1cmss.fd and t1cmtt.fd

2024-09-02 Joseph Wright <Joseph.Wright@latex-project.org>

* clsguide.tex:
Expand Down
18 changes: 17 additions & 1 deletion base/doc/ltnews40.tex
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,23 @@ \section{Introduction}

% To write

\section{Switch to T1 as default encoding in documents using \cs{DocumentMetadata}}

As it is well known the font encoding \texttt{OT1} supports only 128 characters and
has various problems and quirks notably for languages different to English.
Nevertheless \texttt{OT1} is the default encoding in \LaTeX{} and this can not be easily
changed without affecting many documents as the \texttt{T1} version of the fonts have slightly different metrics.

The introduction of the \cs{DocumentMetadata} command, which announces
\emph{new} code and changes that can also affect the layout gives us now the
opportunity to make this step. So with this version a use of
\cs{DocumentMetadata} with (pdf)\LaTeX{} will setup \texttt{T1} as default
font encoding\footnote{The Unicode engines will continue to use \texttt{TU}
as encoding.}. To ensure that scalable fonts are used, the package
\pkg{cm-super} has to be installed. Users who want to revert to the
\texttt{OT1} encoding in their document can do so with
\verb+\usepackage[OT1]{fontenc}+.

\section{News from the \enquote{\LaTeX{} Tagged PDF} project}

The tagging of tabulars has been extended: it is now possible to tag
Expand All @@ -173,7 +190,6 @@ \section{News from the \enquote{\LaTeX{} Tagged PDF} project}
This new feature can be disabled with \verb+\tagpdfsetup{math/mathml/luamml=false}+
More details can be found in the documentation of \pkg{latex-lab-math}.


\section{Handling paragraph continuation}

Already \LaTeX~2.09 offered some automatism to detect whether or not
Expand Down
5 changes: 4 additions & 1 deletion base/fontdef.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
%<driver, >\ProvidesFile{fontdef.drv}
% \fi
% \ProvidesFile{fontdef.dtx}
[2024/07/08 v3.0j LaTeX Kernel
[2024/09/03 v3.0k LaTeX Kernel
% \iffalse
%<text, > (Text font setup)
%<math, > (Math font setup)
Expand Down Expand Up @@ -403,9 +403,12 @@
% (nearly) every \TeX{} installation, while the amount of main memory
% is not a limiting factor at most installations.)
%
% \changes{v3.0k}{2024/09/03}{Load also t1cmss.fd and t1cmtt.fd}
% \begin{macrocode}
\begingroup
\nfss@catcodes
\input {t1cmss.fd}
\input {t1cmtt.fd}
\input {ot1cmss.fd}
\input {ot1cmtt.fd}
\endgroup
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-doc/tlb-hypdoc001.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LaTeX Font Info: External font `cmex10' loaded for size
)
\tf@toc=\write...
(tlb-hypdoc001.lvt
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
[1
\indexentry{foo=\verb!*+\foo+|hdclindex{2}{usage}}{1}
]
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-doc/tlb-hypdoc001.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LaTeX Font Info: External font `cmex10' loaded for size
)
\tf@toc=\write...
(tlb-hypdoc001.lvt
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
[1
\indexentry{foo=\verb!*+\foo+|hdclindex{2}{usage}}{1}
]
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-legacy/tlb-textcomp-002.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Overfull \hbox (1.57208pt too wide) in paragraph at lines 18--18
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-legacy/tlb-textcomp-003.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Overfull \hbox (1.57208pt too wide) in paragraph at lines 19--19
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: Trying to load font information for TS1+lmr on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-legacy/tlb-textcomp-004.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: Trying to load font information for TS1+lmr on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-search/github-0277b.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Don't change this file in any respect.
6: T1/cmss/m/n should be T1/cmss/m/n
7: T1/cmss/bx/n should be T1/cmss/bx/n
8: T1/cmss/m/n should be T1/cmss/m/n
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Warning: Font shape `T1/cmss/b/n' in size <10> not available
(Font) Font shape `T1/cmtt/bx/n' tried instead on input line ....
LaTeX Font Info: Font shape `T1/cmtt/bx/n' in size <10> not available
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-search/github-0277c.tlg
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
1: T1/qhv/m/n should be T1/qhv/m/n
LaTeX Font Info: Trying to load font information for T1+cmss on input line ....
2: T1/cmss/m/n should be T1/cmss/m/n
LaTeX Font Warning: Font shape `T1/cmss/b/n' undefined
(Font) using `T1/cmss/bx/n' instead on input line ....
Expand Down
2 changes: 0 additions & 2 deletions base/testfiles-search/tlb-nfssaxes-005.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ bf inside: T1/cmr/bx/sl
bf: T1/cmr/bx/n
md: T1/cmr/m/n
bf: T1/cmr/bx/n
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
Expand All @@ -72,7 +71,6 @@ bf inside: T1/cmss/bx/sl
bf: T1/cmss/bx/n
md: T1/cmss/m/n
bf: T1/cmss/bx/n
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 ....
Expand Down
1 change: 0 additions & 1 deletion base/testfiles-search/tlb2581.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
Get an error for doc's comment char?
(tlb2581.lvt
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <9> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070.luatex.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0, direction TLT
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070.xetex.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070b.luatex.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0, direction TLT
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070b.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0070b.xetex.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Info: Redefining \verbvisiblespace on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/github-0879.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmss on input line ....
n/bx/12:m<=bx
n/bx/10:m<=bx
n/bx/9: m<=bx
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb0171.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ LaTeX Font Info: Trying to load font information for OT1+cmdh on input line .
LaTeX Font Info: External font `cmdunh10 at10.0pt' loaded as
(Font) OT1/cmdh/m/n/10 on input line ....
LaTeX Font Info: Switching to \OT1/cmdh/m/n/10 on input line ....
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: External font `ectt1000 at10.0pt' loaded as
(Font) T1/cmtt/m/n/10 on input line ....
LaTeX Font Info: Switching to \T1/cmtt/m/n/10 on input line ....
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb0171.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ LaTeX Font Info: Trying to load font information for OT1+cmdh on input line .
LaTeX Font Info: External font `cmdunh10 at10.0pt' loaded as
(Font) OT1/cmdh/m/n/10 on input line ....
LaTeX Font Info: Switching to \OT1/cmdh/m/n/10 on input line ....
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: External font `ectt1000 at10.0pt' loaded as
(Font) T1/cmtt/m/n/10 on input line ....
LaTeX Font Info: Switching to \T1/cmtt/m/n/10 on input line ....
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb2138.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0, direction TLT
.\glue 16.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb2138.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line ....
LaTeX Font Info: ... okay on input line ....
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
.\glue 16.0
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb2400.luatex.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb2400.tlg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
Expand Down
13 changes: 0 additions & 13 deletions base/testfiles/tlb2581.luatex.tlg

This file was deleted.

1 change: 0 additions & 1 deletion base/testfiles/tlb3480.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ l. ...\inputencoding{latin1}
% switch to latin1
For xelatex or lualatex save the document in UTF-8 encoding
and do not use inputenc, or use the [utf8] option.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
Package inputenc Warning: inputenc package ignored with utf8 based engines.
Completed box being shipped out [1]
\vbox(578.15999+0.0)x469.75499, direction TLT
Expand Down
3 changes: 1 addition & 2 deletions base/testfiles/tlb3480.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
(latin1.def
File: latin1.def ....-..-.. v... Input encoding file
)
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
) (utf8.def
File: utf8.def ....-..-.. v... UTF-8 support
)
! LaTeX Error: Invalid UTF-8 byte sequence (^^c3F).
Expand Down
1 change: 0 additions & 1 deletion base/testfiles/tlb3480.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ l. ...\inputencoding{latin1}
% switch to latin1
For xelatex or lualatex save the document in UTF-8 encoding
and do not use inputenc, or use the [utf8] option.
LaTeX Font Info: Trying to load font information for T1+cmtt on input line ....
Package inputenc Warning: inputenc package ignored with utf8 based engines.
Completed box being shipped out [1]
\vbox(578.15999+0.0)x469.75499
Expand Down
4 changes: 4 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-09-03 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* documentmetadata-support.dtx: switch to T1 encoding by default for non-Unicode
engines.

2024-08-29 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: avoid loosing math if tagging is suspended,
tagging-project issue #661
Expand Down
21 changes: 19 additions & 2 deletions required/latex-lab/documentmetadata-support.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
% for those people who are interested or want to report an issue.
%
% \begin{macrocode}
\def\documentmetadatasupportversion{1.0h}
\def\documentmetadatasupportdate{2024-03-26}
\def\documentmetadatasupportversion{1.0i}
\def\documentmetadatasupportdate{2024-09-03}
% \end{macrocode}
%
%
Expand Down Expand Up @@ -314,6 +314,19 @@
{ \tl_new:N \g_@@_testphase_tl }
% \end{macrocode}
% \end{variable}
%
% \subsection{Kernel changes with \cs{DocumentMetadata}}
% \begin{macro}{\@kernel@before@DocumentMetadata}
% \begin{macrocode}
\cs_new_protected:Npn \@kernel@before@DocumentMetadata
{
\ifx\Umathcode\@undefined
\fontencoding{T1}
\renewcommand\encodingdefault{T1}
\fi
}
% \end{macrocode}
% \end{macro}

% \subsection{\cs{DocumentMetadata}}
%
Expand All @@ -330,6 +343,10 @@
{ \msg_error:nn { meta } { after-class } }
{
% \end{macrocode}
% Load general format changes
% \begin{macrocode}
\@kernel@before@DocumentMetadata
% \end{macrocode}
%
% The wanted backend must be detected first, we read the init
% key and then force the loading of the backend.
Expand Down
10 changes: 1 addition & 9 deletions required/latex-lab/resave.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
l3build save -c config-OR memoir-001 scrartcl-001
l3build save -c config-math mathml-AF-ex1-keys mathcapture-tag-001
l3build save -c config-math-luatex mathml-luamml-3 mathml-luamml-2 mathml-luamml-4
l3build save -c config-OR-luatex test-minipage scrartcl-001 memoir-001
l3build save -c config-sec test-book-2 test-book-1 test-stop-sect-pdf test-article-1 test-suppress-sect
l3build save -c config-toc toc-ex-article-hyperref-1 toc-ex-article-no-tagging-hyperref toc-ex-article-hyperref-2 toc-ex-book-tocdepth toc-ex-article-no-hyperref toc-ex-article-no-tagging toc-ex-book-hyperref-1 toc-manual-addcontentsline toc-ex-book-no-hyperref toc-ex-article-hyperref-3
l3build save -c config-float marginpar-04-gh-444 marginpar-03 marginpar-01
l3build save -c config-table-luatex table-010-longtable-pdf table-010-longtable-pdf2 table-014-pbox-longtable table-009-pdf table-011-endheadbox table-014-pbox table-001-pdf
l3build save -c config-title title-004 title-003 title-007 title-008 title-005 title-006 title-009 title-002
l3build save -c config-table-pdftex table-014-pbox
Loading

0 comments on commit 7a9e646

Please sign in to comment.