summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-02-14 23:01:00 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-02-14 23:01:00 +0100
commitfa25005e7ad5ffc537b5aaf39d1b3562daf8f5eb (patch)
tree3eb95369d2ede4428e4d314dedd13c880fd32ef5 /src
parent54269ef7c476dc4952ea2e6c08b6e2bfa9f68ba5 (diff)
downloadluaotfload-fa25005e7ad5ffc537b5aaf39d1b3562daf8f5eb.tar.gz
[db,tool] make local font scan part of update_names()
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-database.lua41
-rwxr-xr-xsrc/luaotfload-tool.lua2
2 files changed, 22 insertions, 21 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 06a3dea..54a0398 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -535,28 +535,28 @@ local load_lua_file = function (path)
end
--- define locals in scope
+local collect_families
local crude_file_lookup
local crude_file_lookup_verbose
local find_closest
local flush_lookup_cache
-local ot_fullinfo
-local t1_fullinfo
-local load_names
+local generate_filedata
+local get_font_filter
+local group_modifiers
local load_lookups
+local load_names
+local order_design_sizes
+local ot_fullinfo
local read_blacklist
local reload_db
-local resolve_name
local resolve_cached
local resolve_fullpath
-local save_names
+local resolve_name
local save_lookups
-local update_names
-local get_font_filter
+local save_names
local set_font_filter
-local generate_filedata
-local collect_families
-local group_modifiers
-local order_design_sizes
+local t1_fullinfo
+local update_names
--- state of the database
local fonts_reloaded = false
@@ -2407,20 +2407,16 @@ end
--doc]]--
-local scan_local_fonts = function ()
+local scan_local_fonts = function (currentnames,
+ targetnames,
+ dry_run)
local n_scanned, n_new = 0, 0
local pwd = lfscurrentdir ()
- local name_index = name_index
report ("both", 1, "db", "Scanning fonts in $PWD (%q) ...", pwd)
- n_scanned, n_new = scan_dir (pwd, name_index, name_index, false, "local")
+ n_scanned, n_new = scan_dir (pwd, currentnames, targetnames, false, "local")
if n_new > 0 then
- name_index.files = generate_filedata (name_index.mappings)
- name_index.families = collect_families (name_index.mappings)
- name_index.families = group_modifiers (name_index.mappings,
- name_index.families)
- name_index.families = order_design_sizes (name_index.families)
- name_index.meta["local"] = true --- prevent saving to disk
+ targetnames.meta["local"] = true --- prevent saving to disk
end
return n_scanned, n_new
@@ -2938,6 +2934,11 @@ local retrieve_namedata = function (currentnames,
n_rawnames = n_rawnames + rawnames
n_newnames = n_newnames + new
+ rawnames, new = scan_local_fonts (currentnames, targetnames, dry_run)
+
+ n_rawnames = n_rawnames + rawnames
+ n_newnames = n_newnames + new
+
return n_rawnames, n_newnames
end
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 9f00956..d405dc7 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -1174,7 +1174,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
action_pending["flush"] = true
elseif v == "L" then
action_pending["generate"] = true
- action_pending["scan_local"] = true
+ luaotfloadconfig.scan_local = true
elseif v == "list" then
action_pending["list"] = true
result.criterion = optarg[n]