From 934edcaba82997bd64bfe5dd3a08e07c59056ba1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 13 May 2016 00:03:29 +0200 Subject: [loaders] make AFM wrappers more consistent --- src/luaotfload-loaders.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua index 0a0185b..e5298b2 100644 --- a/src/luaotfload-loaders.lua +++ b/src/luaotfload-loaders.lua @@ -51,19 +51,23 @@ end local afm_reader = fonts.readers.afm -local afm_compat_message = function (specification) +local afm_loader = function (specification) local name = specification.name local filename = specification.filename - logreport ("both", 4, "loaders", - "PFB format only supported with matching \z - AFM; redirecting (“%s”, “afm”).", - tostring (specification.name)) specification.forced = "afm" specification.forcedname = filename specification.filename = file.replacesuffix (filename, "afm") return afm_reader (specification, "afm") end +local afm_compat_message = function (specification) + logreport ("both", 4, "loaders", + "PFB format only supported with matching \z + AFM; redirecting (“%s”, “afm”).", + tostring (specification.name)) + return afm_loader (specification) +end + local install_formats = function () local fonts = fonts if not fonts then return false end @@ -71,9 +75,8 @@ local install_formats = function () local readers = fonts.readers local sequence = readers.sequence local seqset = table.tohash (sequence) - local handlers = fonts.handlers local formats = fonts.formats - if not readers or not handlers or not formats then return false end + if not readers or not formats then return false end local aux = function (which, reader) if not which or type (which) ~= "string" @@ -83,7 +86,6 @@ local install_formats = function () end formats [which] = "type1" readers [which] = reader - handlers [which] = { } if not seqset [which] then logreport ("both", 3, "loaders", "Extending reader sequence for “%s”.", which) @@ -96,7 +98,7 @@ local install_formats = function () return aux ("evl", eval_reader) and aux ("lua", lua_reader) and aux ("pfa", unsupported_reader "pfa") - and aux ("afm", function (spec) return afm_reader (spec, "afm") end) + and aux ("afm", afm_loader) and aux ("pfb", afm_compat_message) --- pfb loader is incomplete and aux ("ofm", readers.tfm) and aux ("dfont", unsupported_reader "dfont") -- cgit v1.2.3