From 88d84645f2847c1cf383a5431134cedc22191458 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 19 Sep 2016 23:53:01 +0200 Subject: [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. --- src/luaotfload-database.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') 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 @@ -3505,6 +3505,49 @@ local show_cache = function ( ) return true 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 } -- cgit v1.2.3