summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-ots.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-04-16 00:08:11 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-04-16 00:08:11 +0200
commitd5d5a39dc16881d098a99b74cba9020d96be4e11 (patch)
tree3d32c01797d034acc0107f6abd9c2d66af0b5ba6 /tex/context/base/mkiv/font-ots.lua
parent25fcad7435f56cdce2658336909f4da6a65589c0 (diff)
downloadcontext-d5d5a39dc16881d098a99b74cba9020d96be4e11.tar.gz
2018-04-15 23:21:00
Diffstat (limited to 'tex/context/base/mkiv/font-ots.lua')
-rw-r--r--tex/context/base/mkiv/font-ots.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 25083dfce..ac50ad00e 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -623,7 +623,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
return head, base
end
-local function multiple_glyphs(head,start,multiple,skiphash,what) -- what to do with skiphash matches here
+local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what to do with skiphash matches here
local nofmultiples = #multiple
if nofmultiples > 0 then
resetinjection(start)
@@ -1270,6 +1270,14 @@ local function getmapping(dataset,sequence,currentlookup)
end
end
+function chainprocs.gsub_remove(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
+ if trace_chains then
+ logprocess("%s: removing character %s",cref(dataset,sequence,chainindex),gref(getchar(start)))
+ end
+ head, start = remove_node(head,start,true)
+ return head, getprev(start), true
+end
+
function chainprocs.gsub_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
local mapping = currentlookup.mapping
if mapping == nil then
@@ -1380,7 +1388,7 @@ function chainprocs.gsub_multiple(head,start,stop,dataset,sequence,currentlookup
if trace_multiples then
logprocess("%s: replacing %s by multiple characters %s",cref(dataset,sequence),gref(startchar),gref(replacement))
end
- return multiple_glyphs(head,start,replacement,skiphash,dataset[1])
+ return multiple_glyphs(head,start,replacement,skiphash,dataset[1],stop)
end
end
return head, start, false
@@ -1986,6 +1994,9 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
logprocess("%s: %s is not yet supported (2)",cref(dataset,sequence),chainkind)
end
end
+ else
+ -- we skip but we could also delete as option .. what does an empty lookup actually mean
+ -- in opentype ... anyway, we could map it onto gsub_remove if needed
end
i = i + 1
if i > size or not start then