summaryrefslogtreecommitdiff
path: root/luaotfload.dtx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-11-17 20:15:09 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-11-17 20:15:09 +0200
commit68deea6dce2d816a208b940cdfb529e976d5dfa6 (patch)
tree43cc0285d00ff3765d05c1f3331858eb72e19118 /luaotfload.dtx
parent9cdb60a667d2689e78ff5d7109266c4d25fb2897 (diff)
downloadluaotfload-68deea6dce2d816a208b940cdfb529e976d5dfa6.tar.gz
Simplify callback registering
We never turn off the package as it makes no sense to load it then (and it does not really turn everything off since we already register another callback in the color module.
Diffstat (limited to 'luaotfload.dtx')
-rw-r--r--luaotfload.dtx58
1 files changed, 17 insertions, 41 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx
index 322acb8..683481c 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -690,35 +690,22 @@ for _,v in next, gsubs do
end
% \end{macrocode}
%
-% Finally two functions
+% Finally we register the callbacks
%
% \begin{macrocode}
-function luaotfload.register_callbacks()
- luatexbase.add_to_callback('pre_linebreak_filter',
- nodes.simple_font_handler,
- 'luaotfload.pre_linebreak_filter')
- luatexbase.add_to_callback('hpack_filter',
- nodes.simple_font_handler,
- 'luaotfload.hpack_filter')
- luatexbase.reset_callback('define_font')
- luatexbase.add_to_callback('define_font',
- def_font,
- 'luaotfload.define_font', 1)
- luatexbase.add_to_callback('find_vf_file',
- fonts.vf.find,
- 'luaotfload.find_vf_file')
-end
-
-function luaotfload.unregister_callbacks()
- luatexbase.remove_from_callback('pre_linebreak_filter',
- 'luaotfload.pre_linebreak_filter')
- luatexbase.remove_from_callback('hpack_filter',
- 'luaotfload.hpack_filter')
- luatexbase.remove_from_callback('define_font',
- 'luaotfload.define_font')
- luatexbase.remove_from_callback('find_vf_file',
- 'luaotfload.find_vf_file')
-end
+luatexbase.add_to_callback('pre_linebreak_filter',
+ nodes.simple_font_handler,
+ 'luaotfload.pre_linebreak_filter')
+luatexbase.add_to_callback('hpack_filter',
+ nodes.simple_font_handler,
+ 'luaotfload.hpack_filter')
+luatexbase.reset_callback('define_font')
+luatexbase.add_to_callback('define_font',
+ def_font,
+ 'luaotfload.define_font', 1)
+luatexbase.add_to_callback('find_vf_file',
+ fonts.vf.find,
+ 'luaotfload.find_vf_file')
% \end{macrocode}
%
% \iffalse
@@ -755,26 +742,15 @@ end
\catcode64 11
% \end{macrocode}
%
-% Two small macros to register or unregister the callbacks. Without the
-% callbacks this package is totally turned off.
+% Finally we load the |lua| module
%
% \begin{macrocode}
-\def\otfl@off{
-\directlua{luaotfload.unregister_callbacks()}
-}
-
-\def\otfl@on{
-\directlua{luaotfload.register_callbacks()}
-}
+\RequireLuaModule{luaotfload}
% \end{macrocode}
%
-% We load the |lua| file, and we turn the package on.
+% and finalize the package.
%
% \begin{macrocode}
-\RequireLuaModule{luaotfload}
-
-\otfl@on
-
\otfl@AtEnd
% \end{macrocode}
% \iffalse