summaryrefslogtreecommitdiff
path: root/src/fontloader/misc
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-04-27 19:09:28 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-04-27 19:09:28 +0200
commit05c1a1f336a3148f9f8e3b02e3944deaebb0357f (patch)
tree048fad2a231348ce60a7d10072d0b7d735f50034 /src/fontloader/misc
parent48a7f10116bcdbcfbf427e761c48df33713ba5e5 (diff)
downloadluaotfload-05c1a1f336a3148f9f8e3b02e3944deaebb0357f.tar.gz
[fontloader] sync with Context as of 2016-04-27
Diffstat (limited to 'src/fontloader/misc')
-rw-r--r--src/fontloader/misc/fontloader-font-dsp.lua2
-rw-r--r--src/fontloader/misc/fontloader-font-ots.lua30
2 files changed, 20 insertions, 12 deletions
diff --git a/src/fontloader/misc/fontloader-font-dsp.lua b/src/fontloader/misc/fontloader-font-dsp.lua
index 14e816d..85a80bd 100644
--- a/src/fontloader/misc/fontloader-font-dsp.lua
+++ b/src/fontloader/misc/fontloader-font-dsp.lua
@@ -525,7 +525,7 @@ local function chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nof
end
end
local noflookups = readushort(f)
- local lookups = { }
+ local lookups = { }
for i=1,noflookups do
lookups[readushort(f)+1] = readushort(f) + 1
end
diff --git a/src/fontloader/misc/fontloader-font-ots.lua b/src/fontloader/misc/fontloader-font-ots.lua
index ac81989..90fcde2 100644
--- a/src/fontloader/misc/fontloader-font-ots.lua
+++ b/src/fontloader/misc/fontloader-font-ots.lua
@@ -2144,7 +2144,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
else
local discfound = nil
local n = f + 1
- last = getnext(last)
+ last = getnext(last) -- the second in current (first already matched)
while n <= l do
if not last and (sweeptype == "post" or sweeptype == "replace") then
last = getnext(sweepnode)
@@ -2185,7 +2185,6 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
end
break
end
- last = getnext(last)
elseif char == false then
if discfound then
notmatchreplace[discfound] = true
@@ -2238,6 +2237,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
end
match = not notmatchpre[last]
end
+ -- maybe only if match
last = getnext(last)
else
match = false
@@ -2273,8 +2273,12 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
if trace_skips then
show_skip(dataset,sequence,char,ck,class)
end
+ prev = getprev(prev) -- moved here
elseif seq[n][char] then
- n = n -1
+ if n > 1 then -- new test
+ prev = getprev(prev) -- moved here
+ end
+ n = n - 1
else
if discfound then
notmatchreplace[discfound] = true
@@ -2293,7 +2297,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
end
break
end
- prev = getprev(prev)
+ -- prev = getprev(prev) -- moved up
elseif char == false then
if discfound then
notmatchreplace[discfound] = true
@@ -2357,21 +2361,20 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
if not match then
break
end
- else
- -- skip 'm
end
- else
- -- skip 'm
end
+ -- maybe only if match
+ prev = getprev(prev)
elseif seq[n][32] then
n = n - 1
+ prev = getprev(prev)
else
match = false
break
end
- prev = getprev(prev)
elseif seq[n][32] then -- somewhat special, as zapfino can have many preceding spaces
n = n - 1
+ prev = getprev(prev) -- was absent
else
match = false
break
@@ -2409,7 +2412,11 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
if trace_skips then
show_skip(dataset,sequence,char,ck,class)
end
+ current = getnext(current) -- was absent
elseif seq[n][char] then
+ if n < s then -- new test
+ current = getnext(current) -- was absent
+ end
n = n + 1
else
if discfound then
@@ -2485,16 +2492,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode)
else
-- skip 'm
end
+ -- maybe only if match
+ current = getnext(current)
elseif seq[n][32] then -- brrr
n = n + 1
else
match = false
break
end
- current = getnext(current)
elseif seq[n][32] then
n = n + 1
-current = getnext(current)
+ current = getnext(current)
else
match = false
break