diff options
-rw-r--r-- | luaotfload-database.lua | 6 | ||||
-rwxr-xr-x | luaotfload-tool.lua | 17 | ||||
-rw-r--r-- | luaotfload-tool.rst | 5 |
3 files changed, 23 insertions, 5 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index d12c554..3d2b073 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -267,6 +267,7 @@ local flush_lookup_cache local font_fullinfo local load_names local load_lookups +local read_blacklist local read_fonts_conf local reload_db local resolve @@ -1193,7 +1194,7 @@ local create_blacklist = function (blacklist, whitelist) end --- unit -> unit -local read_blacklist = function () +read_blacklist = function () local files = { kpselookup("luaotfload-blacklist.cnf", {all=true, format="tex"}) } @@ -1213,7 +1214,7 @@ local read_blacklist = function () else local cmt = stringfind(line, "%%") if cmt then - line = stringsub(line, cmt - 1) + line = stringsub(line, 1, cmt - 1) end line = stringstrip(line) report("log", 2, "db", "blacklisted file ā%sā", line) @@ -1900,6 +1901,7 @@ names.save = save_names names.update = update_names names.crude_file_lookup = crude_file_lookup names.crude_file_lookup_verbose = crude_file_lookup_verbose +names.read_blacklist = read_blacklist --- font cache names.purge_cache = purge_cache diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 25cc9fa..e3f5a93 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -183,6 +183,7 @@ This tool is part of the luaotfload package. Valid options are: --list=<criterion> output list of entries by field <criterion> --list=<criterion>:<value> restrict to entries with <criterion>=<value> --fields=<f1>,<f2>,ā¦,<fn> which fields <f> to print with --list + -b --show-blacklist show blacklisted files The font database will be saved to %s @@ -269,7 +270,7 @@ set. --]]-- local action_sequence = { - "loglevel", "help", "version", "cache", + "loglevel", "help", "version", "blacklist", "cache", "flush", "generate", "list", "query", } local action_pending = table.tohash(action_sequence, false) @@ -297,6 +298,15 @@ actions.help = function (job) return true, false end +actions.blacklist = function (job) + names.read_blacklist() + local n = 0 + for n, entry in next, table.sortedkeys(fonts.names.blacklist) do + texiowrite_nl(stringformat("(%d %s)", n, entry)) + end + return true, false +end + actions.generate = function (job) local fontnames, savedname fontnames = names.update(fontnames, job.force_reload, job.dry_run) @@ -565,12 +575,13 @@ local process_cmdline = function ( ) -- unit -> jobspec log = 1, ["prefer-texmf"] = "p", quiet = "q", + ["show-blacklist"] = "b", update = "u", verbose = 1 , version = "V", } - local short_options = "DfFilpquvVh" + local short_options = "bDfFilpquvVh" local options, _, optarg = alt_getopt.get_ordered_opts (arg, short_options, long_options) @@ -633,6 +644,8 @@ local process_cmdline = function ( ) -- unit -> jobspec result.dry_run = true elseif v == "p" then config.luaotfload.prioritize = "texmf" + elseif v == "b" then + action_pending["blacklist"] = true end end diff --git a/luaotfload-tool.rst b/luaotfload-tool.rst index a428375..06ab1cc 100644 --- a/luaotfload-tool.rst +++ b/luaotfload-tool.rst @@ -15,7 +15,7 @@ SYNOPSIS ======================================================================= -**luaotfload** [ -cfFipquvVh ] +**luaotfload** [ -bDcfFipquvVh ] **luaotfload** --update [ --force ] [ --quiet ] [ --verbose ] [ --prefer-texmf ] [ --dry-run ] @@ -31,6 +31,8 @@ SYNOPSIS **luaotfload** --version +**luaotfload** --show-blacklist + DESCRIPTION ======================================================================= @@ -71,6 +73,7 @@ query mode ``--find``). --info, -i Display basic information to a resolved font file (requires ``--find``). +--show-blacklist, -b Show blacklisted files (not directories). --list=CRITERION Show entries, where *CRITERION* is one of the following: |