diff options
Diffstat (limited to 'tex/context/base/mkiv/node-nut.lua')
-rw-r--r-- | tex/context/base/mkiv/node-nut.lua | 252 |
1 files changed, 0 insertions, 252 deletions
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 3282c3914..689a9d1e8 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -144,245 +144,6 @@ nodes.tonut = tonut -- helpers -if not direct.getdirection then - - local getdir = direct.getdir - local setdir = direct.setdir - - direct.getdirection = function(n) - local d = getdir(n) - if d == "TLT" then return 0 end - if d == "+TLT" then return 0, false end - if d == "-TLT" then return 0, true end - if d == "TRT" then return 1 end - if d == "+TRT" then return 1, false end - if d == "-TRT" then return 1, true end - if d == "LTL" then return 2 end - if d == "+LTL" then return 2, false end - if d == "-LTL" then return 2, true end - if d == "RTT" then return 3 end - if d == "+RTT" then return 3, false end - if d == "-RTT" then return 3, true end - end - - direct.setdirection = function(n,d,c) - if d == 0 then if c == true then setdir(n,"-TLT") elseif c == false then setdir(n,"+TLT") else setdir(n,"TLT") end - elseif d == 1 then if c == true then setdir(n,"-TRT") elseif c == false then setdir(n,"+TRT") else setdir(n,"TRT") end - elseif d == 2 then if c == true then setdir(n,"-LTL") elseif c == false then setdir(n,"+LTL") else setdir(n,"LTL") end - elseif d == 3 then if c == true then setdir(n,"-RTT") elseif c == false then setdir(n,"+RTT") else setdir(n,"RTT") end - else if c == true then setdir(n,"-TLT") elseif c == false then setdir(n,"+TLT") else setdir(n,"TLT") end end - end - -end - -if not direct.getexpansion then - - local getfield = direct.getfield - local setfield = direct.setfield - local getid = direct.getid - - local nodecodes = nodes.nodecodes - local whatsitcodes = nodes.whatsitcodes - - local glyph_code = nodecodes.glyph - local kern_code = nodecodes.kern - - function direct.getexpansion(n) - local id = getid(n) - if id == glyph_code or id == kern_code then - return getfield(n,"expansion_factor") - end - end - - function direct.setexpansion(n,e) - local id = getid(n) - if id == glyph_code or id == kern_code then - setfield(n,"expansion_factor",e) - end - end - -end - -if not direct.getdata then - - local getid = direct.getid - local getsubtype = direct.getsubtype - local getfield = direct.getfield - local setfield = direct.setfield - - local nodecodes = nodes.nodecodes - local whatsitcodes = nodes.whatsitcodes - - local glyph_code = nodecodes.glyph - local boundary_code = nodecodes.boundary - local whatsit_code = nodecodes.whatsit - - local user_defined_code = whatsitcodes.userdefined - local pdf_literal_code = whatsitcodes.pdfliteral - local pdf_setmatrix_code = whatsitcodes.pdfsetmatrix - local late_lua_code = whatsitcodes.latelua - local special_code = whatsitcodes.special - local write_code = whatsitcodes.write - - function direct.getdata(n) - local id = getid(n) - if id == glyph_code then - return getfield(n,"data") - elseif id == boundary_code then - return getfield(n,"value") - elseif id == whatsit_code then - local subtype = getsubtype(n) - if subtype == user_defined_code then - return getfield(n,"value") - elseif subtype == pdf_literal_code then - return getfield(n,"data"), getfield(n,"mode") - elseif subtype == late_lua_code then - return getfield(n,"string") - elseif subtype == pdf_setmatrix_code then - return getfield(n,"data") - elseif subtype == special_code then - return getfield(n,"data") - elseif subtype == write_code then - return getfield(n,"data") - end - end - end - - function direct.setdata(n,v,vv) - local id = getid(n) - if id == glyph_code then - return setfield(n,"data",v) - elseif id == boundary_code then - return setfield(n,"value",v) - elseif id == whatsit_code then - local subtype = getsubtype(n) - if subtype == user_defined_code then - setfield(n,"value",v) - elseif subtype == pdf_literal_code then - setfield(n,"data",v) - if m then - setfield(n,"mode",vv) - end - elseif subtype == late_lua_code then - setfield(n,"string",v) - elseif subtype == pdf_setmatrix_code then - setfield(n,"data",v) - elseif subtype == special_code then - setfield(n,"data",v) - elseif subtype == write_code then - setfield(n,"data",v) - end - end - end - -end - -if not node.direct.traverse_glyph or not node.direct.traverse_list then - - logs.report("system","using fake node list traversers") - - local direct = node.direct - - local getnext = direct.getnext - local getid = direct.getid - local getsubtype = direct.getsubtype - local getchar = direct.getchar - local getfont = direct.getfont - local getlist = direct.getlist - - local function iterate(h,n) - if n then - n = getnext(n) - else - n = h - end - if n then - return n, getid(n), getsubtype(n) - end - end - - function direct.traverse(h) - return iterate, h - end - - function node.direct.traverse_id(id,h) - local function iterate(h,n) - if n then - n = getnext(n) - else - n = h - end - while n do - if getid(n) == id then - return n, getsubtype(n) - else - n = getnext(n) - end - end - end - return iterate, h - end - - local function iterate(h,n) - if n then - n = getnext(n) - else - n = h - end - while n do - if getid(n) == glyph_code then - return n, getfont(n), getchar(n) - else - n = getnext(n) - end - end - end - - function node.direct.traverse_glyph(h) - return iterate, h - end - - local function iterate(h,n) - if n then - n = getnext(n) - else - n = h - end - while n do - if getid(n) == glyph_code and subtype(n) < 256 then - return n, getfont(n), getchar(n) - else - n = getnext(n) - end - end - end - - function node.direct.traverse_char(h) - return iterate, h - end - - local function iterate(h,n) - if n then - n = getnext(n) - else - n = h - end - while n do - local id = getid(n) - if id == hlist_code or id == vlist_code then - return n, id, getsubtype(n), getlist(n) - else - n = getnext(n) - end - end - end - - function node.direct.traverse_list(h) - return iterate, h - end - -end - local nuts = nodes.nuts nuts.check_discretionaries = direct.check_discretionaries @@ -1024,16 +785,3 @@ function nuts.copy_properties(source,target,what) end return newprops -- for checking end - -if LUATEXFUNCTIONALITY < 6894 then - - local sal = nuts.setattrlist - local cal = nuts.current_attr - - function nuts.setattrlist(n,a) - return sal(n,a == true and cal() or a) - end - - nuts.setattributelist = nuts.setattrlist - -end |