summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-07-10 00:15:04 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-07-10 00:15:04 +0200
commitd0cd2c4b5b931a812990db3ac953a3e288d0c215 (patch)
tree66f585bbfae40fdd2e748a308555d96e2fa54365 /tex/generic
parentd7b51cfffa3d797c9a19d6cf5366150bcf032554 (diff)
downloadcontext-d0cd2c4b5b931a812990db3ac953a3e288d0c215.tar.gz
2015-07-10 00:08:00
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua61
1 files changed, 56 insertions, 5 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 7ead58247..bf337eff7 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/09/15 15:23:36
+-- merge date : 07/10/15 00:05:49
do -- begin closure to overcome local limits and interference
@@ -9412,10 +9412,15 @@ otf.coverup={
alternate=justset,
multiple=justset,
ligature=justset,
+ kern=justset,
},
- register=function(coverage,descriptions,resources,feature,lookuptype,n)
+ register=function(coverage,lookuptype,format,feature,n,descriptions,resources)
local name=formatters["ctx_%s_%s"](feature,n)
- resources.lookuptypes[name]=lookuptype
+ if lookuptype=="kern" then
+ resources.lookuptypes[name]="position"
+ else
+ resources.lookuptypes[name]=lookuptype
+ end
for u,c in next,coverage do
local description=descriptions[u]
local slookups=description.slookups
@@ -9428,6 +9433,52 @@ otf.coverup={
return name
end
}
+local function getgsub(tfmdata,k,kind)
+ local description=tfmdata.descriptions[k]
+ if description then
+ local slookups=description.slookups
+ if slookups then
+ local shared=tfmdata.shared
+ local rawdata=shared and shared.rawdata
+ if rawdata then
+ local lookuptypes=rawdata.resources.lookuptypes
+ if lookuptypes then
+ local properties=tfmdata.properties
+ local validlookups,lookuplist=otf.collectlookups(rawdata,kind,properties.script,properties.language)
+ if validlookups then
+ for l=1,#lookuplist do
+ local lookup=lookuplist[l]
+ local found=slookups[lookup]
+ if found then
+ return found,lookuptypes[lookup]
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+otf.getgsub=getgsub
+function otf.getsubstitution(tfmdata,k,kind,value)
+ local found,kind=getgsub(tfmdata,k,kind)
+ if not found then
+ elseif kind=="substitution" then
+ return found
+ elseif kind=="alternate" then
+ local choice=tonumber(value) or 1
+ return found[choice] or found[1] or k
+ end
+ return k
+end
+otf.getalternate=otf.getsubstitution
+function otf.getmultiple(tfmdata,k,kind)
+ local found,kind=getgsub(tfmdata,k,kind)
+ if found and kind=="multiple" then
+ return found
+ end
+ return { k }
+end
end -- closure
@@ -9958,8 +10009,8 @@ local function featuresinitializer(tfmdata,value)
local collectlookups=otf.collectlookups
local rawdata=tfmdata.shared.rawdata
local properties=tfmdata.properties
- local script=properties.script
- local language=properties.language
+ local script=properties.script
+ local language=properties.language
local basesubstitutions=rawdata.resources.features.gsub
local basepositionings=rawdata.resources.features.gpos
if basesubstitutions or basepositionings then