summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
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