diff options
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r-- | otfl-font-nms.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua index a7edd4c..6e8b8be 100644 --- a/otfl-font-nms.lua +++ b/otfl-font-nms.lua @@ -332,8 +332,8 @@ local function load_font(filename, fontnames, newfontnames, texmf) local status = fontnames.status local basefile = texmf and basename(filename) or filename if filename then - if table.contains(names.blacklist, filename) or - table.contains(names.blacklist, basename(filename)) then + if names.blacklist[filename] or + names.blacklist[basename(filename)] then if trace_search then logs.report("ignoring font", "%s", filename) end @@ -442,6 +442,7 @@ local function read_blacklist() kpse.lookup("otfl-blacklist.cnf", {all=true, format="tex"}) } local blacklist = names.blacklist + local whitelist = { } if files and type(files) == "table" then for _,v in next, files do @@ -452,14 +453,21 @@ local function read_blacklist() else line = line:split("%")[1] line = line:strip() - if trace_search then - logs.report("blacklisted file", "%s", line) + if string.sub(line,1,1) == "-" then + whitelist[string.sub(line,2,-1)] = true + else + if trace_search then + logs.report("blacklisted file", "%s", line) + end + blacklist[line] = true end - blacklist[#blacklist+1] = line end end end end + for fontname,_ in pairs(whitelist) do + blacklist[fontname] = nil + end end local font_extensions = { "otf", "ttf", "ttc", "dfont" } |