From a92a8d40ce567ecf5b0baacd9a93a94aac9a4a2d Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 16 Jul 2019 22:42:53 +0200 Subject: 2019-07-16 18:30:00 --- tex/context/base/mkiv/node-nut.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (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 b097fb8b1..f3877d5c9 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -203,6 +203,7 @@ nuts.vpack = direct.vpack nuts.writable_spec = direct.writable_spec nuts.write = direct.write nuts.mlist_to_hlist = direct.mlist_to_hlist +nuts.has_dimensions = direct.has_dimensions if not nuts.mlist_to_hlist then @@ -219,6 +220,17 @@ if not nuts.mlist_to_hlist then end +if not nuts.has_dimensions then + + local getwhd = direct.getwhd + + function nuts.has_dimensions(n) + local wd, ht, dp = getwhd(n) + return wd ~= 0 or (ht + dp) ~= 0 + end + +end + local getfield = direct.getfield local setfield = direct.setfield @@ -254,6 +266,13 @@ nuts.setdisc = direct.setdisc nuts.getdiscretionary = direct.getdisc nuts.setdiscretionary = direct.setdisc +nuts.getpre = direct.getpre +nuts.setpre = direct.setpre +nuts.getpost = direct.getpost +nuts.setpost = direct.setpost +nuts.getreplace = direct.getreplace +nuts.setreplace = direct.setreplace + local getdata = direct.getdata local setdata = direct.setdata @@ -382,6 +401,23 @@ local remove = (CONTEXTLMTXMODE > 0 and LUATEXFUNCTIONALITY >= 20190704) and d_r return head, current end +-- for now + +if not nuts.getpre then + + local d_getdisc = direct.getdisc + local d_setfield = direct.setfield + + function nuts.getpre(d) local h, _, _, t, _, _ = d_getdisc(d,true) return h, t end + function nuts.getpost(d) local _, h, _, _, t, _ = d_getdisc(d,true) return h, t end + function nuts.getreplace(d) local _, _, h, _, _, t = d_getdisc(d,true) return h, t end + + function nuts.setpre(d,n) d_setfield("pre", n) end + function nuts.setpost(d,n) d_setfield("post", n) end + function nuts.setreplace(d,n) d_setfield("replace",n) end + +end + -- alias nuts.getsurround = nuts.getkern -- cgit v1.2.3