Skip to content

Commit

Permalink
Fix parsing of short loca format
Browse files Browse the repository at this point in the history
  • Loading branch information
zauguin committed Aug 13, 2021
1 parent 4313039 commit f73ff91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/luaotfload-harf-var-ttf.lua
Expand Up @@ -100,7 +100,11 @@ local function read_loca(face)
local data = face:get_table(loca_tag):get_data()
local count = face:get_glyph_count() + 1
if #data == count * 2 then
return sio.readcardinaltable(data, 1, count, 2)
local result = sio.readcardinaltable(data, 1, count, 2)
for i=1, count do
result[i] = 2 * result[i]
end
return result
elseif #data == count * 4 then
return sio.readcardinaltable(data, 1, count, 4)
else
Expand Down

0 comments on commit f73ff91

Please sign in to comment.