summaryrefslogtreecommitdiff
path: root/otfl-font-otf.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-02-25 00:38:44 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-02-25 00:41:34 +0200
commit6329e52d8aa7381a248e4a7dbf734d2ad083c50f (patch)
tree67c0f600cede869caf726c5d77a1d6371d6aa137 /otfl-font-otf.lua
parente064aa2dc70fb819cfdb6b3c0bdf1d081859584f (diff)
downloadluaotfload-6329e52d8aa7381a248e4a7dbf734d2ad083c50f.tar.gz
Updating to latest ConTeXt beta (2010.02.24)
Now encoding related code gone.
Diffstat (limited to 'otfl-font-otf.lua')
-rw-r--r--otfl-font-otf.lua33
1 files changed, 33 insertions, 0 deletions
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