diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-09-29 22:46:46 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-09-29 22:46:50 +0200 |
commit | e7df86aa0afab9d353313a2d2d9bc66045fd823c (patch) | |
tree | cc13d5de7f21598366a18361c758852236580c43 /src | |
parent | 75e49e7772c6acbd13b96e001f05c232a380f729 (diff) | |
download | luaotfload-e7df86aa0afab9d353313a2d2d9bc66045fd823c.tar.gz |
[features,tool] fix subfont handling in file loading
Subfont loading seems to have been broken for a while but no reports …
Diffstat (limited to 'src')
-rw-r--r-- | src/luaotfload-features.lua | 2 | ||||
-rwxr-xr-x | src/luaotfload-tool.lua | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 285482f..a57aac3 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -1243,7 +1243,7 @@ local handle_request = function (specification) specification.features = features end features.normal = normalize (request.features) - local subfont = tonumber (specification.sub) + local subfont = tonumber (request.sub) if subfont and subfont >= 0 then specification.sub = subfont + 1 else diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index aa9b5b2..6c1f7d1 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -181,7 +181,7 @@ end require "alt_getopt" -loadmodule "log.lua" --- this populates the luaotfload.log.* namespace +loadmodule "log" --- this populates the luaotfload.log.* namespace loadmodule "parsers" --- fonts.conf, configuration, and request syntax loadmodule "configuration" --- configuration file handling loadmodule "database" @@ -655,7 +655,7 @@ subfont_by_name = function (lst, askedname, n) if fonts.names.sanitize_fontname (font.fullname) == askedname then return font end - return subfont_by_name (lst, askedname, n) + return subfont_by_name (lst, askedname, n + 1) end return false end @@ -668,7 +668,7 @@ The font info knows two levels of detail: returned by readers.loadfont(). --doc]]-- -local show_font_info = function (basename, askedname, detail) +local show_font_info = function (basename, askedname, detail, subfont) local filenames = fonts.names.data().files local index = filenames.base[basename] local fullname = filenames.full[index] @@ -678,7 +678,7 @@ local show_font_info = function (basename, askedname, detail) end if fullname then local shortinfo = fonts.handlers.otf.readers.getinfo (fullname, { - subfont = nil, + subfont = subfont, platformnames = true, rawfamilynames = true, }) @@ -1173,7 +1173,8 @@ actions.query = function (job) needle = tmpspec.resolved or tmpspec.name end elseif tmpspec.lookup == "file" then - needle = tmpspec.name + needle = tmpspec.name + subfont = tmpspec.sub end if needle then @@ -1191,7 +1192,8 @@ actions.query = function (job) "Resolved file name %q", foundname) end if job.show_info then - show_font_info (foundname, query, job.full_info) + logreport (false, 3, "resolve", "Dump extra info.") + show_font_info (foundname, query, job.full_info, subfont) iowrite "\n" end else |