From 145203842d83591fc9e67322472994c481d5aadc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 27 Sep 2015 18:50:22 +0200 Subject: [main] move toplevel statements into init routine --- src/luaotfload-main.lua | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 73f9a75..9e57dbf 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -139,26 +139,21 @@ local load_fontloader_module = make_loader "fontloader" luaotfload.loaders.luaotfload = load_luaotfload_module luaotfload.loaders.fontloader = load_fontloader_module -luaotfload.init = load_luaotfload_module "init" --- fontloader initialization - -local store = luaotfload.init.early () -local log = luaotfload.log -local logreport = log.report - --[[doc-- Now we load the modules written for \identifier{luaotfload}. --doc]]-- -luaotfload.init.main (store) - luaotfload.main = function () local starttime = os.gettimeofday () + local init = load_luaotfload_module "init" --- fontloader initialization + local store = init.early () --- injects the log module too + local logreport = luaotfload.log.report local tmp = load_luaotfload_module "parsers" --- fonts.conf and syntax if not tmp.init () then - logreport ("log", 0, "load", "Failed to install the parsers.") + logreport ("log", 0, "load", "Failed to install the parsers module.") end local tmp = load_luaotfload_module "configuration" --- configuration options @@ -166,6 +161,10 @@ luaotfload.main = function () logreport ("log", 0, "load", "Configuration unsuccessful.") end + if not init.main (store) then + logreport ("log", 0, "load", "Main fontloader initialization failed.") + end + luaotfload.loaders = load_luaotfload_module "loaders" --- Font loading; callbacks if not luaotfload.loaders.install () then logreport ("log", 0, "load", "Callback and loader initialization failed.") -- cgit v1.2.3