diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-17 10:31:56 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-17 10:31:56 +0100 |
commit | b14f992ef5f4e868c9959b174278c86516d60dbc (patch) | |
tree | 28587bb46c025ea7b0d27ba93f09c93dcf53c73a /tex/context/base/mkiv/font-otl.lua | |
parent | 95a1799032dc61dbca4a11e495be34b4397c8fec (diff) | |
download | context-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz |
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/font-otl.lua')
-rw-r--r-- | tex/context/base/mkiv/font-otl.lua | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua index d4eaed763..4b97a90a2 100644 --- a/tex/context/base/mkiv/font-otl.lua +++ b/tex/context/base/mkiv/font-otl.lua @@ -23,7 +23,7 @@ if not modules then modules = { } end modules ['font-otl'] = { -- todo: less tounicodes -local gmatch, find, match, lower, strip = string.gmatch, string.find, string.match, string.lower, string.strip +local lower = string.lower local type, next, tonumber, tostring, unpack = type, next, tonumber, tostring, unpack local abs = math.abs local derivetable = table.derive @@ -127,26 +127,26 @@ function otf.load(filename,sub,featurefile) -- second argument (format) is gone hash = hash .. "-" .. sub end hash = containers.cleanname(hash) - local featurefiles - if featurefile then - featurefiles = { } - for s in gmatch(featurefile,"[^,]+") do - local name = resolvers.findfile(file.addsuffix(s,'fea'),'fea') or "" - if name == "" then - report_otf("loading error, no featurefile %a",s) - else - local attr = lfs.attributes(name) - featurefiles[#featurefiles+1] = { - name = name, - size = attr and attr.size or 0, - time = attr and attr.modification or 0, - } - end - end - if #featurefiles == 0 then - featurefiles = nil - end - end + -- local featurefiles + -- if featurefile then + -- featurefiles = { } + -- for s in gmatch(featurefile,"[^,]+") do + -- local name = resolvers.findfile(file.addsuffix(s,'fea'),'fea') or "" + -- if name == "" then + -- report_otf("loading error, no featurefile %a",s) + -- else + -- local attr = lfs.attributes(name) + -- featurefiles[#featurefiles+1] = { + -- name = name, + -- size = attr and attr.size or 0, + -- time = attr and attr.modification or 0, + -- } + -- end + -- end + -- if #featurefiles == 0 then + -- featurefiles = nil + -- end + -- end local data = containers.read(otf.cache,hash) local reload = not data or data.size ~= size or data.time ~= time or data.tableversion ~= otfreaders.tableversion if forceload then @@ -252,6 +252,21 @@ function otf.load(filename,sub,featurefile) -- second argument (format) is gone end -- data.metadata.math = data.resources.mathconstants + -- + -- delayed tables (experiment) + -- + local classes = data.resources.classes + if not classes then + local descriptions = data.descriptions + classes = setmetatableindex(function(t,k) + local d = descriptions[k] + local v = (d and d.class or "base") or false + t[k] = v + return v + end) + data.resources.classes = classes + end + -- end return data |