summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-18 22:21:33 +0000
committerKarl Berry <karl@freefriends.org>2013-05-18 22:21:33 +0000
commit2472c585a2dee03ef4665514cb651e5976fd134a (patch)
treecb0475ebdca2ed9ee248dd809f6bcce1671a0afb /Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
parent542dd7f24e76ac20da26d1c4d7ceb69baa248133 (diff)
luaotfload (18may13)
git-svn-id: svn://tug.org/texlive/trunk@30561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua62
1 files changed, 41 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
index 0de49c021fe..dbecad210e0 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
@@ -37,7 +37,7 @@ config.luaotfload.color_callback = config.luaotfload.color_callback or "pre_l
luaotfload.module = {
name = "luaotfload",
version = 2.2,
- date = "2013/04/29",
+ date = "2013/05/18",
description = "OpenType layout system.",
author = "Elie Roux & Hans Hagen",
copyright = "Elie Roux",
@@ -80,15 +80,6 @@ if tex.luatexversion < luatex_version then
end
-local cachepath = kpse.expand_var"$TEXMFVAR"
-if not lfs.isdir(cachepath) then
- dir.mkdirs(cachepath)
- if not lfs.isdir(cachepath) then
- error( "ERROR could not create directory %s", cachepath)
- end
-end
-
-
local fl_prefix = "luaotfload" -- “luatex” for luatex-plain
local loadmodule = function (name)
require(fl_prefix .."-"..name)
@@ -257,8 +248,8 @@ add_to_callback("hpack_filter",
add_to_callback("find_vf_file",
find_vf_file, "luaotfload.find_vf_file")
-loadmodule"lib-dir.lua" --- required by luaofload-database.lua
-loadmodule"override.lua" --- “luat-ovr”
+loadmodule"lib-dir.lua" --- required by luaofload-database.lua
+loadmodule"override.lua" --- “luat-ovr”
logs.set_loglevel(config.luaotfload.loglevel)
@@ -276,19 +267,20 @@ local resolvefile = fonts.names.crude_file_lookup
--local resolvefile = fonts.names.crude_file_lookup_verbose
function request_resolvers.file(specification)
- local name=resolvefile(specification.name)
- local suffix=file.suffix(name)
- if formats[suffix] then
- specification.forced=suffix
- specification.name=file.removesuffix(name)
- else
- specification.name=name
- end
+ local name = resolvefile(specification.name)
+ local suffix = file.suffix(name)
+ if formats[suffix] then
+ specification.forced = suffix
+ specification.name = file.removesuffix(name)
+ else
+ specification.name = name
+ end
end
--request_resolvers.anon = request_resolvers.name
+
local type1_formats = { "tfm", "ofm", }
request_resolvers.anon = function (specification)
@@ -300,13 +292,40 @@ request_resolvers.anon = function (specification)
return
end
end
+ --- under some weird circumstances absolute paths get
+ --- passed to the definer; we have to catch them
+ --- before the name: resolver misinterprets them.
+ name = specification.specification
+ local exists, _ = lfsisfile(name)
+ if exists then --- garbage; we do this because we are nice,
+ --- not because it is correct
+ logs.names_report("log", 1, "load", "file “%s” exists", name)
+ logs.names_report("log", 1, "load",
+ "... overriding borked anon: lookup with path: lookup")
+ specification.name = name
+ request_resolvers.path(specification)
+ return
+ end
request_resolvers.name(specification)
end
+
request_resolvers.path = function (specification)
- local exists, _ = lfsisfile(specification.name)
+ local name = specification.name
+ local exists, _ = lfsisfile(name)
if not exists then -- resort to file: lookup
+ logs.names_report("log", 1, "load",
+ "path lookup of “%s” unsuccessful, falling back to file:",
+ name)
request_resolvers.file(specification)
+ else
+ local suffix = file.suffix(name)
+ if formats[suffix] then
+ specification.forced = suffix
+ specification.name = file.removesuffix(name)
+ else
+ specification.name = name
+ end
end
end
@@ -346,6 +365,7 @@ elseif font_definer == "patch" then
end
loadmodule"features.lua" --- contains what was “font-ltx” and “font-otc”
+loadmodule"extralibs.lua" --- load additional Context libraries
loadmodule"auxiliary.lua" --- additionaly high-level functionality (new)
-- vim:tw=71:sw=4:ts=4:expandtab