diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua index 8c41a561176..da63d7b64e9 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua @@ -33,8 +33,6 @@ local v_auto = variables.auto local nuts = nodes.nuts -local tonut = nodes.tonut -local tonode = nodes.tonode local getid = nuts.getid local getsubtype = nuts.getsubtype local getattr = nuts.getattr @@ -53,7 +51,9 @@ local setwidth = nuts.setwidth local hpack = nuts.hpack local insert_after = nuts.insert_after local takebox = nuts.takebox -local traverse_id = nuts.traverse_id + +local nexthlist = nuts.traversers.hlist +local nextvlist = nuts.traversers.vlist local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph @@ -63,14 +63,11 @@ local glue_code = nodecodes.glue local penalty_code = nodecodes.penalty local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist -local whatsit_code = nodecodes.whatsit local localpar_code = nodecodes.localpar - -local whatsitcodes = nodes.whatsitcodes ------ late_luacode = whatsitcodes.latelua +local dir_code = nodecodes.dir local kerncodes = nodes.kerncodes -local font_code = kerncodes.font +local fontkern_code = kerncodes.font local nodepool = nuts.pool local new_kern = nodepool.kern @@ -194,7 +191,6 @@ do end function rubies.check(head) - local head = tonut(head) local current = head local start = nil local stop = nil @@ -208,7 +204,7 @@ function rubies.check(head) setprev(start) setnext(stop) local h = hpack(start) - if prev == head then + if start == head then head = h else setlink(prev,h) @@ -247,20 +243,21 @@ function rubies.check(head) start = current stop = current end - elseif id == kern_code and getsubtype(current,font_code) then + -- go on + elseif id == kern_code and getsubtype(current,fontkern_code) then -- go on elseif found and id == disc_code then -- go on (todo: look into disc) elseif found then - flush("flush 4") + flush("flush 3") found = nil end current = nx end if found then - flush("flush 5") + flush("flush 4") end - return tonode(head), true + return head, true -- no need for true end local attach @@ -309,11 +306,11 @@ local function whatever(current) local c = getprev(current) while c do local id = getid(c) - if id == glue_code or id == penalty_code or id == kern_code or (id == whatsit_code and getsubtype(current,localpar_code)) then + if id == glue_code or id == penalty_code or id == kern_code then -- go on elseif id == hlist_code and getwidth(c) == 0 then -- go on - elseif id == whatsit_code or id == localpar_code then + elseif id == whatsit_code or id == localpar_code or id == dir_code then -- go on else l = false @@ -371,20 +368,17 @@ local function whatever(current) end end -attach = function(head) - for current in traverse_id(hlist_code,head) do +attach = function(head) -- traverse_list + for current in nexthlist, head do whatever(current) end - for current in traverse_id(vlist_code,head) do + for current in nextvlist, head do whatever(current) end - return head, true + return head end -function rubies.attach(head) - local h, d = attach(tonut(head)) - return tonode(h), d -end +rubies.attach = attach -- for now there is no need to be compact |