[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Load variable fonts without explicit axis values (3aefc9b)
Marcel Fabian Krüger
tex at 2krueger.de
Sun Apr 25 13:09:11 CEST 2021
Repository : https://github.com/latex3/luaotfload
On branch : dev
Link : https://github.com/latex3/luaotfload/commit/3aefc9b06f28a8b233fd3af2117ade712eb4760c
>---------------------------------------------------------------
commit 3aefc9b06f28a8b233fd3af2117ade712eb4760c
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Sun Apr 25 13:07:43 2021 +0200
Load variable fonts without explicit axis values
>---------------------------------------------------------------
3aefc9b06f28a8b233fd3af2117ade712eb4760c
src/luaotfload-features.lua | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua
index f3d6136..f3ef81a 100644
--- a/src/luaotfload-features.lua
+++ b/src/luaotfload-features.lua
@@ -509,6 +509,17 @@ do
end
return factors
end
+
+ -- Additionally we patch trytosharefont to ensure that variable fonts work
+ -- with default values whenever no explicit values are passed.
+ local original_trytosharefont = fonts.constructors.trytosharefont
+ function fonts.constructors.trytosharefont(target, tfmdata)
+ original_trytosharefont(target, tfmdata)
+ if not target.streamprovider and tfmdata.resources.variabledata then
+ local format = tfmdata.properties.format
+ target.streamprovider = format == 'opentype' and 1 or format == 'truetype' and 2 or 0
+ end
+ end
end
-- MK: Added
More information about the latex3-commits
mailing list.