From c2e57ff4e741bf8f2a44cf98101bce0447c72190 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 1 Aug 2013 17:17:17 +0200 Subject: [tool] seek correct language data with --inspect --- luaotfload-tool.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3