summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-05 22:15:25 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-05 22:15:25 +0200
commiteb98a810de3fe122becdbe2390fec7dd87399970 (patch)
tree28506ac6ad3023a9a51177406d971c85de3b49c0
parent9d65d315f712d3a5bd710639dad96cf273123746 (diff)
downloadluaotfload-eb98a810de3fe122becdbe2390fec7dd87399970.tar.gz
db: enforce db.update_live option
-rw-r--r--src/luaotfload-database.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 3191a0b..4fbf797 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -656,6 +656,12 @@ crude_file_lookup_verbose = function (filename)
return file.addsuffix(filename, format), format, true
end
end
+
+ if not fonts_reloaded and config.luaotfload.db.update_live == true then
+ return reload_db (stringformat ("File not found: %s.", filename),
+ crude_file_lookup_verbose,
+ filename)
+ end
return filename, nil, false
end
@@ -713,6 +719,11 @@ crude_file_lookup = function (filename)
end
end
+ if not fonts_reloaded and config.luaotfload.db.update_live == true then
+ return reload_db (stringformat ("File not found: %s.", filename),
+ crude_file_lookup_verbose,
+ filename)
+ end
return filename, nil, false
end
@@ -1129,8 +1140,9 @@ resolve_name = function (specification)
end
if not resolved then
- if not fonts_reloaded then
- return reload_db ("Font not found.",
+ if not fonts_reloaded and config.luaotfload.db.update_live == true then
+ return reload_db (stringformat ("Font %s not found.",
+ specification.name or "<?>"),
resolve_name,
specification)
end
@@ -1171,7 +1183,7 @@ reload_db = function (why, caller, ...)
local namedata = name_index
local formats = tableconcat (namedata.meta.formats, ",")
- report ("both", 1, "db",
+ report ("both", 0, "db",
"Reload initiated (formats: %s); reason: %q.",
formats, why)
@@ -1223,7 +1235,7 @@ find_closest = function (name, limit)
if not name_index then name_index = load_names () end
if not name_index or type (name_index) ~= "table" then
if not fonts_reloaded then
- return reload_db("no database", find_closest, name)
+ return reload_db("Font index missing.", find_closest, name)
end
return false
end