diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-01 17:17:17 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-01 17:17:17 +0200 |
commit | c2e57ff4e741bf8f2a44cf98101bce0447c72190 (patch) | |
tree | de161a91e5dbce7e0edbed98b77339d4fdfb5254 | |
parent | 898fa8861c06b41acd946a1de35a13c64e26d22c (diff) | |
download | luaotfload-c2e57ff4e741bf8f2a44cf98101bce0447c72190.tar.gz |
[tool] seek correct language data with --inspect
-rwxr-xr-x | luaotfload-tool.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 3bec847..9ccf27c 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -486,7 +486,7 @@ local general_fields = { { "design_range_bottom", "l", "design size min" }, { "design_range_top", "l", "design size max" }, { "fontstyle_id", "l", "font style id" }, - { "fontstyle_name", "l", "font style name" }, + { "fontstyle_name", "S", "font style name" }, { "strokewidth", "l", "stroke width" }, { "units_per_em", "l", "units per em" }, { "ascent", "l", "ascender height" }, @@ -506,6 +506,25 @@ local display_general = function (fullinfo) local val if mode == "l" then val = fullinfo[key] + elseif mode == "S" then --- style names table + local data = fullinfo[key] + if type (data) == "table" then + if #data > 0 then + for n = 1, #data do + local nth = data[n] + if nth.lang == 1033 then + val = nth.name + goto found + end + end + val = next (data).name + else + val = "" + end + ::found:: + else + val = data + end elseif mode == "n" then local v = fullinfo[key] if v then |