summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fontloader/luaotfload-package.lua6
-rw-r--r--src/luaotfload-init.lua18
-rw-r--r--src/luaotfload-main.lua4
3 files changed, 22 insertions, 6 deletions
diff --git a/src/fontloader/luaotfload-package.lua b/src/fontloader/luaotfload-package.lua
index b60ae17..725c498 100644
--- a/src/fontloader/luaotfload-package.lua
+++ b/src/fontloader/luaotfload-package.lua
@@ -63,12 +63,16 @@ loadmodule "l-boolean.lua"
loadmodule "l-math.lua"
loadmodule "util-str.lua"
+--- Another file containing auxiliary definitions must be present
+--- prior to initialization of the configuration.
+
+loadmodule "luatex-basics-gen.lua"
+
--- The files below constitute the “fontloader proper”. Some of the
--- functionality like file resolvers is overloaded later by
--- Luaotfload. Consequently, the resulting package is pretty
--- bare-bones and not usable independently.
-loadmodule("luatex-basics-gen.lua")
loadmodule("data-con.lua")
loadmodule("luatex-basics-nod.lua")
loadmodule("font-ini.lua")
diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua
index ac27b2c..0ef968d 100644
--- a/src/luaotfload-init.lua
+++ b/src/luaotfload-init.lua
@@ -65,7 +65,7 @@ local logreport --- filled in after loading the log module
--doc]]--
-local init_pre = function ()
+local init_early = function ()
local store = { }
config = config or { } --- global
@@ -74,6 +74,7 @@ local init_pre = function ()
config.lualibs.verbose = false
config.lualibs.prefer_merged = true
config.lualibs.load_extended = true
+ fonts = fonts or { }
require "lualibs"
@@ -131,8 +132,10 @@ local init_pre = function ()
return number
end
+ luaotfload.loaders.fontloader "basics-gen"
+
return store
-end --- [init_pre]
+end --- [init_early]
--[[doc--
@@ -345,6 +348,13 @@ local init_post_load_agl = function ()
return
end
+ if next (fonts.encodings.agl) then
+ --- unnecessary because the file shouldn’t be loaded at this time
+ --- but we’re just making sure
+ fonts.encodings.agl = nil
+ collectgarbage"collect"
+ end
+
local agl_init = { } --- start out empty, fill on demand
encodings.agl = agl_init --- ugh, replaced again later
@@ -408,9 +418,9 @@ local init_post = function ()
end --- [init_post]
return {
- init = function ()
+ early = init_early,
+ main = function (store)
local starttime = os.gettimeofday ()
- local store = init_pre ()
store.our_environment, store.context_environment = init_adapt ()
init_main ()
init_cleanup (store)
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 2a49686..5ac1421 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -153,8 +153,8 @@ luaotfload.loaders.luaotfload = load_luaotfload_module
luaotfload.loaders.fontloader = load_fontloader_module
luaotfload.init = load_luaotfload_module "init" --- fontloader initialization
-luaotfload.init.init ()
+local store = luaotfload.init.early ()
local log = luaotfload.log
local logreport = log.report
@@ -171,6 +171,8 @@ if not config.actions.apply_defaults () then
logreport ("log", 0, "load", "Configuration unsuccessful.")
end
+luaotfload.init.main (store)
+
load_luaotfload_module "loaders" --- Type1 font wrappers
load_luaotfload_module "database" --- Font management.
load_luaotfload_module "colors" --- Per-font colors.