From 4921643624581f05c0f0bb17d7960b599872238c Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 8 May 2013 17:31:04 +0200 Subject: ignore glyph list workaround when running the db tool --- luaotfload-override.lua | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/luaotfload-override.lua b/luaotfload-override.lua index c047dad..f143009 100644 --- a/luaotfload-override.lua +++ b/luaotfload-override.lua @@ -101,32 +101,34 @@ logs.names_report = names_report --doc]]-- -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 - +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") + 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 - glyphlist = resolvers.findfile"font-age.lua" - names_report("both", 0, "load", "loading the extended glyph list from ConTeXt") + return nil end - local unicodes = dofile(glyphlist) - fonts.encodings.agl = { unicodes = unicodes } - return unicodes - else - return nil - end -end }) + end }) +end -- vim:tw=71:sw=4:ts=4:expandtab -- cgit v1.2.3