summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaotfload.dtx29
1 files changed, 28 insertions, 1 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx
index b4b7940..83885a0 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -1797,7 +1797,7 @@ loadmodule"colors.lua" --- “font-clr”
% \begin{macrocode}
local request_resolvers = fonts.definers.resolvers
-local formats = fonts.formats
+local formats = fonts.formats -- nice table; does lowercasing ...
formats.ofm = "type1"
% \end{macrocode}
@@ -1917,6 +1917,33 @@ request_resolvers.path = function (specification)
end
% \end{macrocode}
+% {\bfseries EXPERIMENTAL}
+% \identifier{kpse}-only resolver, for those who can do without system
+% fonts.
+%
+% \begin{macrocode}
+
+request_resolvers.kpse = function (specification)
+ local name = specification.name
+ local suffix = file.suffix(name)
+ if suffix and formats[suffix] then
+ name = file.removesuffix(name)
+ if resolvers.findfile(name, suffix) then
+ specification.forced = suffix
+ specification.name = name
+ return
+ end
+ end
+ for t, format in next, formats do --- brute force
+ if kpse.find_file (name, format) then
+ specification.forced = t
+ specification.name = name
+ return
+ end
+ end
+end
+
+% \end{macrocode}
% We create a callback for patching fonts on the fly, to be used by other
% packages.
% It initially contains the empty function that we are going to override