fontlist: Skip fonts with missing family_name (#6820)

* Also don't trip on pipes
pull/6827/head
ezdiy 4 years ago committed by GitHub
parent 1db07d1889
commit 144fd78986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -117,15 +117,17 @@ local function collectFaceInfo(path)
return nil
end
local fres = face:getInfo()
local hbface = HB.hb_ft_face_create_referenced(face)
fres.names = hbface:getNames()
fres.scripts, fres.langs = hbface:getCoverage()
fres.path = path
fres.index = i
table.insert(res, fres)
hbface:destroy()
-- If family_name is missing, it's probably too broken to be useful
if face.family_name ~= nil then
local fres = face:getInfo()
local hbface = HB.hb_ft_face_create_referenced(face)
fres.names = hbface:getNames()
fres.scripts, fres.langs = hbface:getCoverage()
fres.path = path
fres.index = i
table.insert(res, fres)
hbface:destroy()
end
face:done()
end
return res

@ -594,7 +594,7 @@ function util.findFiles(dir, cb)
if f ~= "." and f ~= ".." then
scan(path)
end
else
elseif attr.mode == "file" or attr.mode == "link" then
cb(path, f, attr)
end
end

Loading…
Cancel
Save