diff options
Diffstat (limited to 'tex/context/base/mkiv/font-enc.lua')
-rw-r--r-- | tex/context/base/mkiv/font-enc.lua | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/tex/context/base/mkiv/font-enc.lua b/tex/context/base/mkiv/font-enc.lua index ba957bdf2..1470f3b8d 100644 --- a/tex/context/base/mkiv/font-enc.lua +++ b/tex/context/base/mkiv/font-enc.lua @@ -78,24 +78,32 @@ function encodings.load(filename) if foundname and foundname ~= "" then local ok, encoding, size = resolvers.loadbinfile(foundname) if ok and encoding then - encoding = gsub(encoding,"%%(.-)\n","") - local unicoding = fonts.encodings.agl.unicodes - local tag, vec = match(encoding,"/(%w+)%s*%[(.*)%]%s*def") - local i = 0 - for ch in gmatch(vec,"/([%a%d%.]+)") do - if ch ~= ".notdef" then - vector[i] = ch - if not hash[ch] then - hash[ch] = i - else - -- duplicate, play safe for tex ligs and take first - end - local u = unicoding[ch] or enccodes[ch] -- enccodes have also context names - if u then - unicodes[u] = i + encoding = gsub(encoding,"%%(.-)[\n\r]+","") + if encoding then + local unicoding = fonts.encodings.agl.unicodes + local tag, vec = match(encoding,"[/]*(%w+)%s*%[(.*)%]%s*def") + if vec then + local i = 0 + for ch in gmatch(vec,"/([%a%d%.]+)") do + if ch ~= ".notdef" then + vector[i] = ch + if not hash[ch] then + hash[ch] = i + else + -- duplicate, play safe for tex ligs and take first + end + local u = unicoding[ch] or enccodes[ch] -- enccodes have also context names + if u then + unicodes[u] = i + end + end + i = i + 1 end + else + report_encoding("reading vector in encoding file %a fails",filename) end - i = i + 1 + else + report_encoding("reading encoding file %a fails",filename) end end end |