summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-06-25 11:23:06 +0300
committerKhaled Hosny <khaledhosny@eglug.org>2010-06-25 11:23:06 +0300
commit1bce7c38af9f58e3541fc2593c1de3deda99d340 (patch)
tree6162aadd9c39a530d6de0e1e51bddf2bf0f01c99
parenteeba4e7b4c68ecef42bd7831d951371f6269f068 (diff)
downloadluaotfload-1bce7c38af9f58e3541fc2593c1de3deda99d340.tar.gz
Remove and old hack and a potential bug
I didn't know how to check if a table contains a certain value so I had this value=true hack, now I know better so removed it.
-rw-r--r--otfl-font-nms.lua27
1 files changed, 7 insertions, 20 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 53e66d2..a8ec08a 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -92,23 +92,9 @@ function names.load()
end
local synonyms = {
- regular = {
- normal = true,
- roman = true,
- plain = true,
- book = true,
- medium = true,
- },
- italic = {
- regularitalic = true,
- normalitalic = true,
- oblique = true,
- slant = true,
- },
- bolditalic = {
- boldoblique = true,
- boldslant = true,
- },
+ regular = { "normal", "roman", "plain", "book", "medium" },
+ italic = { "regularitalic", "normalitalic", "oblique", "slant" },
+ bolditalic = { "boldoblique", "boldslat" },
}
local loaded = false
@@ -164,7 +150,8 @@ function names.resolve(specification)
found[1] = face
break
end
- elseif synonyms[style] and synonyms[style][subfamily] then
+ elseif synonyms[style] and
+ table.contains(synonyms[style], subfamily) then
if optsize then
if dsnsize == size
or (size > minsize and size <= maxsize) then
@@ -177,8 +164,8 @@ function names.resolve(specification)
found[1] = face
break
end
- elseif subfamily == "regular"
- or synonyms.regular[style] then
+ elseif subfamily == "regular" or
+ table.contains(synonyms.regular, subfamily) then
found.fallback = face
end
else