[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Smaller changes (36486ac)
Marcel Fabian Krüger
tex at 2krueger.de
Thu Apr 9 17:12:59 CEST 2020
Repository : https://github.com/latex3/luaotfload
On branch : dev
Link : https://github.com/latex3/luaotfload/commit/36486ac11a6b7e1841edf15fa40bf4af49eb5f26
>---------------------------------------------------------------
commit 36486ac11a6b7e1841edf15fa40bf4af49eb5f26
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Thu Apr 9 17:12:59 2020 +0200
Smaller changes
Mostly using kpse.find_file directly instead of the ConTeXt wrapper
ensures that lookup works correctly for OTF font collections and other
edge cases. The fallback testing change ensures that testing coverage
isn't affected if additional features get added there at some point.
>---------------------------------------------------------------
36486ac11a6b7e1841edf15fa40bf4af49eb5f26
src/luaotfload-harf-define.lua | 17 +++++------------
testfiles-harf/fallback.lvt | 2 +-
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/luaotfload-harf-define.lua b/src/luaotfload-harf-define.lua
index 5f9effe..00a9f1f 100644
--- a/src/luaotfload-harf-define.lua
+++ b/src/luaotfload-harf-define.lua
@@ -365,20 +365,13 @@ fonts.readers.harf = function(spec)
return scalefont(loadfont(spec), spec)
end
+local find_file = kpse.find_file
luatexbase.add_to_callback('find_opentype_file', function(name)
- local path = luaotfload.fontloader.resolvers.findfile(name)
- if path then
- return path
- else
- return name:gsub('^harfloaded:', '')
- end
+ return find_file(name, 'opentype fonts')
+ or name:gsub('^harfloaded:', '')
end, 'luaotfload.harf.strip_prefix')
luatexbase.add_to_callback('find_truetype_file', function(name)
- local path = luaotfload.fontloader.resolvers.findfile(name)
- if path then
- return path
- else
- return name:gsub('^harfloaded:', '')
- end
+ return find_file(name, 'truetype fonts')
+ or name:gsub('^harfloaded:', '')
end, 'luaotfload.harf.strip_prefix')
diff --git a/testfiles-harf/fallback.lvt b/testfiles-harf/fallback.lvt
index 6e43294..56ff340 100644
--- a/testfiles-harf/fallback.lvt
+++ b/testfiles-harf/fallback.lvt
@@ -12,7 +12,7 @@
end, 'Harf glyph_info callback -- testing variant')
luatexbase.add_to_callback('glyph_not_found', function(id, char)
texio.write_nl(string.format('Missing character: There is no \csstring\%s (U+\csstring\%04X) in font \csstring\%s!',
- utf8.char(char), char, font.getfont(id).specification.specification:gsub(";fallback=.*",";fallback=...")))
+ utf8.char(char), char, font.getfont(id).specification.specification:gsub(";fallback=\csstring\%d*",";fallback=...")))
end, 'Harf glyph_not_found callback -- testing variant')
}
More information about the latex3-commits
mailing list.