summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-03-23 14:40:21 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-03-23 14:40:21 +0100
commita026ac6112b4a22aedc9c20a867da02afb734f56 (patch)
tree0ac6ba55e2d4eb6683b671f3c4d3f96292904613 /src/luaotfload-database.lua
parent7d5a6d63019e5dfc750a63dc957439a83d4f3307 (diff)
downloadluaotfload-a026ac6112b4a22aedc9c20a867da02afb734f56.tar.gz
[db,tool] add bisection initialization routines
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r--src/luaotfload-database.lua22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 17cb4fd..3cccc17 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -2922,7 +2922,9 @@ end
--- dbobj -> dbobj -> int -> int -> string * bool list
local collect_font_filenames = function ()
- ---
+
+ report ("info", 4, "db", "Scanning the filesystem for font files.")
+
local filenames = { }
tableappend (filenames, collect_font_filenames_texmf ())
tableappend (filenames, collect_font_filenames_system ())
@@ -2932,6 +2934,23 @@ local collect_font_filenames = function ()
return filenames
end
+--[[doc
+
+ count_font_files -- Return the number of files found by
+ collect_font_filenames. This function is exported primarily
+ for use with luaotfload-tool.lua in bisect mode.
+
+--doc]]--
+
+--- unit -> int
+local count_font_files = function ()
+ report ("info", 4, "db", "Counting font files.")
+ if not p_blacklist then
+ read_blacklist ()
+ end
+ return #collect_font_filenames ()
+end
+
--- dbobj -> stats
local collect_statistics = function (mappings)
@@ -3459,6 +3478,7 @@ names.read_blacklist = read_blacklist
names.sanitize_fontname = sanitize_fontname
names.getfilename = resolve_fullpath
names.set_location_precedence = set_location_precedence
+names.count_font_files = count_font_files
--- font cache
names.purge_cache = purge_cache