summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-06-21 00:21:33 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2015-06-21 00:21:33 +0200
commit6f273e157c650d396cbad8e09e059b8b7c359818 (patch)
treefbf3a288f190c5f057a95eb796aee421ad5612a5 /src/luaotfload-database.lua
parent90f398e1c9d2896b2d30d0b66f9c8a88255511a8 (diff)
parente8a56b051a32ed4c468c9325048ded01002a841a (diff)
downloadluaotfload-6f273e157c650d396cbad8e09e059b8b7c359818.tar.gz
Merge pull request #276 from phi-gamma/master
fixes; current progress regarding initialization
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r--src/luaotfload-database.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 099c256..1831ca3 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -482,8 +482,8 @@ local fonts_reloaded = false
--- limit output when approximate font matching (luaotfload-tool -F)
local fuzzy_limit = 1 --- display closest only
---- bool? -> dbobj
-load_names = function (dry_run)
+--- bool? -> -> bool? -> dbobj option
+load_names = function (dry_run, no_rebuild)
local starttime = osgettimeofday ()
local foundname, data = load_lua_file (config.luaotfload.paths.index_path_lua)
@@ -519,6 +519,11 @@ load_names = function (dry_run)
end
end
else
+ if no_rebuild == true then
+ report ("both", 2, "db",
+ [[Database does not exist, skipping rebuild though.]])
+ return false
+ end
report ("both", 0, "db",
[[Font names database not found, generating new one.]])
report ("both", 0, "db",
@@ -545,8 +550,11 @@ access_font_index = function ()
end
getmetadata = function ()
- if not name_index then name_index = load_names() end
- return tablefastcopy (name_index.meta)
+ if not name_index then
+ name_index = load_names (false, true)
+ if name_index then return tablefastcopy (name_index.meta) end
+ end
+ return false
end
--- unit -> unit