summaryrefslogtreecommitdiff
path: root/otfl-font-dum.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-01-14 23:41:31 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-01-15 08:28:18 +0200
commitab822b50f8ee435e705ee0d510c5c7af8f99cb65 (patch)
treeea39ce479c62d4e178f3c710cb08f6bceb2e11aa /otfl-font-dum.lua
parenteffffb25946c8b36e2338d00938d0410a9d1c0f4 (diff)
downloadluaotfload-ab822b50f8ee435e705ee0d510c5c7af8f99cb65.tar.gz
Support reading the new database
Only regular style is resolved for now, still need to pass the proper style to the filename resolver function.
Diffstat (limited to 'otfl-font-dum.lua')
-rw-r--r--otfl-font-dum.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua
index 9235e01..e673331 100644
--- a/otfl-font-dum.lua
+++ b/otfl-font-dum.lua
@@ -54,7 +54,7 @@ fonts.names.old_to_new = { }
local data, loaded = nil, false
-function fonts.names.resolve(name,sub)
+function fonts.names.resolve(name,sub,style)
if not loaded then
local basename = fonts.names.basename
if basename and basename ~= "" then
@@ -70,9 +70,11 @@ function fonts.names.resolve(name,sub)
end
if type(data) == "table" and data.version == fonts.names.version then
local condensed = string.gsub(string.lower(name),"[^%a%d]","")
- local found = data.mappings and data.mappings[condensed]
+ local found = data.mappings and data.mappings.families and data.mappings.families[condensed]
if found then
- local fontname, filename, subfont = found[1], found[2], found[3]
+ local style = style or "regular"
+ found = found[style]
+ local fontname, filename, subfont = found, found[1], found[2]
if subfont then
return filename, fontname
else