summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luaotfload-database.lua22
-rwxr-xr-xsrc/luaotfload-tool.lua18
2 files changed, 39 insertions, 1 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index a369d8e..e4188dc 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -2953,7 +2953,7 @@ end
--- int -> string
local nth_font_filename = function (n)
- report ("info", 4, "db", "Picking the %d font file.", n)
+ report ("info", 4, "db", "Picking font file no. %d.", n)
if not p_blacklist then
read_blacklist ()
end
@@ -2961,6 +2961,25 @@ local nth_font_filename = function (n)
return filenames[n] and filenames[n][1] or "<error>"
end
+--[[doc--
+
+ font_slice -- Return the fonts in the range from lo to hi.
+
+--doc]]--
+
+local font_slice = function (lo, hi)
+ report ("info", 4, "db", "Retrieving font files nos. %d--%d.", lo, hi)
+ if not p_blacklist then
+ read_blacklist ()
+ end
+ local filenames = collect_font_filenames ()
+ local result = { }
+ for i = lo, hi do
+ result[#result + 1] = filenames[i][1]
+ end
+ return result
+end
+
--[[doc
count_font_files -- Return the number of files found by
@@ -3507,6 +3526,7 @@ names.getfilename = resolve_fullpath
names.set_location_precedence = set_location_precedence
names.count_font_files = count_font_files
names.nth_font_filename = nth_font_filename
+names.font_slice = font_slice
--- font cache
names.purge_cache = purge_cache
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 2301636..60d2c2c 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -906,6 +906,21 @@ end
--[[doc--
+ list_remainder -- Show remaining fonts in bisect slice.
+
+--doc]]--
+
+local list_remainder = function (lo, hi)
+ local fonts = names.font_slice (lo, hi)
+ report ("info", 0, "bisect", "%d fonts left.", hi - lo)
+ for i = 1, #fonts do
+ report ("info", 1, "bisect", " ยท %2d: %s", lo, fonts[i])
+ lo = lo + 1
+ end
+end
+
+--[[doc--
+
bisect_set -- Prepare the next bisection step by setting high, low,
and pivot to new values.
@@ -950,6 +965,9 @@ local bisect_set = function (outcome)
status[nsteps + 1] = { lo, hi, pivot }
write_bisect_status (status)
+ if hi - lo <= 10 then
+ list_remainder (lo, hi)
+ end
return true, false
end