diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
commit | 57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch) | |
tree | 1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/font-mis.lua | |
parent | 6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff) |
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/font-mis.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/font-mis.lua | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/font-mis.lua b/Master/texmf-dist/tex/context/base/font-mis.lua index cc20b97119a..80a56332aca 100644 --- a/Master/texmf-dist/tex/context/base/font-mis.lua +++ b/Master/texmf-dist/tex/context/base/font-mis.lua @@ -6,12 +6,12 @@ if not modules then modules = { } end modules ['font-mis'] = { license = "see context related readme files" } -local next, pairs, ipairs = next, pairs, ipairs +local next = next local lower, strip = string.lower, string.strip fonts.otf = fonts.otf or { } -fonts.otf.version = fonts.otf.version or 2.628 +fonts.otf.version = fonts.otf.version or 2.650 fonts.otf.pack = true fonts.otf.cache = containers.define("fonts", "otf", fonts.otf.version, true) @@ -33,9 +33,11 @@ function fonts.otf.loadcached(filename,format,sub) end end +local featuregroups = { "gsub", "gpos" } + function fonts.get_features(name,t,script,language) local t = lower(t or (name and file.extname(name)) or "") - if t == "otf" or t == "ttf" or t == "ttc" then + if t == "otf" or t == "ttf" or t == "ttc" or t == "dfont" then local filename = resolvers.find_file(name,t) or "" if filename ~= "" then local data = fonts.otf.loadcached(filename) @@ -47,20 +49,28 @@ function fonts.get_features(name,t,script,language) local data = fontloader.to_table(ff) fontloader.close(ff) local features = { } - for k, what in pairs { "gsub", "gpos" } do + for k=1,#featuregroups do + local what = featuregroups[k] local dw = data[what] if dw then local f = { } features[what] = f - for _, d in ipairs(dw) do - if d.features then - for _, df in ipairs(d.features) do + for i=1,#dw do + local d = dw[i] + local dfeatures = d.features + if dfeatures then + for i=1,#dfeatures do + local df = dfeatures[i] local tag = strip(lower(df.tag)) local ft = f[tag] if not ft then ft = {} f[tag] = ft end - for _, ds in ipairs(df.scripts) do + local dfscripts = df.scripts + for i=1,#dfscripts do + local ds = dfscripts[i] local scri = strip(lower(ds.script)) local fts = ft[scri] if not fts then fts = {} ft[scri] = fts end - for _, lang in ipairs(ds.langs) do + local dslangs = ds.langs + for i=1,#dslangs do + local lang = dslangs[i] lang = strip(lower(lang)) if scri == script then if lang == language then |