diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-29 22:01:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-29 22:01:58 +0000 |
commit | 96c21343055c250b69580b63f5726ff626328a73 (patch) | |
tree | 41fdd83511b61ec4818ad92dea190c5d16c1db23 /Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty | |
parent | 47d65268d475834a59b4abe82183f1e50a4d2987 (diff) |
uninormalize (29dec20)
git-svn-id: svn://tug.org/texlive/trunk@57257 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty b/Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty new file mode 100644 index 00000000000..4e1e4b15716 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/uninormalize/uninormalize.sty @@ -0,0 +1,35 @@ +\ProvidesPackage{uninormalize} +\RequirePackage{luatexbase} +\RequirePackage{luacode} +\RequirePackage{kvoptions} +\DeclareBoolOption[true]{nodes} +\DeclareBoolOption[true]{buffer} +\DeclareBoolOption{debug} +\ProcessKeyvalOptions* +\ifuninormalize@nodes + \luaexec{processnodes=true} +\fi +\ifuninormalize@buffer + \luaexec{processbuffer=true} +\fi +\ifuninormalize@debug + \luaexec{uninormalize_debug = true} +\fi +\begin{luacode*} +local normalize = require "unicode-normalize" +if processnodes==true then + print "[uninormalize] process nodes on" + luatexbase.add_to_callback("pre_linebreak_filter",normalize.nodes, "normalize unicode") + luatexbase.add_to_callback("hpack_filter",normalize.nodes, "normalize unicode") +end +if processbuffer== true then + print "[uninormalize] process buffer on" + luatexbase.add_to_callback("process_input_buffer", normalize.buffer," normalize unicode") +end +if uninormalize_debug then + normalize.debug = true +end +\end{luacode*} + + +\endinput |