diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-04-18 20:53:29 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-04-18 20:53:29 +0200 |
commit | a119b257eb5ad1a9ce9a9015d082f28fd2a3527e (patch) | |
tree | be6f43d38271684cd8f7e3ce855f69aef3db43ee /src/fontloader/misc/fontloader-font-gbn.lua | |
parent | c8734018b81eb2120372493a3767617eeaf0299c (diff) | |
parent | 0ed66c28f6f48c8250a903bed9abf6aee6d8dd39 (diff) | |
download | luaotfload-a119b257eb5ad1a9ce9a9015d082f28fd2a3527e.tar.gz |
Merge pull request #331 from phi-gamma/master
current progress on 2.7
Diffstat (limited to 'src/fontloader/misc/fontloader-font-gbn.lua')
-rw-r--r-- | src/fontloader/misc/fontloader-font-gbn.lua | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/fontloader/misc/fontloader-font-gbn.lua b/src/fontloader/misc/fontloader-font-gbn.lua index a645a97..daa072b 100644 --- a/src/fontloader/misc/fontloader-font-gbn.lua +++ b/src/fontloader/misc/fontloader-font-gbn.lua @@ -20,6 +20,7 @@ local nuts = nodes.nuts -- context abstraction of direct nodes local traverse_id = nuts.traverse_id local remove_node = nuts.remove +local free_node = nuts.free local glyph_code = nodes.nodecodes.glyph local disc_code = nodes.nodecodes.disc @@ -30,11 +31,13 @@ local tonut = nuts.tonut local getfont = nuts.getfont local getchar = nuts.getchar local getid = nuts.getid +local getboth = nuts.getboth local getprev = nuts.getprev local getnext = nuts.getnext local getdisc = nuts.getdisc local setchar = nuts.setchar local setlink = nuts.setlink +local setprev = nuts.setprev -- from now on we apply ligaturing and kerning here because it might interfere with complex -- opentype discretionary handling where the base ligature pass expect some weird extra @@ -136,7 +139,26 @@ function nodes.handlers.nodepass(head) end if redundant then for i=1,#redundant do - remove_node(nuthead,redundant[i],true) + local r = redundant[i] + local p, n = getboth(r) + if r == nuthead then + nuthead = n + setprev(n) + else + setlink(p,n) + end + if b > 0 then + for i=1,b do + local bi = basefonts[i] + if r == bi[1] then + bi[1] = n + end + if r == bi[2] then + bi[2] = n + end + end + end + free_node(r) end end for d in traverse_id(disc_code,nuthead) do |