diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2015-11-17 22:51:30 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2015-11-17 22:51:30 +0100 |
commit | ec1984766b941087425acca1b4d4fa8201c86639 (patch) | |
tree | 031d4036f69005ec92f6326d44569fd57e1797e2 /src/luaotfload-init.lua | |
parent | 6e2184e0226de1e76e7195493b781b99f56eb879 (diff) | |
download | luaotfload-ec1984766b941087425acca1b4d4fa8201c86639.tar.gz |
[init] rework fontloader choices
Diffstat (limited to 'src/luaotfload-init.lua')
-rw-r--r-- | src/luaotfload-init.lua | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua index ca5d9ec..2676ec7 100644 --- a/src/luaotfload-init.lua +++ b/src/luaotfload-init.lua @@ -8,6 +8,7 @@ -- local setmetatable = setmetatable +local kpselookup = kpse.lookup --[[doc-- @@ -218,6 +219,7 @@ local init_main = function () local fontloader = config.luaotfload and config.luaotfload.run.fontloader or "reference" + fontloader = tostring (fontloader) if fontloader == "unpackaged" then logreport ("both", 4, "init", @@ -302,13 +304,34 @@ local init_main = function () load_context_module "luatex-fonts-ext" load_context_module "luatex-fonts-cbk" - elseif fontloader then - fontloader = tostring (fontloader) - --- “reference”, “default” - logreport ("both", 4, "init", - "Attempting to load fontloader “%s”.", + elseif lfs.isdir (fontloader) then + logreport ("both", 2, "init", + "Attempting to load Context files under prefix “%s”.", + fontloader) + TODO() + + elseif lfs.isfile (fontloader) then + logreport ("both", 2, "init", + "Attempting to load fontloader from absolute path “%s”.", + fontloader) + local _void = require (fontloader) + + elseif kpselookup (fontloader) then + local pth = kpselookup (fontloader) + logreport ("both", 2, "init", + "Attempting to load fontloader “%s” from kpse-resolved path “%s”.", + fontloader, path) + local _void = require (path) + + else --- “reference”, “default” + logreport ("log", 6, "init", + "No match for fontloader spec “%s”.", + fontloader) + fontloader = luaotfload.fontloader_package + logreport ("log", 4, "init", + "Using predefined fontloader “%s”.", fontloader) - load_fontloader_module (luaotfload.fontloader_package) + load_fontloader_module (fontloader) end ---load_fontloader_module "font-odv.lua" --- <= Devanagari support from Context |