diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-09-20 08:17:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-20 08:17:28 +0200 |
commit | 27384ea726edd394c31a3bd35503488f5494fe67 (patch) | |
tree | 1b63e4c6d9e91361d7555831c59f62e6001f1fda /src/luaotfload-database.lua | |
parent | 692704c12ac6f952080aad16df123400a0c82c0e (diff) | |
parent | 83b27d3d2faa30ef518f1b5e0a4a87a74107a93c (diff) | |
download | luaotfload-27384ea726edd394c31a3bd35503488f5494fe67.tar.gz |
Merge pull request #379 from phi-gamma/master
latest loader and changes for a pre-release
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r-- | src/luaotfload-database.lua | 44 |
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 } |