diff options
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 |