diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-04-13 15:51:39 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-04-13 15:51:39 +0200 |
commit | 25fcad7435f56cdce2658336909f4da6a65589c0 (patch) | |
tree | c23d5d04a7e86c7ddc2ebeca06d3de63ebdc806e /tex/context/base/mkiv/meta-imp-txt.mkiv | |
parent | 1e5d7f41ddede5e6400a2a7762032823d3545df4 (diff) | |
download | context-25fcad7435f56cdce2658336909f4da6a65589c0.tar.gz |
2018-04-13 15:02:00
Diffstat (limited to 'tex/context/base/mkiv/meta-imp-txt.mkiv')
-rw-r--r-- | tex/context/base/mkiv/meta-imp-txt.mkiv | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/tex/context/base/mkiv/meta-imp-txt.mkiv b/tex/context/base/mkiv/meta-imp-txt.mkiv index e9660b3a7..34e36ae54 100644 --- a/tex/context/base/mkiv/meta-imp-txt.mkiv +++ b/tex/context/base/mkiv/meta-imp-txt.mkiv @@ -203,6 +203,7 @@ \startluacode local nodecodes = nodes.nodecodes + local kerncodes = nodes.kerncodes local visible_code = { [nodecodes.glyph] = true, @@ -212,54 +213,39 @@ [nodecodes.rule] = true, } - local disc_code = nodecodes.disc - local kern_code = nodecodes.kern - - local c_userkern = nodes.kerncodes.userkern + local kern_code = nodecodes.kern + local c_userkern = kerncodes.userkern local a_fontkern = attributes.private("fontkern") local n = nil local s = 0 function mp.follow_reset() - r = nil + n = nil s = 0 end function mp.follow_initialize(b) - if not r then - local l = tex.takebox(b).list - n = { } - s = 0 - while l do - local c = l - l = l.next - local id = c.id - if visible_code[id] then - s = s + 1 - n[s] = c - c.prev = nil - c.next = nil - elseif id == kern_code then - if c.subtype == c_userkern and not c[a_fontkern] then + if not n then + local head = tex.takebox(b).list + if head then + n = { } + s = 0 + head = node.flatten_discretionaries(head) + local current = head + while current do + local id = current.id + if visible_code[id] then s = s + 1 - n[s] = c - c.prev = nil - else - n[s].next = c - c.prev = n[s] - end - c.next = nil - elseif id == disc_code then - local r = c.replace - while r do + head, current, n[s] = nodes.remove(head,current) + elseif id == kern_code and current.subtype == c_userkern and not current[a_fontkern] then s = s + 1 - n[s] = r - r = r.next - r.prev = nil - r.next = nil + head, current, n[s] = nodes.remove(head,current) + else + current = current.next end end + nodes.flush_list(head) end end end |