summaryrefslogtreecommitdiff
path: root/macros/latex/base/ltoutenc.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/base/ltoutenc.dtx')
-rw-r--r--macros/latex/base/ltoutenc.dtx112
1 files changed, 99 insertions, 13 deletions
diff --git a/macros/latex/base/ltoutenc.dtx b/macros/latex/base/ltoutenc.dtx
index c6bfc149b7..eb2ecd1e53 100644
--- a/macros/latex/base/ltoutenc.dtx
+++ b/macros/latex/base/ltoutenc.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
-% The LaTeX3 Project and any individual authors listed elsewhere
+% Copyright (C) 1993-2021
+% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
% This file is part of the LaTeX base system.
@@ -37,14 +37,14 @@
%<TS1>\ProvidesFile{ts1enc.def}[2001/06/05 v3.0e (jk/car/fm)
%<TU>\ProvidesFile{tuenc.def}
%<package>\ProvidesPackage{fontenc}
-%<OT1|T1|OMS|OML|OT4|TU|package> [2020/08/10 v2.0s
+%<OT1|T1|OMS|OML|OT4|TU|package> [2021/04/29 v2.0v
%<OT1|T1|OMS|OML|OT4|TS1|TU> Standard LaTeX file]
%<package> Standard LaTeX package]
%
%<*driver>
% \fi
\ProvidesFile{ltoutenc.dtx}
- [2020/08/10 v2.0s LaTeX Kernel (font encodings)]
+ [2021/04/29 v2.0v LaTeX Kernel (font encodings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltoutenc.dtx}
@@ -421,7 +421,7 @@
% for |\textdollar| in \texttt{OT1} is a hack since \$ and \pounds{}
% actually share the same slot in this encoding. Thus if such a glyph
% becomes available in a different encoding (e.g., \texttt{TS1}) one
-% would like to get rid of the flacky one and make the default
+% would like to get rid of the flaky one and make the default
% definition point to the new encoding. In such a case defining
%\begin{verbatim}
% \DeclareTextSymbol{\textdollar}{TS1}{36}
@@ -841,7 +841,7 @@
% avoid that (they are some hidden inside \cs{maybe@load@fontshape}).
% As we don't have to load the fontshape in this case
% (as that happened in the box above if necessary, we simply
-% disable that part of the code temporaily.
+% disable that part of the code temporarily.
% We also ignore \cs{ignorespaces} which has the same issue and may
% show up as part of \cs{normalfont} if that is used.
% \changes{v2.0m}{2019/12/18}{Avoid code that breaks \cs{accent}}
@@ -1717,6 +1717,17 @@
\DeclareTextSymbol{\textemdash}{OT1}{124}
\DeclareTextSymbol{\textendash}{OT1}{123}
% \end{macrocode}
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen}{OT1}{\mbox{-}\nobreak\hskip\z@}
+\DeclareTextCommand{\textfiguredash} {OT1}{\textendash}
+\DeclareTextCommand{\texthorizontalbar} {OT1}{\textemdash}
+% \end{macrocode}
+%
% Using the ligatures helps with OT1 fonts that have
% |\textexclamdown| and |\textquestiondown| in unusual positions.
% \changes{v1.95}{2002/06/17}{Definition of \cs{textexclamdown} changed (pr/3368)}
@@ -2045,6 +2056,19 @@
\DeclareTextSymbol{\textdollar}{T1}{`\$}
\DeclareTextSymbol{\textemdash}{T1}{22}
\DeclareTextSymbol{\textendash}{T1}{21}
+% \end{macrocode}
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen}{T1}{\mbox{-}\nobreak\hskip\z@}
+\DeclareTextCommand{\textfiguredash} {T1}{\textendash}
+\DeclareTextCommand{\texthorizontalbar} {T1}{\textemdash}
+% \end{macrocode}
+%
+% \begin{macrocode}
\DeclareTextSymbol{\textexclamdown}{T1}{189}
\DeclareTextSymbol{\textgreater}{T1}{`\>}
%\DeclareTextSymbol{\texthyphenchar}{T1}{127}
@@ -2538,7 +2562,7 @@
%
% The tie accent was borrowed from the |cmmi| font. The tc fonts
% now provide four tie accents, the first two are done in the
-% classical way with assymetric glyphs hanging out of their boxes;
+% classical way with asymmetric glyphs hanging out of their boxes;
% the new ties are centered in their boxes like all other accents.
% They need a name: please tell us if you know what to call them.
%
@@ -2550,7 +2574,7 @@
\DeclareTextAccent{\capitalnewtie}{TS1}{29}
% \end{macrocode}
%
-% Compund word marks.
+% Compound word marks.
%
% The text companion fonts contain two compound word marks of
% different heights, one has |cap_height|, the other |asc_height|.
@@ -2583,8 +2607,31 @@
\DeclareTextSymbol{\textquotesingle}{TS1}{39}
% \end{macrocode}
% "28 = 40
-% \begin{macrocode}
-\DeclareTextSymbol{\textasteriskcentered}{TS1}{42}
+%
+% The symbol \cs{textasteriskcentered} ``\textasteriskcentered'' is
+% supposed to be always available in \texttt{TS1} and that is
+% important as it is used in footnote symbols. However, in a few
+% fonts it is missing even though they are otherwise fairly
+% complete. We therefore use a rather elaborate method and check if
+% the slot has a glyph and if not produce a poor man's version by
+% using a normal ``*'' slightly enlarged and somewhat lowered.
+% The main application for this symbol is in footnote symbols and
+% there it should produce a comparable size and show a similar placement.
+% \changes{v2.0t}{2021/02/17}{Special definition for
+% \cs{textasteriskcentered} when missing in TS1 (gh/502)}
+% \begin{macrocode}
+%\DeclareTextSymbol{\textasteriskcentered}{TS1}{42} % that's wanted
+\DeclareTextCommand \textasteriskcentered{TS1}{% % and that's needed
+ \iffontchar\font 42 \char42 \else
+ \begingroup\fontencoding{T1}%
+ \fontsize
+ {\the\dimexpr1.3\dimexpr\f@size pt\relax}%
+ {\f@baselineskip}%
+ \selectfont
+ \raisebox{-0.7ex}[\dimexpr\height-0.7ex][0pt]{*}%
+ \endgroup
+ \fi
+}
% \end{macrocode}
% Note that '054 is a comma and '056 is a full stop: these make
% numbers using oldstyle digits easier to input.
@@ -2837,7 +2884,7 @@
%<*TU>
% \end{macrocode}
% In the base interface the Unicode encoding is always known as TU
-% But we parameterise the encoding name to allow for modelling
+% But we parameterize the encoding name to allow for modelling
% differences in Unicode support by different fonts.
% \begin{macrocode}
\providecommand\UnicodeEncodingName{TU}
@@ -3106,8 +3153,34 @@
\DeclareTextSymbol{\textbaht} \UnicodeEncodingName{"0E3F}
\DeclareTextSymbol{\SS} \UnicodeEncodingName{"1E9E}
\DeclareTextSymbol{\textcompwordmark} \UnicodeEncodingName{"200C}
+% \end{macrocode}
+%
+% \changes{v2.0u}{2021/02/19}{Add \cs{textnonbreakinghyphen}, \cs{textfiguredash}
+% and \cs{texthorizontalbar} (gh/404)}
+% \begin{macrocode}
+%\DeclareTextSymbol{\textnonbreakinghyphen} \UnicodeEncodingName{"2011}
+%\DeclareTextSymbol{\textfiguredash} \UnicodeEncodingName{"2012}
\DeclareTextSymbol{\textendash} \UnicodeEncodingName{"2013}
\DeclareTextSymbol{\textemdash} \UnicodeEncodingName{"2014}
+%\DeclareTextSymbol{\texthorizontalbar} \UnicodeEncodingName{"2015}
+% \end{macrocode}
+% Unfortunately some fonts do not implement \texttt{"2011}, \texttt{"2012} and/or
+% \texttt{"2015} (including the \LaTeX{} default fonts for Unicode
+% engines) so we provide some approximations if the glyph is
+% missing, like we do for \texttt{OT1} and \texttt{T1}.
+%
+% The \verb=\nobreak\hskip\z@= is there to prevent a break after
+% the hyphen but allow later breaks in the remainder of the word.
+% \begin{macrocode}
+\DeclareTextCommand{\textnonbreakinghyphen} \UnicodeEncodingName
+ {\iffontchar\font "2011 \char "2011 \else \mbox{-}\nobreak\hskip\z@ \fi}
+\DeclareTextCommand{\textfiguredash} \UnicodeEncodingName
+ {\iffontchar\font "2012 \char "2012 \else \char "2013 \fi}
+\DeclareTextCommand{\texthorizontalbar} \UnicodeEncodingName
+ {\iffontchar\font "2015 \char "2015 \else \char "2014 \fi}
+% \end{macrocode}
+%
+% \begin{macrocode}
\DeclareTextSymbol{\textbardbl} \UnicodeEncodingName{"2016}
\DeclareTextSymbol{\textquoteleft} \UnicodeEncodingName{"2018}
\DeclareTextSymbol{\textquoteright} \UnicodeEncodingName{"2019}
@@ -3159,15 +3232,17 @@
% \end{macrocode}
%
% Not all fonts have U+2217 but using U+002A requires some adjustment.
+% \changes{v2.0t}{2021/02/17}{Adjust values for
+% \cs{textasteriskcentered} To match TS1 definition (gh/502)}
% \begin{macrocode}
\DeclareTextCommand{\textasteriskcentered}\UnicodeEncodingName{%
\iffontchar\font"2217 \char"2217 \else
\begingroup
\fontsize
- {\the\dimexpr1.2\dimexpr\f@size pt\relax}%
+ {\the\dimexpr1.3\dimexpr\f@size pt\relax}%
{\f@baselineskip}%
\selectfont
- \raisebox{-0.6ex}[\dimexpr\height-0.6ex][0pt]{*}%
+ \raisebox{-0.7ex}[\dimexpr\height-0.7ex][0pt]{*}%
\endgroup
\fi
}
@@ -3393,8 +3468,19 @@
\DeclareUnicodeComposite{\v} {o}{"01D2}
\DeclareUnicodeComposite{\v} {U}{"01D3}
\DeclareUnicodeComposite{\v} {u}{"01D4}
+% \end{macrocode}
+%
+% \changes{v2.0v}{2021/04/29}{Add composites for
+% \texttt{\protect\string\ae/\protect\string\AE/\ae/\AE} (gh/552)}
+% \begin{macrocode}
+\DeclareUnicodeComposite{\'} \AE{"01FC}
+\DeclareUnicodeComposite{\'} {Æ}{"01FC}
+\DeclareUnicodeComposite{\'} \ae{"01FD}
+\DeclareUnicodeComposite{\'} {æ}{"01FD}
\DeclareUnicodeComposite{\=} \AE{"01E2}
+\DeclareUnicodeComposite{\=} {Æ}{"01E2}
\DeclareUnicodeComposite{\=} \ae{"01E3}
+\DeclareUnicodeComposite{\=} {æ}{"01E3}
\DeclareUnicodeComposite{\v} {G}{"01E6}
\DeclareUnicodeComposite{\v} {g}{"01E7}
\DeclareUnicodeComposite{\v} {K}{"01E8}