summaryrefslogtreecommitdiff
path: root/luaotfload-auxiliary.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-05-12 14:44:23 -0700
committerPhilipp Gesang <phg42.2a@gmail.com>2013-05-12 14:44:23 -0700
commit0fb890f10cfec18d104e8660c4f07fe3dc2cae0e (patch)
tree40f0f672df9f70425c08e36e8f45aa46009b2846 /luaotfload-auxiliary.lua
parent4afed213016f10544c3fd2d3c7abcaee38341cb0 (diff)
parent390464dc65a3be849cf9588497fff25678cf38e3 (diff)
downloadluaotfload-0fb890f10cfec18d104e8660c4f07fe3dc2cae0e.tar.gz
Merge pull request #68 from phi-gamma/master
sync; fix ``mkmk``+``mark`` bug; migrate ``names.scan()``
Diffstat (limited to 'luaotfload-auxiliary.lua')
-rw-r--r--luaotfload-auxiliary.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua
index 999bc22..11af445 100644
--- a/luaotfload-auxiliary.lua
+++ b/luaotfload-auxiliary.lua
@@ -32,6 +32,7 @@ local stringformat = string.format
local stringgsub = string.gsub
local stringbyte = string.byte
local stringfind = string.find
+local tablecopy = table.copy
-----------------------------------------------------------------------
--- font patches
@@ -467,4 +468,31 @@ end
aux.sprint_math_dimension = sprint_math_dimension
+-----------------------------------------------------------------------
+--- extra database functions
+-----------------------------------------------------------------------
+
+--- migrated from luaotfload-database.lua
+--- https://github.com/lualatex/luaotfload/pull/61#issuecomment-17776975
+
+--- string -> (int, int)
+local scan_external_dir = function (dir)
+ local old_names, new_names = names.data
+ if not old_names then
+ old_names = load_names()
+ end
+ new_names = tablecopy(old_names)
+ local n_scanned, n_new = fonts.names.scan_dir(dir, old_names,
+ new_names)
+ --- FIXME
+ --- This doesn’t seem right. If a db update is triggered after this
+ --- point, then the added fonts will be saved along with it --
+ --- which is not as “temporarily” as it should be. (This should be
+ --- addressed during a refactoring of names_resolve().)
+ names.data = new_names
+ return n_scanned, n_new
+end
+
+aux.scan_external_dir = scan_external_dir
+
-- vim:tw=71:sw=2:ts=2:expandtab