summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex-dev/base/tuenc.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-07-21 21:39:07 +0000
committerKarl Berry <karl@freefriends.org>2020-07-21 21:39:07 +0000
commita4824d556273f90fbb37d24449cca150397ab7f2 (patch)
tree27fa3e556270c65afd257af5c0e69168c8c2633b /Master/texmf-dist/tex/latex-dev/base/tuenc.def
parenta5ed6b49fd24fce0a996e8db92f76022c41c5007 (diff)
latex-dev (21jul20)
git-svn-id: svn://tug.org/texlive/trunk@55898 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev/base/tuenc.def')
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/tuenc.def53
1 files changed, 39 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/base/tuenc.def b/Master/texmf-dist/tex/latex-dev/base/tuenc.def
index 7305cc90dca..c7e3b1fded1 100644
--- a/Master/texmf-dist/tex/latex-dev/base/tuenc.def
+++ b/Master/texmf-dist/tex/latex-dev/base/tuenc.def
@@ -58,20 +58,45 @@
\expandafter\expandafter\expandafter\endinput
\else
\def\UnicodeFontTeXLigatures{+tlig;}
- \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}
- \def\remove@tlig#1{%
- \begingroup
- \font\remove@tlig
- \expandafter\@remove@tlig\expandafter{\fontname\font}%
- \remove@tlig
- \char#1\relax
- \endgroup
- }
+ \ifnum\luatexversion<110
+ \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}
+ \def\remove@tlig#1{%
+ \begingroup
+ \font\remove@tlig
+ \expandafter\@remove@tlig\expandafter{\fontname\font}%
+ \remove@tlig
+ \char#1\relax
+ \endgroup
+ }
+ \else
+ \newluafunction\@remove@tlig@@@@
+ \def\now@and@everyjob#1{\toksapp\everyjob{#1}#1}
+ \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')
+ }}
+ \def\remove@tlig#1{\@remove@tlig@@@#1\relax}
+ \fi
\fi
\else
\def\UnicodeFontTeXLigatures{mapping=tex-text;}