From a6981c2f2d626da3879b370d40236b6d21ce2041 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 4 Apr 2010 15:54:54 +0200 Subject: Simplify a bit --- otfl-font-nms.lua | 16 +++++----------- 1 file 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 -- cgit v1.2.3