summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 23:50:26 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-29 23:50:26 +0200
commit957606b6e33452c93df52fe9490fd6c0c7486c3c (patch)
tree0077f252932aac83b1d4e2816a0009a073fcb22e
parent3e100857c96b4796d009fe8b426e79c54c4b8941 (diff)
downloadluaotfload-957606b6e33452c93df52fe9490fd6c0c7486c3c.tar.gz
add option to disable live db updates
-rw-r--r--luaotfload-database.lua25
-rw-r--r--tests/pln-tfm.tex2
2 files changed, 20 insertions, 7 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 037ca07..529cdf3 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -79,9 +79,14 @@ names.path = {
path = "",
}
-config = config or { }
-config.luaotfload = config.luaotfload or { }
-config.luaotfload.resolver = config.luaotfload.resolver or "normal"
+config = config or { }
+config.luaotfload = config.luaotfload or { }
+config.luaotfload.resolver = config.luaotfload.resolver or "normal"
+if config.luaotfload.update_live ~= false then
+ --- this option allows for disabling updates
+ --- during a TeX run
+ config.luaotfload.update_live = true
+end
-- We use the cache.* of ConTeXt (see luat-basics-gen), we can
-- use it safely (all checks and directory creations are already done). It
@@ -677,7 +682,7 @@ end --- resolve()
--- string -> ('a -> 'a) -> 'a list -> 'a
reload_db = function (why, caller, ...)
- report("log", 1, "db", "reload initiated; reason: “%s”", why)
+ report("both", 1, "db", "reload initiated; reason: “%s”", why)
names.data = update_names()
save_names(names.data)
fonts_reloaded = true
@@ -1392,6 +1397,12 @@ end
--- dbobj -> bool -> dbobj
update_names = function (fontnames, force)
+ if config.luaotfload.update_live == false then
+ report("info", 2, "db",
+ "skipping database update")
+ --- skip all db updates
+ return fontnames
+ end
local starttime = os.gettimeofday()
local n_scanned, n_new = 0, 0
--[[
@@ -1399,7 +1410,7 @@ update_names = function (fontnames, force)
- “newfontnames” is the final table to return
- force is whether we rebuild it from scratch or not
]]
- report("info", 2, "db", "Updating the font names database"
+ report("both", 2, "db", "Updating the font names database"
.. (force and " forcefully" or ""))
if force then
@@ -1409,8 +1420,8 @@ update_names = function (fontnames, force)
fontnames = load_names()
end
if fontnames.version ~= names.version then
- report("log", 1, "db", "No font names database or old "
- .. "one found; generating new one")
+ report("both", 1, "db", "No font names database or old "
+ .. "one found; generating new one")
fontnames = fontnames_init(true)
end
end
diff --git a/tests/pln-tfm.tex b/tests/pln-tfm.tex
index 26fa738..16ae41a 100644
--- a/tests/pln-tfm.tex
+++ b/tests/pln-tfm.tex
@@ -3,6 +3,8 @@
\font\antykwatorunska="file:rm-anttr"
%% or with an anonymous request, like in þe olde TeX:
\font\antykwatorunskabcap=ec-anttbcap
+\font\lmromanten={file:ec-lmr10} at 10pt
\antykwatorunska foo bar
\antykwatorunskabcap baz xyzzy
+\lmromanten Donde, está, la biblioteca. Me llamo T-Bone La araña discoteca.
\bye