diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-07-07 22:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-07-07 22:15:04 +0200 |
commit | dc7195d9c40c947f61bd001635de6e8b2cb99167 (patch) | |
tree | ee8b6a7478c141429ad106b7d4283f89e8f00178 /tex/context/base/font-otc.lua | |
parent | 865735f6a380cd9a5b5eb1b64d4c82b78e7c0ed1 (diff) | |
download | context-dc7195d9c40c947f61bd001635de6e8b2cb99167.tar.gz |
2015-07-07 21:45:00
Diffstat (limited to 'tex/context/base/font-otc.lua')
-rw-r--r-- | tex/context/base/font-otc.lua | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tex/context/base/font-otc.lua b/tex/context/base/font-otc.lua index a3afcd9e1..db8587741 100644 --- a/tex/context/base/font-otc.lua +++ b/tex/context/base/font-otc.lua @@ -6,9 +6,10 @@ if not modules then modules = { } end modules ['font-otc'] = { license = "see context related readme files" } -local format, insert = string.format, table.insert +local format, insert, sortedkeys = string.format, table.insert, table.sortedkeys local type, next = type, next local lpegmatch = lpeg.match +local utfbyte = utf.byte -- we assume that the other otf stuff is loaded already @@ -28,8 +29,10 @@ local setmetatableindex = table.setmetatableindex local types = { substitution = "gsub_single", + single = "gsub_single", ligature = "gsub_ligature", alternate = "gsub_alternate", + multiple = "gsub_multiple", } setmetatableindex(types, function(t,k) t[k] = k return k end) -- "key" @@ -46,7 +49,7 @@ local function addfeature(data,feature,specifications) -- already present else local sequences = resources.sequences - local fontfeatures = resources.features + local fontfeatures = resources.features or everywhere local unicodes = resources.unicodes local lookuptypes = resources.lookuptypes local splitter = lpeg.splitter(" ",unicodes) @@ -182,7 +185,13 @@ otf.enhancers.addfeature = addfeature local extrafeatures = { } function otf.addfeature(name,specification) - extrafeatures[name] = specification + if type(name) == "table" then + specification = name + name = specification.name + end + if type(name) == "string" then + extrafeatures[name] = specification + end end local function enhance(data,filename,raw) @@ -211,6 +220,7 @@ local tlig_specification = { type = "ligature", features = everywhere, data = tlig, + name = "ctx_tlig", order = { "tlig" }, flags = noflags, prepend = true, @@ -235,6 +245,7 @@ local trep_specification = { type = "substitution", features = everywhere, data = trep, + name = "ctx_trep", order = { "trep" }, flags = noflags, prepend = true, |