summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2011-09-29 13:39:58 -0700
committerKhaled Hosny <khaledhosny@eglug.org>2011-09-29 13:39:58 -0700
commit711c6fc949dfbc4b40d76168ae82d5d49c25a7b8 (patch)
tree8579160e1629efb9e6069480b5508ae57bce6eca
parent25c1a595cd25fe657c3dce394024fedc800797b8 (diff)
parent9580e67ebe04130a43dd1b1874e9c696c47624a9 (diff)
downloadluaotfload-711c6fc949dfbc4b40d76168ae82d5d49c25a7b8.tar.gz
Merge pull request #39 from pgundlach/whitelist
Whitelist fonts
-rw-r--r--otfl-font-nms.lua18
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" }