diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-04-04 14:11:01 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-04-04 14:11:01 +0200 |
commit | 64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524 (patch) | |
tree | 1b36a0b35f5b6d516d27fe817a27249d4c6d9c78 /tex/context/base/mkiv/font-syn.lua | |
parent | 70a938c4934f042face9805fc4c392c0676b11d5 (diff) | |
download | context-64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524.tar.gz |
2019-04-04 13:38:00
Diffstat (limited to 'tex/context/base/mkiv/font-syn.lua')
-rw-r--r-- | tex/context/base/mkiv/font-syn.lua | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua index 3951e8742..18c25fbfd 100644 --- a/tex/context/base/mkiv/font-syn.lua +++ b/tex/context/base/mkiv/font-syn.lua @@ -515,15 +515,20 @@ local function cleanname(name) end local function cleanfilename(fullname,defaultsuffix) - local path, name, suffix = splitname(fullname) - name = gsub(lower(name),"[^%a%d]","") - if suffix and suffix ~= "" then - return name .. ".".. suffix - elseif defaultsuffix and defaultsuffix ~= "" then - return name .. ".".. defaultsuffix - else - return name + if fullname then + local path, name, suffix = splitname(fullname) + if name then + name = gsub(lower(name),"[^%a%d]","") + if suffix and suffix ~= "" then + return name .. ".".. suffix + elseif defaultsuffix and defaultsuffix ~= "" then + return name .. ".".. defaultsuffix + else + return name + end + end end + return "badfontname" end local sorter = function(a,b) @@ -2009,7 +2014,8 @@ local lastlookups, lastpattern = { }, "" local function look_them_up(lookups,specification) for key, value in sortedhash(specification) do - local t, n = { }, 0 + local t = { } + local n = 0 if find(value,"*",1,true) then value = topattern(value) for i=1,#lookups do |