diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2010-06-07 21:26:21 +0300 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-06-07 21:26:21 +0300 |
commit | b441547236be81c0e25974db3afc42caeb2ffe05 (patch) | |
tree | 744064e39ed6fdfb0087a6f87a632c2cb8633fae /otfl-font-nms.lua | |
parent | f5c6757b68b503b1b90c84804575935cd9319a43 (diff) | |
download | luaotfload-b441547236be81c0e25974db3afc42caeb2ffe05.tar.gz |
Provide a |fonts.names.scan()| function
It takes a dir path as input and index its fonts temporarily in the names
database, changes are not saved to the disk.
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r-- | otfl-font-nms.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index 3477051..73a45c9 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -733,6 +733,19 @@ local function save_names(fontnames) table.serialize(fontnames, true)) end -names.scan = scan_dir +local function scan_external_dir(dir) + local old_names, new_names + if loaded then + old_names = names.data + else + old_names = names.load() + loaded = true + end + new_names = table.copy(old_names) + scan_dir("zapfino", old_names, new_names) + names.data = new_names +end + +names.scan = scan_external_dir names.update = update_names names.save = save_names |