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(-) (limited to 'luaotfload-tool.lua') 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 From c23480eb487cce1a55c6e3957a17b52330ad34c4 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 2 Aug 2013 22:00:39 +0200 Subject: [db] always save on update --- luaotfload-tool.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 9ccf27c..c3bf3bb 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -763,8 +763,7 @@ actions.generate = function (job) fontnames = names.update(fontnames, job.force_reload, job.dry_run) logs.names_report("info", 2, "db", "Fonts in the database: %i", #fontnames.mappings) - local success = names.save(fontnames) - if success then + if names.data then return true, true end return false, false -- cgit v1.2.3 From 8d890cb8e98d50f13bfe2a279da5ce3518458ac1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:06:03 +0200 Subject: [tool] add option --no-reload to suppress database updates --- luaotfload-tool.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index c3bf3bb..11013e9 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -209,6 +209,7 @@ This tool is part of the luaotfload package. Valid options are: DATABASE -u --update update the database + -n --no-reload suppress db update -f --force force re-indexing all fonts -l --flush-lookups empty lookup cache of font requests -D --dry-run skip loading of fonts, just scan @@ -1044,6 +1045,7 @@ local process_cmdline = function ( ) -- unit -> jobspec limit = 1, list = 1, log = 1, + ["no-reload"] = "n", ["prefer-texmf"] = "p", quiet = "q", ["show-blacklist"] = "b", @@ -1054,7 +1056,7 @@ local process_cmdline = function ( ) -- unit -> jobspec warnings = "w", } - local short_options = "bDfFiIlpquvVhw" + local short_options = "bDfFiIlnpquvVhw" local options, _, optarg = alt_getopt.get_ordered_opts (arg, short_options, long_options) @@ -1133,6 +1135,8 @@ local process_cmdline = function ( ) -- unit -> jobspec result.asked_diagnostics = optarg[n] elseif v == "formats" then names.set_font_filter (optarg[n]) + elseif v == "n" then + config.luaotfload.update_live = false end end -- cgit v1.2.3 From 24ef88fda9d592e880c4694b50c64c5ae0b74a92 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:22:56 +0200 Subject: [tool] make --find process normal requests --- luaotfload-tool.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 11013e9..a187e12 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -753,7 +753,7 @@ end actions.blacklist = function (job) names.read_blacklist() local n = 0 - for n, entry in next, table.sortedkeys(fonts.names.blacklist) do + for n, entry in next, table.sortedkeys(names.blacklist) do texiowrite_nl(stringformat("(%d %s)", n, entry)) end return true, false @@ -803,16 +803,22 @@ end actions.query = function (job) + require "luaotfload-features" + local query = job.query + local tmpspec = { name = query, lookup = "name", - specification = "name:" .. query, + specification = query, optsize = 0, + features = { }, } + tmpspec = names.handle_request (tmpspec) + local foundname, subfont, success = - fonts.names.resolve(nil, nil, tmpspec) + names.resolve(nil, nil, tmpspec) if success then logs.names_report(false, 0, @@ -835,7 +841,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 = fonts.names.find_closest(query, job.fuzzy_limit) + local success = names.find_closest(query, job.fuzzy_limit) end end return true, true -- cgit v1.2.3 From 358258ab83d2bc0d9d8ad141427c7df989425c90 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:44:30 +0200 Subject: [tool] handle anon: and file: requests with --find --- luaotfload-tool.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'luaotfload-tool.lua') 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 -- cgit v1.2.3 From 04f06993d2d9981267e803eaa7dd034a3d57f9eb Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:50:13 +0200 Subject: [tool] interpret file lookup result correctly --- luaotfload-tool.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index e8513be..e95bba4 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -823,13 +823,10 @@ actions.query = function (job) then foundname, subfont = names.resolve (nil, nil, tmpspec) if foundname then - foundname = names.crude_file_lookup (foundname) - if foundname then - success = true - end + foundname, _, success = names.crude_file_lookup (foundname) end elseif tmpspec.lookup == "file" then - foundname, subfont, success = + foundname, _, success = names.crude_file_lookup (tmpspec.name) end -- cgit v1.2.3 From 51ac04816f89f7d38ce499d3ce81b34621e1869e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 3 Aug 2013 22:56:12 +0200 Subject: [tool] handle missing size info --- luaotfload-tool.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index e95bba4..c80f98e 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -816,6 +816,10 @@ actions.query = function (job) tmpspec = names.handle_request (tmpspec) + if not tmpspec.size then + tmpspec.size = 655360 --- assume 10pt + end + local foundname, subfont, success if tmpspec.lookup == "name" -- cgit v1.2.3 From 645d1c970f45b4f322b687882af351f088dd748c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 5 Aug 2013 10:47:58 +0200 Subject: [tool] make --inspect skip empty feature sets --- luaotfload-tool.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index c80f98e..d5cd8e7 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -610,11 +610,20 @@ end local display_features = function (gsub, gpos) texiowrite_nl "" - print_heading("Features", 2) - print_heading("GSUB Features", 3) - display_feature_set(gsub) - print_heading("GPOS Features", 3) - display_feature_set(gpos) + + if gsub or gpos then + print_heading("Features", 2) + + if gsub then + print_heading("GSUB Features", 3) + display_feature_set(gsub) + end + + if gpos then + print_heading("GPOS Features", 3) + display_feature_set(gpos) + end + end end local show_full_info = function (path, subfont, warnings) -- cgit v1.2.3