summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2011-10-09 08:06:18 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2011-10-09 08:06:18 +0200
commitc322f8ffe3b02f2dc5ee929d5b5c603674b80be4 (patch)
treedeb285bcf8f947628c844d90fdcf2b7848b99706
parentdd691ce64c069ed41bad3f5ceb03986530fdb010 (diff)
downloadluaotfload-c322f8ffe3b02f2dc5ee929d5b5c603674b80be4.tar.gz
Make silly cosmetics + actually making it work.
-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