summaryrefslogtreecommitdiff
path: root/luaotfload.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'luaotfload.dtx')
-rw-r--r--luaotfload.dtx25
1 files changed, 12 insertions, 13 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx
index a7f82de..11ce7f4 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -569,26 +569,15 @@ fonts.mode = "node"
caches.compilemethod = "both"
% \end{macrocode}
%
-% Finally we register the callbacks
-%
-% \begin{macrocode}
-local handler = nodes.simple_font_handler
-luatexbase.add_to_callback("pre_linebreak_filter", handler, "luaotfload")
-luatexbase.add_to_callback("hpack_filter", handler, "luaotfload")
-luatexbase.reset_callback("define_font")
-luatexbase.add_to_callback("define_font", definefont, "luaotfload")
-% \end{macrocode}
-%
-% \section{Font patching callback}
-%
% we provide a callback for patching fonts on the fly, to be used by other
% packages.
+%
% \begin{macrocode}
luatexbase.create_callback("luaotfload.patch_font", "simple", function() end)
% \end{macrocode}
%
% \begin{macrocode}
-local function definefont(...)
+local function deffont(...)
local fontdata = fonts.definers.read(...)
if type(fontdata) == "table" then
luatexbase.call_callback("luaotfload.patch_font", fontdata)
@@ -597,6 +586,16 @@ local function definefont(...)
end
% \end{macrocode}
%
+% Finally we register the callbacks
+%
+% \begin{macrocode}
+local handler = nodes.simple_font_handler
+luatexbase.reset_callback("define_font")
+luatexbase.add_to_callback("pre_linebreak_filter", handler, "luaotfload")
+luatexbase.add_to_callback("hpack_filter", handler, "luaotfload")
+luatexbase.add_to_callback("define_font", deffont, "luaotfload")
+% \end{macrocode}
+%
% \iffalse
%</lua>
% \fi