diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2015-06-09 23:36:37 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2015-06-09 23:36:37 +0200 |
commit | 431c25a1200c7d0e8b7fe55173357d29f7247975 (patch) | |
tree | c4441a0c2b5696c01973612f8807c45b885aaf44 | |
parent | 892ebebdc0fb6d59e1748e7d81e976d41f8fd85f (diff) | |
download | luaotfload-431c25a1200c7d0e8b7fe55173357d29f7247975.tar.gz |
[main,init] separate loading of fontloader and lualibs packages
-rw-r--r-- | src/luaotfload-init.lua | 21 | ||||
-rw-r--r-- | src/luaotfload-main.lua | 13 |
2 files changed, 28 insertions, 6 deletions
diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua index 034ec57..4968877 100644 --- a/src/luaotfload-init.lua +++ b/src/luaotfload-init.lua @@ -14,6 +14,7 @@ Initialization phases: - Load Lualibs from package + - Set up the logger routines - Load Fontloader - as package specified in configuration - from Context install @@ -29,10 +30,30 @@ --doc]]-- +config = config or { } +local config = config +config.luaotfload = config.luaotfload or { } + +config.lualibs = config.lualibs or { } +config.lualibs.verbose = false +config.lualibs.prefer_merged = true +config.lualibs.load_extended = true + +require "lualibs" + +if not lualibs then error("this module requires Luaotfload") end if not luaotfload then error("this module requires Luaotfload") end local load_luaotfload_module = luaotfload.loaders.luaotfload local load_fontloader_module = luaotfload.loaders.fontloader +--[[doc-- + + The logger needs to be in place prior to loading the fontloader due + to order of initialization being crucial for the logger functions + that are swapped. + +--doc]]-- +load_luaotfload_module "log" diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index d09ea7b..a676685 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -4,7 +4,7 @@ -- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, luatexbase -- AUTHOR: Élie Roux, Khaled Hosny, Philipp Gesang -- VERSION: same as Luaotfload --- MODIFIED: 2015-05-26 07:51:29+0200 +-- MODIFIED: 2015-06-09 23:08:18+0200 ----------------------------------------------------------------------- -- --- Note: @@ -13,8 +13,7 @@ --- version 2.4 to 2.5. Thus, the comments are still in TeX (Latex) --- markup. -local initial_log_level = 0 - +local initial_log_level = 0 luaotfload = luaotfload or { } local luaotfload = luaotfload luaotfload.log = luaotfload.log or { } @@ -65,6 +64,7 @@ luaotfload.module = { local luatexbase = luatexbase +local require = require local setmetatable = setmetatable local type, next = type, next local stringlower = string.lower @@ -78,7 +78,7 @@ local create_callback = luatexbase.create_callback local reset_callback = luatexbase.reset_callback local call_callback = luatexbase.call_callback -local dummy_function = function () end --- XXX this will be moved to the luaotfload namespace when we have the init module +local dummy_function = function () end --- XXX this will be moved to the luaotfload namespace when we have the init module local error, warning, info, log = luatexbase.provides_module(luaotfload.module) @@ -105,7 +105,8 @@ luaotfload.log.tex = { --doc]]-- local min_luatex_version = 79 --- i. e. 0.79 -local fontloader_package = "fontloader" --- default: from current Context +--local fontloader_package = "fontloader" --- default: from current Context +local fontloader_package = "slim" if tex.luatexversion < min_luatex_version then warning ("LuaTeX v%.2f is old, v%.2f or later is recommended.", @@ -137,7 +138,7 @@ local load_fontloader_module = make_loader "fontloader" luaotfload.loaders.luaotfload = load_luaotfload_module luaotfload.loaders.fontloader = load_fontloader_module -load_luaotfload_module "log" --- log messages +load_luaotfload_module "init" --- fontloader initialization local log = luaotfload.log local logreport = log.report |