summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua63
1 files changed, 62 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
index 863187fbd7d..99a6611e256 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
@@ -30,14 +30,25 @@ We recreate the verbosity levels previously implemented in font-nms:
local loglevel = 1 --- default
local logout = "log"
+--- int -> bool
local set_loglevel = function (n)
if type(n) == "number" then
loglevel = n
end
+ return true
end
+logs.setloglevel = set_loglevel
logs.set_loglevel = set_loglevel
logs.set_log_level = set_loglevel --- accomodating lazy typists
+--- unit -> int
+local get_loglevel = function ( )
+ return loglevel
+end
+logs.getloglevel = get_loglevel
+logs.get_loglevel = get_loglevel
+logs.get_log_level = get_loglevel
+
local set_logout = function (s)
if s == "stdout" then
logout = "term"
@@ -63,7 +74,7 @@ end
local level_ids = { common = 0, loading = 1, search = 2 }
-logs.names_report = function (mode, lvl, ...)
+local names_report = function (mode, lvl, ...)
if type(lvl) == "string" then
lvl = level_ids[lvl]
end
@@ -81,4 +92,54 @@ logs.names_report = function (mode, lvl, ...)
end
end
+logs.names_report = names_report
+
+--[[doc--
+
+ Adobe Glyph List.
+ -------------------------------------------------------------------
+
+ Context provides a somewhat different font-age.lua from an unclear
+ origin. Unfortunately, the file name it reads from is hard-coded
+ in font-enc.lua, so we have to replace the entire table.
+
+ This shouldn’t cause any complications. Due to its implementation
+ the glyph list will be loaded upon loading a OTF or TTF for the
+ first time during a TeX run. (If one sticks to TFM/OFM then it is
+ never read at all.) For this reason we can install a metatable that
+ looks up the file of our choosing and only falls back to the
+ Context one in case it cannot be found.
+
+--doc]]--
+
+if fonts then --- need to be running TeX
+ if next(fonts.encodings.agl) then
+ print(next, fonts.encodings.agl)
+ --- unnecessary because the file shouldn’t be loaded at this time
+ --- but we’re just making sure
+ fonts.encodings.agl = nil
+ collectgarbage"collect"
+ end
+
+
+ fonts.encodings.agl = { }
+
+ setmetatable(fonts.encodings.agl, { __index = function (t, k)
+ if k == "unicodes" then
+ local glyphlist = resolvers.findfile"luaotfload-glyphlist.lua"
+ if glyphlist then
+ names_report("both", 0, "load", "loading the Adobe glyph list")
+ else
+ glyphlist = resolvers.findfile"font-age.lua"
+ names_report("both", 0, "load", "loading the extended glyph list from ConTeXt")
+ end
+ local unicodes = dofile(glyphlist)
+ fonts.encodings.agl = { unicodes = unicodes }
+ return unicodes
+ else
+ return nil
+ end
+ end })
+end
+
-- vim:tw=71:sw=4:ts=4:expandtab