summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-03-24 07:55:34 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-03-24 07:55:34 +0100
commit2d555b40fc580e3ef9328a1f47544d4286b8b860 (patch)
treefdf6aa12e4ffc178aa0d64a60ee8feb9e1a30516 /src/luaotfload-database.lua
parent82a06a10cef0ab4ee3fbe8c83facb1b017fbf6ef (diff)
downloadluaotfload-2d555b40fc580e3ef9328a1f47544d4286b8b860.tar.gz
[db,tool] reconcile --bisect with --max-fonts
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r--src/luaotfload-database.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index e4188dc..936e380 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -2335,7 +2335,6 @@ local retrieve_namedata = function (files, currentnames, targetnames, dry_run)
local nfiles = #files
local nnew = 0
- local max_fonts = luaotfloadconfig.max_fonts or 2^51
report ("info", 1, "db", "Scanning %d collected font files ...", nfiles)
@@ -2344,7 +2343,7 @@ local retrieve_namedata = function (files, currentnames, targetnames, dry_run)
, system = { 0, 0 }
}
report_status_start (2, 4)
- for i = 1, (nfiles < max_fonts) and nfiles or max_fonts do
+ for i = 1, nfiles do
local fullname, location = unpack (files[i])
local count = bylocation[location]
count[1] = count[1] + 1
@@ -2934,11 +2933,18 @@ local collect_font_filenames = function ()
local filenames = { }
local bisect = luaotfloadconfig.bisect
+ local max_fonts = luaotfloadconfig.max_fonts or 2^51 --- XXX revisit for lua 5.3 wrt integers
+
tableappend (filenames, collect_font_filenames_texmf ())
tableappend (filenames, collect_font_filenames_system ())
if luaotfloadconfig.scan_local == true then
tableappend (filenames, collect_font_filenames_local ())
end
+ --- Now drop everything above max_fonts.
+ if max_fonts < #filenames then
+ filenames = { unpack (filenames, 1, max_fonts) }
+ end
+ --- And choose the requested slice if in bisect mode.
if bisect then
return { unpack (filenames, bisect[1], bisect[2]) }
end