Skip to content

Commit 541cb8d

Browse files
committed
fix(shapers): Update pango shaper to work with current API
1 parent 13bd9d4 commit 541cb8d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

core/font.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,21 @@ local font = {
221221

222222
finish = function ()
223223
for key, font in pairs(SILE.fontCache) do
224-
if font.tempfilename ~= font.filename then
225-
SU.debug("fonts", "Removing temporary file of", key, ":", font.tempfilename)
226-
os.remove(font.tempfilename)
224+
-- Don't do anything for Pango fonts
225+
if type(font) ~= "userdata" and type(font.insert) ~= "function" then
226+
if font.tempfilename ~= font.filename then
227+
SU.debug("fonts", "Removing temporary file of", key, ":", font.tempfilename)
228+
os.remove(font.tempfilename)
229+
end
227230
end
228231
end
229232
end,
230233

231234
postLoadHook = function (face)
235+
-- Don't do anything for Pango fonts (here face could be a Pango Attribute Lists)
236+
if type(face) == "userdata" and type(face.insert) == "function" then
237+
return
238+
end
232239
local ot = require("core.opentype-parser")
233240
local font = ot.parseFont(face)
234241
if font.cpal then

0 commit comments

Comments
 (0)