summaryrefslogtreecommitdiff
path: root/src/luaotfload-loaders.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-05-12 22:57:50 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-05-12 23:42:03 +0200
commit19bc52023e3c345855c41ba36911143ed094bf1a (patch)
tree86df6ef61a532542975180afba90e27281360d53 /src/luaotfload-loaders.lua
parentd20186dc4653791d1ebb8eb4be9c05716879686f (diff)
downloadluaotfload-19bc52023e3c345855c41ba36911143ed094bf1a.tar.gz
[features,loaders] tidy up loading of afm
Diffstat (limited to 'src/luaotfload-loaders.lua')
-rw-r--r--src/luaotfload-loaders.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua
index f6cb272..0a0185b 100644
--- a/src/luaotfload-loaders.lua
+++ b/src/luaotfload-loaders.lua
@@ -49,12 +49,19 @@ local unsupported_reader = function (format)
end
end
-local afm_compat_message = function (specification, method)
+local afm_reader = fonts.readers.afm
+
+local afm_compat_message = function (specification)
+ local name = specification.name
+ local filename = specification.filename
logreport ("both", 4, "loaders",
"PFB format only supported with matching \z
- AFM; redirecting (“%s”, “%s”).",
- tostring (specification.name), tostring (method))
- return fonts.readers.afm (specification, method)
+ 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 install_formats = function ()
@@ -89,6 +96,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 ("pfb", afm_compat_message) --- pfb loader is incomplete
and aux ("ofm", readers.tfm)
and aux ("dfont", unsupported_reader "dfont")