From a59d8dc80df1e9359938f0fc2e2b1d335f863bbf Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 12 Nov 2013 23:21:11 +0100 Subject: [db,tool] default to compressed plaintext index --- luaotfload-tool.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 0cc26d2..f1e4808 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -183,6 +183,7 @@ local sanitize_fontname = names.sanitize_fontname local pathdata = names.path local names_plain = pathdata.index.lua +local names_gzip = names_plain .. ".gz" local names_bin = pathdata.index.luc local help_messages = { @@ -219,7 +220,7 @@ This tool is part of the luaotfload package. Valid options are: -n --no-reload suppress db update --no-strip keep redundant information in db -f --force force re-indexing all fonts - -c --compress gzip index file (text version only) + -c --no-compress do not gzip index file (text version only) -l --flush-lookups empty lookup cache of font requests -D --dry-run skip loading of fonts, just scan --formats=[+|-]EXTENSIONS set, add, or subtract formats to index @@ -293,7 +294,8 @@ local help_msg = function (version) local template = help_messages[version] iowrite(stringformat(template, luaotfloadconfig.self, - names_plain, +-- names_plain, + names_gzip, names_bin, caches.getwritablepath ( luaotfloadconfig.cache_dir))) @@ -1097,7 +1099,7 @@ local process_cmdline = function ( ) -- unit -> jobspec local long_options = { alias = 1, cache = 1, - compress = "c", + ["no-compress"] = "c", diagnose = 1, ["dry-run"] = "D", ["flush-lookups"] = "l", @@ -1214,7 +1216,7 @@ local process_cmdline = function ( ) -- unit -> jobspec --- dev only, undocumented luaotfloadconfig.skip_read = true elseif v == "c" then - luaotfloadconfig.compress = true + luaotfloadconfig.compress = false elseif v == "no-strip" then luaotfloadconfig.strip = false end -- cgit v1.2.3 From a914c23b674ff6bacb85a9701a828e03ec24cbc0 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 13 Nov 2013 00:32:35 +0100 Subject: [tool,man,db] add --max-fonts option to restrict db size --- luaotfload-tool.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index f1e4808..41ac4d7 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -225,6 +225,7 @@ This tool is part of the luaotfload package. Valid options are: -D --dry-run skip loading of fonts, just scan --formats=[+|-]EXTENSIONS set, add, or subtract formats to index -p --prefer-texmf prefer fonts in the TEXMF over system fonts + --max-fonts=N process at most N font files --find="font name" query the database for a font name -F --fuzzy look for approximate matches if --find fails @@ -1114,6 +1115,7 @@ local process_cmdline = function ( ) -- unit -> jobspec limit = 1, list = 1, log = 1, + ["max-fonts"] = 1, ["no-reload"] = "n", ["no-strip"] = 0, ["skip-read"] = "R", @@ -1219,6 +1221,14 @@ local process_cmdline = function ( ) -- unit -> jobspec luaotfloadconfig.compress = false elseif v == "no-strip" then luaotfloadconfig.strip = false + elseif v == "max-fonts" then + local n = optarg[n] + if n then + n = tonumber(lvl) + if n and n > 0 then + luaotfloadconfig.max_fonts = n + end + end end end -- cgit v1.2.3 From 32a5a40a2f99bf82436bfec8926fe7bfeaa1194d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 13 Nov 2013 00:38:07 +0100 Subject: [db] simplify loop exit condition --- luaotfload-tool.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'luaotfload-tool.lua') diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 41ac4d7..a945ee2 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -1224,7 +1224,7 @@ local process_cmdline = function ( ) -- unit -> jobspec elseif v == "max-fonts" then local n = optarg[n] if n then - n = tonumber(lvl) + n = tonumber(n) if n and n > 0 then luaotfloadconfig.max_fonts = n end -- cgit v1.2.3