diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-04-28 21:57:55 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-04-28 21:57:59 +0200 |
commit | 2db9e17e57e306bde452c5d97f976b47b0bf9d78 (patch) | |
tree | dcdc407fdbf635da72bc3d4e7d783deb29312b23 /src/luaotfload-tool.lua | |
parent | 2727f911e924b77af85c60aacff82517cf70ca84 (diff) | |
download | luaotfload-2db9e17e57e306bde452c5d97f976b47b0bf9d78.tar.gz |
[tool,resolvers,conf] switch --find lookups to the actual resolvers
The arguments to “--find” on the command line avoided calling the real
index API functions and used crude approximations instead. In order to
make “--find” obey the new “anon-sequence” configuration item, it needs
to access the normal resolvers instead. This requires certain
adaptations to allow for a fallback on the “file:” lookup.
Diffstat (limited to 'src/luaotfload-tool.lua')
-rwxr-xr-x | src/luaotfload-tool.lua | 19 |
1 files changed, 12 insertions, 7 deletions
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 |