[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: harf-define: look up absolute file path in find_*_file callbacks (a3431c8)
Jonas Witschel
diabonas at archlinux.org
Thu Apr 9 16:33:03 CEST 2020
Repository : https://github.com/latex3/luaotfload
On branch : dev
Link : https://github.com/latex3/luaotfload/commit/a3431c842809ffd3525306e87a5a7b438612e549
>---------------------------------------------------------------
commit a3431c842809ffd3525306e87a5a7b438612e549
Author: Jonas Witschel <diabonas at archlinux.org>
Date: Thu Apr 9 01:07:20 2020 +0200
harf-define: look up absolute file path in find_*_file callbacks
LuaTeX expects a complete path in return from these callbacks, so try to
resolve file names using Kpathsea. If that does not work, it might have
already been resolved somewhere else, e.g. in scalefont(), so pass
the argument through without modification (other then removing the
'harfloaded:' prefix).
Fixes: GH-142
>---------------------------------------------------------------
a3431c842809ffd3525306e87a5a7b438612e549
src/luaotfload-harf-define.lua | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/luaotfload-harf-define.lua b/src/luaotfload-harf-define.lua
index 8754358..5f9effe 100644
--- a/src/luaotfload-harf-define.lua
+++ b/src/luaotfload-harf-define.lua
@@ -366,9 +366,19 @@ fonts.readers.harf = function(spec)
end
luatexbase.add_to_callback('find_opentype_file', function(name)
- return name:gsub('^harfloaded:', '')
+ local path = luaotfload.fontloader.resolvers.findfile(name)
+ if path then
+ return path
+ else
+ return name:gsub('^harfloaded:', '')
+ end
end, 'luaotfload.harf.strip_prefix')
luatexbase.add_to_callback('find_truetype_file', function(name)
- return name:gsub('^harfloaded:', '')
+ local path = luaotfload.fontloader.resolvers.findfile(name)
+ if path then
+ return path
+ else
+ return name:gsub('^harfloaded:', '')
+ end
end, 'luaotfload.harf.strip_prefix')
More information about the latex3-commits
mailing list.