mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
fontlist: Skip fonts with missing family_name (#6820)
* Also don't trip on pipes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user