summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-configuration.lua6
-rw-r--r--src/luaotfload-resolvers.lua22
-rwxr-xr-xsrc/luaotfload-tool.lua19
3 files changed, 30 insertions, 17 deletions
diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua
index abc2657..17aee85 100644
--- a/src/luaotfload-configuration.lua
+++ b/src/luaotfload-configuration.lua
@@ -93,10 +93,12 @@ local valid_formats = tabletohash {
}
local default_anon_sequence = {
- "tex", "path", "name",
+ "tex", "path", "name"
}
-local valid_resolvers = tabletohash (default_anon_sequence)
+local valid_resolvers = tabletohash {
+ "tex", "path", "name", "file"
+}
local feature_presets = {
arab = tabletohash {
diff --git a/src/luaotfload-resolvers.lua b/src/luaotfload-resolvers.lua
index f911101..6fc6ffe 100644
--- a/src/luaotfload-resolvers.lua
+++ b/src/luaotfload-resolvers.lua
@@ -200,20 +200,26 @@ local resolve_methods = {
tex = resolve_tex_format,
path = resolve_path_if_exists,
name = resolve_name,
+ file = resolve_file,
}
local resolve_sequence = function (seq, specification)
for i = 1, #seq do
local id = seq [i]
local mth = resolve_methods [id]
- logreport ("both", 3, "resolve", "step %d: apply method %q (%s)", i, id, mth)
- if mth (specification) == true then
- logreport ("both", 3, "resolve",
- "%d: method %q resolved %q -> %s (%s).",
- i, id, specification.specification,
- specification.name,
- specification.forcedname)
- return true
+ if not mth then
+ logreport ("both", 0, "resolve",
+ "step %d: invalid lookup method %q", i, id)
+ else
+ logreport ("both", 3, "resolve", "step %d: apply method %q (%s)", i, id, mth)
+ if mth (specification) == true then
+ logreport ("both", 3, "resolve",
+ "%d: method %q resolved %q -> %s (%s).",
+ i, id, specification.specification,
+ specification.name,
+ specification.forcedname)
+ return true
+ end
end
end
logreport ("both", 0, "resolve",
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 4b4dc50..376aa39 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -1160,16 +1160,21 @@ actions.query = function (job)
tmpspec.size = 655360 --- assume 10pt
end
- local foundname, subfont, success
+ local foundname, subfont, success, needle
- if tmpspec.lookup == "name"
- or tmpspec.lookup == "anon" --- not *exactly* as resolvers.anon
- then
- foundname, _, success = fonts.names.lookup_font_name (tmpspec)
- if foundname then
- foundname, _, success = fonts.names.lookup_font_file (foundname)
+ if tmpspec.lookup == "name" then
+ if fonts.definers.resolvers.name (tmpspec) then
+ needle = tmpspec.resolved
+ end
+ elseif tmpspec.lookup == "anon" then
+ if fonts.definers.resolvers.anon (tmpspec) then
+ needle = tmpspec.resolved or tmpspec.name
end
elseif tmpspec.lookup == "file" then
+ needle = tmpspec.name
+ end
+
+ if needle then
foundname, _, success = fonts.names.lookup_font_file (tmpspec.name)
end