summaryrefslogtreecommitdiff
path: root/src/luaotfload-resolvers.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-04-28 22:49:58 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-04-28 22:50:06 +0200
commitc306db980b59c03875acebf8a948efe7b7d51b98 (patch)
treef4a521bc5e62ebb4b1657523e95e1151f46d50a9 /src/luaotfload-resolvers.lua
parent44973c92caed597ede12de0367947037523d3e65 (diff)
downloadluaotfload-c306db980b59c03875acebf8a948efe7b7d51b98.tar.gz
[resolvers,conf] allow “my:” lookups in anon sequences
This allows to domesticate packages that quite disrespectfully only use “anon:” lookups. Example from the test repo: \documentclass{scrartcl} \usepackage{fontspec} \directlua{ config.luaotfload = config.actions.apply (config.luaotfload, { run = { anon_sequence = { "my" } } }) } \directlua{ luatexbase.add_to_callback( "luaotfload.resolve_font", function (spec) spec.name = "comic.ttf" end, "user.openbsd_style") } \setmainfont{Adobe Premier Deluxe Overpriced} \begin{document} There is no escape. \end{document}
Diffstat (limited to 'src/luaotfload-resolvers.lua')
-rw-r--r--src/luaotfload-resolvers.lua19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/luaotfload-resolvers.lua b/src/luaotfload-resolvers.lua
index 6fc6ffe..a1e702b 100644
--- a/src/luaotfload-resolvers.lua
+++ b/src/luaotfload-resolvers.lua
@@ -196,11 +196,20 @@ local resolve_path_if_exists = function (specification)
return false
end
+--[[doc--
+ Custom file resolvers via callback.
+--doc]]--
+
+local resolve_my = function (specification)
+ luatexbase.call_callback ("luaotfload.resolve_font", specification)
+end
+
local resolve_methods = {
tex = resolve_tex_format,
path = resolve_path_if_exists,
name = resolve_name,
file = resolve_file,
+ my = resolve_my,
}
local resolve_sequence = function (seq, specification)
@@ -273,16 +282,6 @@ resolve_kpse = function (specification)
return false
end
---[[doc--
-
- Also {\bfseries EXPERIMENTAL}: custom file resolvers via callback.
-
---doc]]--
-
-local resolve_my = function (specification)
- luatexbase.call_callback ("luaotfload.resolve_font", specification)
-end
-
return {
init = function ( )
if luatexbase and luatexbase.create_callback then