diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-11 10:29:07 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-11 10:29:07 +0200 |
commit | 57a61e4673116076f5bbff7600e6dad376af9173 (patch) | |
tree | 8261af49f1576dcfea0f152300d22e1a64ae907f /tex/context/base/mkiv/node-res.lua | |
parent | 274c32699e7826f7590248f91aa1bfbf5b07c8ee (diff) | |
download | context-57a61e4673116076f5bbff7600e6dad376af9173.tar.gz |
2016-04-10 23:57:00
Diffstat (limited to 'tex/context/base/mkiv/node-res.lua')
-rw-r--r-- | tex/context/base/mkiv/node-res.lua | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua index d87f40df7..4d25314ad 100644 --- a/tex/context/base/mkiv/node-res.lua +++ b/tex/context/base/mkiv/node-res.lua @@ -18,20 +18,21 @@ local report_nodes = logs.reporter("nodes","housekeeping") local nodes, node = nodes, node -nodes.pool = nodes.pool or { } -local nodepool = nodes.pool +nodes.pool = nodes.pool or { } +local nodepool = nodes.pool -local whatsitcodes = nodes.whatsitcodes -local skipcodes = nodes.skipcodes -local kerncodes = nodes.kerncodes -local rulecodes = nodes.rulecodes -local nodecodes = nodes.nodecodes +local whatsitcodes = nodes.whatsitcodes +local skipcodes = nodes.skipcodes +local kerncodes = nodes.kerncodes +local rulecodes = nodes.rulecodes +local nodecodes = nodes.nodecodes +local boundarycodes = nodes.boundarycodes -local glyph_code = nodecodes.glyph +local glyph_code = nodecodes.glyph -local allocate = utilities.storage.allocate +local allocate = utilities.storage.allocate -local texgetcount = tex.getcount +local texgetcount = tex.getcount local reserved, nofreserved = { }, 0 @@ -154,15 +155,22 @@ local user_l = register_nut(new_nut("whatsit",whatsitcodes.userdefine local user_s = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_s,"type",115) -- 44 local user_t = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_t,"type",116) -- 44 ----- user_c = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_c,"type",108) -- 44 + local left_margin_kern = register_nut(new_nut("margin_kern",0)) local right_margin_kern = register_nut(new_nut("margin_kern",1)) + local lineskip = register_nut(new_nut("glue",skipcodes.lineskip)) local baselineskip = register_nut(new_nut("glue",skipcodes.baselineskip)) local leftskip = register_nut(new_nut("glue",skipcodes.leftskip)) local rightskip = register_nut(new_nut("glue",skipcodes.rightskip)) + local temp = register_nut(new_nut("temp",0)) + local noad = register_nut(new_nut("noad")) +local boundary = register_nut(new_nut("boundary",boundarycodes.user)) +local wordboundary = register_nut(new_nut("boundary",boundarycodes.word)) + -- the dir field needs to be set otherwise crash: local rule = register_nut(new_nut("rule")) setfield(rule, "dir","TLT") @@ -193,13 +201,33 @@ end function nutpool.penalty(p) local n = copy_nut(penalty) - setfield(n,"penalty",p) + if p and p ~= 0 then + setfield(n,"penalty",p) + end return n end function nutpool.kern(k) local n = copy_nut(kern) - setfield(n,"kern",k) + if k and k ~= 0 then + setfield(n,"kern",k) + end + return n +end + +function nutpool.boundary(v) + local n = copy_nut(boundary) + if v and v ~= 0 then + setfield(n,"value",v) + end + return n +end + +function nutpool.wordboundary(v) + local n = copy_nut(wordboundary) + if v and v ~= 0 then + setfield(n,"value",v) + end return n end @@ -211,7 +239,9 @@ end function nutpool.italickern(k) local n = copy_nut(italickern) - setfield(n,"kern",k) + if k and k ~= 0 then + setfield(n,"kern",k) + end return n end |