diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-03 22:44:30 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-03 22:44:30 +0200 |
commit | 358258ab83d2bc0d9d8ad141427c7df989425c90 (patch) | |
tree | 1338cfe733365adbcd77c2f0db555b4f3980cc3b | |
parent | 24ef88fda9d592e880c4694b50c64c5ae0b74a92 (diff) | |
download | luaotfload-358258ab83d2bc0d9d8ad141427c7df989425c90.tar.gz |
[tool] handle anon: and file: requests with --find
-rw-r--r-- | luaotfload-database.lua | 16 | ||||
-rwxr-xr-x | luaotfload-tool.lua | 21 |
2 files changed, 26 insertions, 11 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 939b6bb..8da0713 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -523,21 +523,21 @@ crude_file_lookup_verbose = function (filename) --- look up in db first ... found = verbose_lookup(filenames, "bare", filename) if found then - return found + return found, nil, true end found = verbose_lookup(filenames, "base", filename) if found then - return found + return found, nil, true end --- ofm and tfm, returns pair for i=1, #type1_formats do local format = type1_formats[i] if resolvers.findfile(filename, format) then - return file.addsuffix(filename, format), format + return file.addsuffix(filename, format), format, true end end - return filename, nil + return filename, nil, false end --- string -> (string | string * string) @@ -557,15 +557,17 @@ crude_file_lookup = function (filename) if found == nil then found = dummy_findfile(filename) end - return found or filename + return found or filename, nil, true end + for i=1, #type1_formats do local format = type1_formats[i] if resolvers.findfile(filename, format) then - return file.addsuffix(filename, format), format + return file.addsuffix(filename, format), format, true end end - return filename, nil + + return filename, nil, false end --[[doc-- diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index a187e12..e8513be 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -554,7 +554,6 @@ local print_features = function (features) for script, languages in next, data do local field = stringformat(key_fmt, script).. fieldseparator .. " " local wd_field = #field - --inspect(languages.list) local lines = reflow(languages.list, textwidth - wd_field) local indent = stringrep(" ", wd_field) texiowrite_nl(field) @@ -817,8 +816,22 @@ actions.query = function (job) tmpspec = names.handle_request (tmpspec) - local foundname, subfont, success = - names.resolve(nil, nil, tmpspec) + local foundname, subfont, success + + if tmpspec.lookup == "name" + or tmpspec.lookup == "anon" --- not *exactly* as resolvers.anon + then + foundname, subfont = names.resolve (nil, nil, tmpspec) + if foundname then + foundname = names.crude_file_lookup (foundname) + if foundname then + success = true + end + end + elseif tmpspec.lookup == "file" then + foundname, subfont, success = + names.crude_file_lookup (tmpspec.name) + end if success then logs.names_report(false, 0, @@ -841,7 +854,7 @@ actions.query = function (job) if job.fuzzy == true then logs.names_report(false, 0, "resolve", "Looking for close matches, this may take a while ...") - local success = names.find_closest(query, job.fuzzy_limit) + local _success = names.find_closest(query, job.fuzzy_limit) end end return true, true |