From 1bce7c38af9f58e3541fc2593c1de3deda99d340 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 25 Jun 2010 11:23:06 +0300 Subject: 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. --- otfl-font-nms.lua | 27 +++++++-------------------- 1 file 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 -- cgit v1.2.3