summaryrefslogtreecommitdiff
path: root/macros/latex/base/ltoutenc.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2020-10-03 03:01:09 +0000
commit0e644e6805342838052f46e6af93f81644d0390b (patch)
tree26169230ce62dc353013ad08fb824f46d9511980 /macros/latex/base/ltoutenc.dtx
parent37f9a57b2f39142fbccb20b758af8e0502499671 (diff)
CTAN sync 202010030301
Diffstat (limited to 'macros/latex/base/ltoutenc.dtx')
-rw-r--r--macros/latex/base/ltoutenc.dtx92
1 files changed, 66 insertions, 26 deletions
diff --git a/macros/latex/base/ltoutenc.dtx b/macros/latex/base/ltoutenc.dtx
index f3c19000ed..c6bfc149b7 100644
--- a/macros/latex/base/ltoutenc.dtx
+++ b/macros/latex/base/ltoutenc.dtx
@@ -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/02/11 v2.0o
+%<OT1|T1|OMS|OML|OT4|TU|package> [2020/08/10 v2.0s
%<OT1|T1|OMS|OML|OT4|TS1|TU> Standard LaTeX file]
%<package> Standard LaTeX package]
%
%<*driver>
% \fi
\ProvidesFile{ltoutenc.dtx}
- [2020/02/11 v2.0o LaTeX Kernel (font encodings)]
+ [2020/08/10 v2.0s LaTeX Kernel (font encodings)]
% \iffalse
\documentclass{ltxdoc}
\GetFileInfo{ltoutenc.dtx}
@@ -188,6 +188,8 @@
% like.}
% \changes{v1.99m}{2015/02/21}
% {Removed autoload code}
+% \changes{v2.0p}{2020/04/22}
+% {corrected \=y unicode value in tuenc.def}
%
%
% \section{Font encodings}
@@ -1080,8 +1082,9 @@
% deficiencies, see pr/3160.
% \task{?}{Improve this and document its problems, see pr/3160}
% \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
+% \changes{v2.0r}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
% \begin{macrocode}
-\DeclareRobustCommand\UseTextAccent[3]{%
+\DeclareRobustCommand*\UseTextAccent[3]{%
\hmode@start@before@group
{%
% \end{macrocode}
@@ -1096,8 +1099,9 @@
% \end{macrocode}
%
% \changes{v1.9z}{2000/01/30}{Macro reimplemented (pr/3160)}
+% \changes{v2.0r}{2020/07/27}{Don't make the command \cs{long} (gh/354)}
% \begin{macrocode}
-\DeclareRobustCommand\UseTextSymbol[2]{%
+\DeclareRobustCommand*\UseTextSymbol[2]{%
\hmode@start@before@group
{%
\def\@wrong@font@char{\MessageBreak
@@ -2867,28 +2871,64 @@
% \end{macrocode}
%
% LuaTeX.
+% For Lua\TeX~1.10+, define a Lua function to disable any handing by the font code.
+% Otherwise we reload the font without TeX ligatures.
+% \changes{v2.0q}{2020/07/04}{%
+% Implement \cs{remove@tlig} in Lua\TeX without font reloading}
% \begin{macrocode}
\def\UnicodeFontTeXLigatures{+tlig;}
-% \end{macrocode}
-%
-% \begin{macrocode}
- \def\reserved@a#1{%
- \def\@remove@tlig##1{\@remove@tlig@##1\@nil#1\@nil\relax}
- \def\@remove@tlig@##1#1{\@remove@tlig@@##1}}
- \edef\reserved@b{\detokenize{+tlig;}}
- \expandafter\reserved@a\expandafter{\reserved@b}
- \def\@remove@tlig@@#1\@nil#2\relax{#1}
-% \end{macrocode}
-%
-% \begin{macrocode}
- \def\remove@tlig#1{%
- \begingroup
- \font\remove@tlig
- \expandafter\@remove@tlig\expandafter{\fontname\font}%
- \remove@tlig
- \char#1\relax
- \endgroup
- }
+ \ifnum\luatexversion<110
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\reserved@a#1{%
+ \def\@remove@tlig##1{\@remove@tlig@##1\@nil#1\@nil\relax}
+ \def\@remove@tlig@##1#1{\@remove@tlig@@##1}}
+ \edef\reserved@b{\detokenize{+tlig;}}
+ \expandafter\reserved@a\expandafter{\reserved@b}
+ \def\@remove@tlig@@#1\@nil#2\relax{#1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\remove@tlig#1{%
+ \begingroup
+ \font\remove@tlig
+ \expandafter\@remove@tlig\expandafter{\fontname\font}%
+ \remove@tlig
+ \char#1\relax
+ \endgroup
+ }
+ \else
+ \newluafunction\@remove@tlig@@@@
+% \end{macrocode}
+% Now we can define the function. Mostly we just have to insert a protected glyph
+% node, which is a glyph node with subtype 256. But we have to keep track of the
+% current mode to avoid inserting the glyph into a vlist.
+% \begin{macrocode}
+ \now@and@everyjob{\directlua{
+ local rawchar_func = token.create'@remove@tlig@@@@'.index
+ local forcehmode = tex.forcehmode
+ local put_next = token.put_next
+ local glyph_id = node.id'glyph'
+ local rawchar_token = token.new(rawchar_func, token.command_id'lua_call')
+ lua.get_functions_table()[rawchar_func] = function()
+ local mode = tex.nest.top.mode
+ if mode == 1 or mode == -1 then
+ put_next(rawchar_token)
+ return forcehmode(true)
+ end
+ local n = node.new(glyph_id, 256)
+ n.font = font.current()
+ n.char = token.scan_int()
+ return node.write(n)
+ end
+ token.set_lua('@remove@tlig@@@', rawchar_func, 'global', 'protected')
+ }}
+% \end{macrocode}
+% Now \verb+\remove@tlig+ can be implemented almost as in XeTeX.
+% \begin{macrocode}
+ \def\remove@tlig#1{\@remove@tlig@@@#1\relax}
+ \fi
% \end{macrocode}
%
% \begin{macrocode}
@@ -3370,7 +3410,7 @@
\DeclareUnicodeComposite{\textcommabelow}{T}{"021A}
\DeclareUnicodeComposite{\textcommabelow}{t}{"021B}
\DeclareUnicodeComposite{\=} {Y}{"0232}
-\DeclareUnicodeComposite{\=} {y}{"0232}
+\DeclareUnicodeComposite{\=} {y}{"0233}
\DeclareUnicodeComposite{\.} {B}{"1E02}
\DeclareUnicodeComposite{\.} {b}{"1E03}
\DeclareUnicodeComposite{\d} {B}{"1E04}
@@ -3601,7 +3641,7 @@
\xdef\@fontenc@load@list{\@fontenc@load@list
\@elt{\csname opt@fontenc.sty\endcsname}}
% \end{macrocode}
-%
+%
% \begin{macrocode}
\global\expandafter\let\csname ver@fontenc.sty\endcsname\relax
\global\expandafter\let\csname opt@fontenc.sty\endcsname\relax