[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: More robust variable TTF handling (a479b8f)
Marcel Fabian Krüger
tex at 2krueger.de
Tue Mar 1 22:00:56 CET 2022
Repository : https://github.com/latex3/luaotfload
On branch : dev
Link : https://github.com/latex3/luaotfload/commit/a479b8f4ce47baedeb48443158725cc515a5b0ac
>---------------------------------------------------------------
commit a479b8f4ce47baedeb48443158725cc515a5b0ac
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Tue Mar 1 22:00:19 2022 +0100
More robust variable TTF handling
>---------------------------------------------------------------
a479b8f4ce47baedeb48443158725cc515a5b0ac
src/luaotfload-harf-define.lua | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/luaotfload-harf-define.lua b/src/luaotfload-harf-define.lua
index e3921cb..c59a9ad 100644
--- a/src/luaotfload-harf-define.lua
+++ b/src/luaotfload-harf-define.lua
@@ -541,8 +541,11 @@ luatexbase.add_to_callback('glyph_stream_provider', function(fid, cid, kind, oci
elseif extents_hbfont then
glyph_stream_mapping[ocid] = cid
glyph_stream_mapping_inverse[cid] = ocid
+ local h_advance = extents_hbfont:get_glyph_h_advance(ocid)
+ local v_advance = extents_hbfont:get_glyph_v_advance(ocid)
+ assert(h_advance and v_advance)
local extents = extents_hbfont:get_glyph_extents(ocid)
- return extents.width, extents.x_bearing, extents.height, extents.y_bearing
+ return h_advance, extents and extents.x_bearing or 0, v_advance, 0 -- The last value should be get_glyph_v_origin(ocid).y - extents.y_bearing
else
return cb(fid, cid, kind, ocid)
end
More information about the latex3-commits
mailing list.