summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-09-19 23:53:01 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-09-20 00:01:46 +0200
commit88d84645f2847c1cf383a5431134cedc22191458 (patch)
tree6777317ef3d59463376b6a8a8fc706108df85f03
parent022c520a281d229e30cf737461c845596bfac9fb (diff)
downloadluaotfload-88d84645f2847c1cf383a5431134cedc22191458.tar.gz
[db] install required functions from font-syn
The loader makes some assumptions about available lookup functions early on. Since fonts-syn.lua only installed dummies for most of these, we might as well do that too.
-rw-r--r--src/luaotfload-database.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 3688c3a..41080cf 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -3506,6 +3506,49 @@ local show_cache = function ( )
end
-----------------------------------------------------------------------
+--- API assumptions of the fontloader
+-----------------------------------------------------------------------
+--- PHG: we need to investigate these, maybe they’re useful as early
+--- hooks
+
+local ignoredfile = function () return false end
+
+local reportmissingbase = function ()
+ logreport ("info", 0, "db", --> bug‽
+ "Font name database not found but expected by fontloader.")
+ fonts.names.reportmissingbase = nil
+end
+
+local reportmissingname = function ()
+ logreport ("info", 0, "db", --> bug‽
+ "Fontloader attempted to lookup name before Luaotfload \z
+ was initialized.")
+ fonts.names.reportmissingname = nil
+end
+
+local getfilename = function (a1, a2)
+ logreport ("info", 6, "db", --> bug‽
+ "Fontloader looked up font file (%s, %s) before Luaotfload \z
+ was initialized.", tostring(a1), tostring(a2))
+ return lookup_fullpath (a1, a2)
+end
+
+local resolve = function (name, subfont)
+ logreport ("info", 6, "db", --> bug‽
+ "Fontloader attempted to resolve name (%s, %s) before \z
+ Luaotfload was initialized.", tostring(name), tostring(subfont))
+ return lookup_font_name { name = name, sub = subfont }
+end
+
+local api = {
+ ignoredfile = ignoredfile,
+ reportmissingbase = reportmissingbase,
+ reportmissingname = reportmissingname,
+ getfilename = getfilename,
+ resolve = resolve,
+}
+
+-----------------------------------------------------------------------
--- export functionality to the namespace “fonts.names”
-----------------------------------------------------------------------
@@ -3557,6 +3600,7 @@ return {
names.lookups = nil --- contains the lookup cache
for sym, ref in next, export do names[sym] = ref end
+ for sym, ref in next, api do names[sym] = names[sym] or ref end
return true
end
}