diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-11 00:41:24 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-11 00:41:24 +0200 |
commit | cb364747722b9ce55d3301af24d5740fd511cf79 (patch) | |
tree | 7b6691a7dcd10e8b0021eb34494b14a315431096 /tex/context/base/mkiv/font-otc.lua | |
parent | e5703477ae326ba910515aeab93000828516954a (diff) | |
download | context-cb364747722b9ce55d3301af24d5740fd511cf79.tar.gz |
2016-05-10 23:48:00
Diffstat (limited to 'tex/context/base/mkiv/font-otc.lua')
-rw-r--r-- | tex/context/base/mkiv/font-otc.lua | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua index be9ba8660..a91dac5cf 100644 --- a/tex/context/base/mkiv/font-otc.lua +++ b/tex/context/base/mkiv/font-otc.lua @@ -52,6 +52,10 @@ local noflags = { false, false, false, false } -- beware: shared, maybe we should copy the sequence local function addfeature(data,feature,specifications) + + -- todo: add some validator / check code so that we're more tolerant to + -- user errors + local descriptions = data.descriptions local resources = data.resources local features = resources.features @@ -254,26 +258,30 @@ local function addfeature(data,feature,specifications) local function prepare_pair(list,featuretype) local coverage = { } local cover = coveractions[featuretype] - for code, replacement in next, list do - local unicode = tounicode(code) - local description = descriptions[unicode] - if description and type(replacement) == "table" then - local r = { } - for k, v in next, replacement do - local u = tounicode(k) - if u then - r[u] = v + if cover then + for code, replacement in next, list do + local unicode = tounicode(code) + local description = descriptions[unicode] + if description and type(replacement) == "table" then + local r = { } + for k, v in next, replacement do + local u = tounicode(k) + if u then + r[u] = v + end + end + if next(r) then + cover(coverage,unicode,r) + done = done + 1 + else + skip = skip + 1 end - end - if next(r) then - cover(coverage,unicode,r) - done = done + 1 else skip = skip + 1 end - else - skip = skip + 1 end + else + report_otf("unknown cover type %a",featuretype) end return coverage end @@ -447,7 +455,7 @@ local function addfeature(data,feature,specifications) coverage = prepare_multiple(list,featuretype) elseif featuretype == "kern" then category = "gpos" - format = kern + format = "kern" coverage = prepare_kern(list,featuretype) elseif featuretype == "pair" then category = "gpos" |