diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-04-18 20:53:29 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-04-18 20:53:29 +0200 |
commit | a119b257eb5ad1a9ce9a9015d082f28fd2a3527e (patch) | |
tree | be6f43d38271684cd8f7e3ce855f69aef3db43ee /src/luaotfload-tool.lua | |
parent | c8734018b81eb2120372493a3767617eeaf0299c (diff) | |
parent | 0ed66c28f6f48c8250a903bed9abf6aee6d8dd39 (diff) | |
download | luaotfload-a119b257eb5ad1a9ce9a9015d082f28fd2a3527e.tar.gz |
Merge pull request #331 from phi-gamma/master
current progress on 2.7
Diffstat (limited to 'src/luaotfload-tool.lua')
-rwxr-xr-x | src/luaotfload-tool.lua | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index 9b8ffc3..4b4dc50 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -267,8 +267,6 @@ Usage: %s [OPTIONS...] -i --info display basic font metadata -I --inspect display detailed font metadata - -w --warnings display warnings generated by the - fontloader library --list=<criterion> output list of entries by field <criterion> --list=<criterion>:<value> restrict to entries with <criterion>=<value> @@ -455,29 +453,6 @@ local show_info_items = function (fontinfo) texiowrite_nl "" end -local p_eol = S"\n\r"^1 -local p_space = S" \t\v"^0 -local p_line = p_space * C((1 - p_eol)^1)^-1 -local p_lines = Ct(p_line * (p_eol^1 * p_line^-1)^0) - -local show_fontloader_warnings = function (ws) - local nws = #ws - print_heading(stringformat( - [[the fontloader emitted %d warnings]], - nws), 2) - texiowrite_nl "" - for i=1, nws do - local w = ws[i] - texiowrite_nl (stringformat("%d:", i)) - local lines = lpegmatch(p_lines, w) - for i=1, #lines do - local line = lines[i] - texiowrite_nl(" ยท " .. line) - end - texiowrite_nl "" - end -end - local p_spacechar = S" \n\r\t\v" local p_wordchar = (1 - p_spacechar) local p_whitespace = p_spacechar^1 @@ -657,11 +632,8 @@ local display_features = function (features) end end -local show_full_info = function (path, subfont, warnings) +local show_full_info = function (path, subfont) local rawinfo, warn = fonts.handlers.otf.readers.loadfont (path, subfont) - if warnings then - show_fontloader_warnings(warn) - end if not rawinfo then texiowrite_nl(stringformat([[cannot open font %s]], path)) return @@ -694,7 +666,7 @@ The font info knows two levels of detail: returned by readers.loadfont(). --doc]]-- -local show_font_info = function (basename, askedname, detail, warnings) +local show_font_info = function (basename, askedname, detail) local filenames = fonts.names.data().files local index = filenames.base[basename] local fullname = filenames.full[index] @@ -720,7 +692,7 @@ local show_font_info = function (basename, askedname, detail, warnings) if subfont then show_info_items(subfont) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end else -- list all subfonts logreport (true, 1, "resolve", @@ -730,14 +702,14 @@ local show_font_info = function (basename, askedname, detail, warnings) [[Showing info for font no. %d]], n) show_info_items(shortinfo[subfont]) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end end else show_info_items(shortinfo) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end else @@ -1212,7 +1184,7 @@ actions.query = function (job) "Resolved file name %q", foundname) end if job.show_info then - show_font_info (foundname, query, job.full_info, job.warnings) + show_font_info (foundname, query, job.full_info) iowrite "\n" end else @@ -1437,7 +1409,6 @@ local process_cmdline = function ( ) -- unit -> jobspec local result = { -- jobspec force_reload = nil, full_info = false, - warnings = false, criterion = "", query = "", log_level = nil, @@ -1478,10 +1449,9 @@ local process_cmdline = function ( ) -- unit -> jobspec update = "u", verbose = 1, version = "V", - warnings = "w", } - local short_options = "bcDfFiIlLnpqRSuvVhw" + local short_options = "bcDfFiIlLnpqRSuvVh" local options, _, optarg = alt_getopt.get_ordered_opts (arg, short_options, long_options) @@ -1513,12 +1483,7 @@ local process_cmdline = function ( ) -- unit -> jobspec if lvl then lvl = tonumber(lvl) result.log_level = lvl - if lvl > 2 then - result.warnings = true - end end - elseif v == "w" then - result.warnings = true elseif v == "log" then local str = optarg[n] if str then |