summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-06-04 22:15:12 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-06-04 22:15:12 +0200
commit467bddf27f4c158e04cfefa3d68d64b58a290a72 (patch)
tree9c072c02ad478cfb511d41910df3c5326a02a815 /src/luaotfload-database.lua
parent84619758adf39e49553662b4a5af806c1527001e (diff)
downloadluaotfload-467bddf27f4c158e04cfefa3d68d64b58a290a72.tar.gz
aux: add helpers for accessing the index table/index file
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r--src/luaotfload-database.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index f216f79..e171c52 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -452,6 +452,7 @@ local load_lua_file = function (path)
end
--- define locals in scope
+local access_font_index
local collect_families
local crude_file_lookup
local crude_file_lookup_verbose
@@ -532,6 +533,18 @@ load_names = function (dry_run)
return data
end
+--[[doc--
+
+ access_font_index -- Provide a reference of the index table. Will
+ cause the index to be loaded if not present.
+
+--doc]]--
+
+access_font_index = function ()
+ if not name_index then name_index = load_names () end
+ return name_index
+end
+
getmetadata = function ()
if not name_index then name_index = load_names() end
return tablefastcopy (name_index.meta)
@@ -3457,6 +3470,7 @@ names.set_font_filter = set_font_filter
names.flush_lookup_cache = flush_lookup_cache
names.save_lookups = save_lookups
names.load = load_names
+names.access_font_index = access_font_index
names.data = function () return name_index end
names.save = save_names
names.update = update_names