From 6329e52d8aa7381a248e4a7dbf734d2ad083c50f Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Thu, 25 Feb 2010 00:38:44 +0200 Subject: Updating to latest ConTeXt beta (2010.02.24) Now encoding related code gone. --- otfl-font-otf.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'otfl-font-otf.lua') diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua index 94f5dcf..1465e13 100644 --- a/otfl-font-otf.lua +++ b/otfl-font-otf.lua @@ -1711,3 +1711,36 @@ function tfm.read_from_open_type(specification) --~ print(tfmtable.fullname) return tfmtable end + +-- helpers + +function otf.collect_lookups(otfdata,kind,script,language) + -- maybe store this in the font + local sequences = otfdata.luatex.sequences + if sequences then + local featuremap, featurelist = { }, { } + for s=1,#sequences do + local sequence = sequences[s] + local features = sequence.features + features = features and features[kind] + features = features and (features[script] or features[default] or features[wildcard]) + features = features and (features[language] or features[default] or features[wildcard]) + if features then + local subtables = sequence.subtables + if subtables then + for s=1,#subtables do + local ss = subtables[s] + if not featuremap[s] then + featuremap[ss] = true + featurelist[#featurelist+1] = ss + end + end + end + end + end + if #featurelist > 0 then + return featuremap, featurelist + end + end + return nil, nil +end -- cgit v1.2.3