summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-04-04 15:54:54 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-04-04 16:03:13 +0200
commita6981c2f2d626da3879b370d40236b6d21ce2041 (patch)
tree56662f35c0f03d94dea17060800e0fcfd6e4458c
parent725d3ea39e6df5a7e274f320b6e52976d093e45e (diff)
downloadluaotfload-a6981c2f2d626da3879b370d40236b6d21ce2041.tar.gz
Simplify a bit
-rw-r--r--otfl-font-nms.lua16
1 files changed, 5 insertions, 11 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 589ca10..23207b8 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -208,9 +208,9 @@ local function progress(current, total)
end
end
-function fontloader.fullinfo(...)
+local function font_fullinfo(filename, subfont, texmf)
local t = { }
- local f = fontloader.open(...)
+ local f = fontloader.open(filename, subfont)
local m = f and fontloader.to_table(f)
fontloader.close(f)
collectgarbage('collect')
@@ -238,7 +238,7 @@ function fontloader.fullinfo(...)
t.fontname = m.fontname
t.fullname = m.fullname
t.familyname = m.familyname
- t.filename = m.origname
+ t.filename = texmf and basename(m.origname) or m.origname
t.weight = m.pfminfo.weight
t.width = m.pfminfo.width
t.slant = m.italicangle
@@ -279,18 +279,12 @@ local function load_font(filename, fontnames, status, newfontnames, newstatus, t
if info then
if type(info) == "table" and #info > 1 then
for i in ipairs(info) do
- local fullinfo = fontloader.fullinfo(filename, i-1)
- if texmf then
- fullinfo.filename = basename(filename)
- end
+ local fullinfo = font_fullinfo(filename, i-1, texmf)
mappings[#mappings+1] = fullinfo
table.insert(newstatus[filename].index, #mappings)
end
else
- local fullinfo = fontloader.fullinfo(filename)
- if texmf then
- fullinfo.filename = basename(filename)
- end
+ local fullinfo = font_fullinfo(filename, nil, texmf)
mappings[#mappings+1] = fullinfo
table.insert(newstatus[filename].index, #mappings)
end