summaryrefslogtreecommitdiff
path: root/otfl-font-dum.lua
diff options
context:
space:
mode:
Diffstat (limited to 'otfl-font-dum.lua')
-rw-r--r--otfl-font-dum.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua
index 81e7201..2bcc8ef 100644
--- a/otfl-font-dum.lua
+++ b/otfl-font-dum.lua
@@ -54,6 +54,12 @@ fonts.names.old_to_new = { }
local data, loaded = nil, false
+local synonyms = {
+ regular = {"normal", "roman", "plain", "book", "medium"},
+ italic = {"regularitalic", "normalitalic", "oblique", "slant"},
+ bolditalic = {"boldoblique", "boldslant"},
+}
+
local function sanitize(str)
return string.gsub(string.lower(str), "[^%a%d]", "")
end
@@ -92,6 +98,17 @@ function fonts.names.resolve(specification)
found = filename
break
end
+ else
+ if synonyms[style] then
+ for _,v in ipairs(synonyms[style]) do
+ if sanitize(subfamily) == v then
+ if not dsize or dsize == osize or dsize == ssize then
+ found = filename
+ break
+ end
+ end
+ end
+ end
end
end
end