diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-05-09 13:27:37 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-05-09 13:27:37 -0700 |
commit | f0d437bc1bdf18f5eb7e296df7b3784cb04dabc2 (patch) | |
tree | ccd6c6247f4d4c6117b3e0800b8bfd769de798be /luaotfload-override.lua | |
parent | ae8ffd0615b797d91cd8799debf12e2891c5b0d2 (diff) | |
parent | 7647a39d3d704888b105dfb000970b7bd60d7682 (diff) | |
download | luaotfload-f0d437bc1bdf18f5eb7e296df7b3784cb04dabc2.tar.gz |
Merge pull request #53 from phi-gamma/master
pdf.js bug and font scaling
Diffstat (limited to 'luaotfload-override.lua')
-rw-r--r-- | luaotfload-override.lua | 48 |
1 files 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 |