From 4afd5f6ad89594e3d8387b2acebefb6f37cb0cad Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 30 Jul 2017 22:18:52 +0200 Subject: 2017-07-30 19:35:00 --- tex/context/base/mkiv/node-nut.lua | 172 +++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 93 deletions(-) (limited to 'tex/context/base/mkiv/node-nut.lua') diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 87df5d5b2..54c3c7f9f 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -117,99 +117,85 @@ nodes.tonut = tonut -- getters -if not direct.getwhd then - local getfield = direct.getfield - function direct.getwhd(n) - return getfield(n,"width"), getfield(n,"height"), getfield(n,"depth") - end -end - -if not direct.setwhd then - local setfield = direct.setfield - function direct.setwhd(n,w,h,d) - setfield(n,"width",w or 0) - setfield(n,"height",h or 0) - setfield(n,"depth",d or 0) - end -end - -if not direct.getcomponents then - - local getfield = direct.getfield - local setfield = direct.setfield - local setsubtype = direct.setsubtype - - local attributelist_code = nodecodes.attributelist - - function direct.getcomponents(n) return getfield(n,"components") end - function direct.setcomponents(n,c) setfield(n,"components",c) end - function direct.getkern(n) return getfield(n,"kern") end - function direct.getwidth(n) return getfield(n,"width") end - function direct.setwidth(n,w) return setfield(n,"width",w) end - function direct.getheight(n) return getfield(n,"height") end - function direct.setheight(n,h) return setfield(n,"height",h) end - function direct.getdepth(n) return getfield(n,"depth") end - function direct.setdepth(n,d) return setfield(n,"depth",d) end - function direct.getshift(n) return getfield(n,"shift") end - function direct.setshift(n,s) return setfield(n,"shift",s) end - function direct.getpenalty(n) return getfield(n,"penalty") end - function direct.setpenalty(n,p) setfield(n,"penalty",p) end - function direct.getdir(n) return getfield(n,"dir") end - function direct.setdir(n,p) setfield(n,"dir",p) end - function direct.getlanguage(n) return getfield(n,"lang") end - function direct.setlanguage(n,l) return setfield(n,"lang",l) end - function direct.getattributelist(n) getfield(n,"attr") end - - function direct.getnucleus(n) return getfield(n,"nucleus") end - function direct.setnucleus(n,p) return setfield(n,"nucleus",p) end - function direct.getsup(n) return getfield(n,"sup") end - function direct.setsup(n,p) return setfield(n,"sup",p) end - function direct.getsub(n) return getfield(n,"sub") end - function direct.setsub(n,p) return setfield(n,"sub",p) end - - function direct.setattributelist(n,a) - if a and type(a) ~= attributelist_code then - a = getfield(a,"attr") - end - setfield(n,"attr",a) - end - - function direct.setkern(n,k,s) - setfield(n,"kern",k) - if s then - setsubtype(n,s) - end - end - - function direct.setfont(n,f,c) - setfield(n,"font",f) - if c then - setfield(n,"char",f) - end - end - - function direct.getoffsets(n) - return getfield(n,"xoffset"), getfield(n,"yoffset") - end - - function direct.setoffsets(n,x,y) - if x then - setfield(n,"xoffset",x) - end - if y then - setfield(n,"yoffset",y) - end - end - -end - -if LUATEXVERSION < 1.005 then - local getfield = direct.getfield - function direct.getnucleus(n) return getfield(n,"nucleus") end - function direct.getsub (n) return getfield(n,"sub") end - function direct.getsup (n) return getfield(n,"sup") end -end +-- if not direct.getcomponents then +-- +-- local getfield = direct.getfield +-- local setfield = direct.setfield +-- local setsubtype = direct.setsubtype +-- +-- local attributelist_code = nodecodes.attributelist +-- +-- function direct.getcomponents(n) return getfield(n,"components") end +-- function direct.setcomponents(n,c) setfield(n,"components",c) end +-- function direct.getkern(n) return getfield(n,"kern") end +-- function direct.getwidth(n) return getfield(n,"width") end +-- function direct.setwidth(n,w) return setfield(n,"width",w) end +-- function direct.getheight(n) return getfield(n,"height") end +-- function direct.setheight(n,h) return setfield(n,"height",h) end +-- function direct.getdepth(n) return getfield(n,"depth") end +-- function direct.setdepth(n,d) return setfield(n,"depth",d) end +-- function direct.getshift(n) return getfield(n,"shift") end +-- function direct.setshift(n,s) return setfield(n,"shift",s) end +-- function direct.getpenalty(n) return getfield(n,"penalty") end +-- function direct.setpenalty(n,p) setfield(n,"penalty",p) end +-- function direct.getdir(n) return getfield(n,"dir") end +-- function direct.setdir(n,p) setfield(n,"dir",p) end +-- function direct.getlanguage(n) return getfield(n,"lang") end +-- function direct.setlanguage(n,l) return setfield(n,"lang",l) end +-- function direct.getattributelist(n) getfield(n,"attr") end +-- +-- function direct.getnucleus(n) return getfield(n,"nucleus") end +-- function direct.setnucleus(n,p) return setfield(n,"nucleus",p) end +-- function direct.getsup(n) return getfield(n,"sup") end +-- function direct.setsup(n,p) return setfield(n,"sup",p) end +-- function direct.getsub(n) return getfield(n,"sub") end +-- function direct.setsub(n,p) return setfield(n,"sub",p) end +-- +-- function direct.setattributelist(n,a) +-- if a and type(a) ~= attributelist_code then +-- a = getfield(a,"attr") +-- end +-- setfield(n,"attr",a) +-- end +-- +-- function direct.setkern(n,k,s) +-- setfield(n,"kern",k) +-- if s then +-- setsubtype(n,s) +-- end +-- end +-- +-- function direct.setfont(n,f,c) +-- setfield(n,"font",f) +-- if c then +-- setfield(n,"char",f) +-- end +-- end +-- +-- function direct.getoffsets(n) +-- return getfield(n,"xoffset"), getfield(n,"yoffset") +-- end +-- +-- function direct.setoffsets(n,x,y) +-- if x then +-- setfield(n,"xoffset",x) +-- end +-- if y then +-- setfield(n,"yoffset",y) +-- end +-- end +-- +-- end +-- +-- if LUATEXVERSION < 1.005 then +-- local getfield = direct.getfield +-- function direct.getnucleus(n) return getfield(n,"nucleus") end +-- function direct.getsub (n) return getfield(n,"sub") end +-- function direct.getsup (n) return getfield(n,"sup") end +-- end +-- -- some tracing: +-- -- local hash = table.setmetatableindex("number") -- local ga = direct.get_attribute -- function direct.get_attribute(n,a) @@ -219,7 +205,7 @@ end -- function nuts.reportattr() -- inspect(hash) -- end - +-- -- local function track(name) -- local n = 0 -- local f = nuts[name] -- cgit v1.2.3