local to_direct = (Dnode ~= node) and Dnode.todirect or nullfunc
local node_new = Dnode.new
-local node_remove = Dnode.remove
+local node_remove = luatexja.Dnode_remove -- Dnode.remove
local node_next = Dnode.getnext
local node_free = Dnode.free
local has_attr = Dnode.has_attribute
local unset_attr = Dnode.unset_attribute
local node_insert_after = Dnode.insert_after
local node_write = Dnode.write
+local node_traverse_id = Dnode.traverse_id
local identifiers = fonts.hashes.identifiers
local function do_ivs_repr(head)
head = to_direct(head)
- local p = head
+ local p, r = head
while p do
local pid = getid(p)
if pid==id_glyph then
if qc>=0xE0100 then qc = qc - 0xE0100 end
local pt = font_ivs_table[pf]
pt = pt and pt[getchar(p)]; pt = pt and pt[qc]
- head = node_remove(head,q)
+ head, r = node_remove(head,q)
+ node_free(q)
if pt then
local np = ivs_jglyph(pt, p, pf,
(has_attr(p,attr_curjfnt) or 0)==pf and OTF or VSR)
head = node_insert_after(head, p, np)
head = node_remove(head,p)
- p = np
+ node_free(p)
end
+ p = r
+ else
+ p = q
end
+ else
+ p = node_next(p)
end
+ else
+ p = node_next(p)
end
- p = node_next(p)
end
return to_node(head)
end