summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/typo-lin.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-02-17 10:31:56 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-02-17 10:31:56 +0100
commitb14f992ef5f4e868c9959b174278c86516d60dbc (patch)
tree28587bb46c025ea7b0d27ba93f09c93dcf53c73a /tex/context/base/mkiv/typo-lin.lua
parent95a1799032dc61dbca4a11e495be34b4397c8fec (diff)
downloadcontext-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/typo-lin.lua')
-rw-r--r--tex/context/base/mkiv/typo-lin.lua38
1 files changed, 24 insertions, 14 deletions
diff --git a/tex/context/base/mkiv/typo-lin.lua b/tex/context/base/mkiv/typo-lin.lua
index 119b94cdc..d702bcb8c 100644
--- a/tex/context/base/mkiv/typo-lin.lua
+++ b/tex/context/base/mkiv/typo-lin.lua
@@ -89,6 +89,14 @@ local getprev = nuts.getprev
local getboth = nuts.getboth
local getfield = nuts.getfield
local setfield = nuts.setfield
+local setlink = nuts.setlink
+local setkern = nuts.setkern
+local getkern = nuts.getkern
+local getdir = nuts.getdir
+local getshift = nuts.getshift
+local setshift = nuts.setshift
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
local setprop = nuts.setprop
local getprop = nuts.rawprop -- getprop
@@ -135,8 +143,8 @@ local function finalize(prop,key) -- delayed calculations
local line = prop.line
local hsize = prop.hsize
local width = prop.width
- local shift = getfield(line,"shift") -- dangerous as it can be vertical as well
- local reverse = getfield(line,"dir") == "TRT" or false
+ local shift = getshift(line) -- dangerous as it can be vertical as well
+ local reverse = getdir(line) == "TRT" or false
local pack = new_hlist()
local head = getlist(line)
local delta = 0
@@ -168,7 +176,7 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
local head = oldhead
local leftskip = nil
local rightskip = nil
- local width = getfield(line,"width")
+ local width = getwidth(line)
local hsize = islocal and width or tex.hsize
local lskip = 0
local rskip = 0
@@ -179,7 +187,7 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
local subtype = getsubtype(head)
if subtype == leftskip_code then
leftskip = head
- lskip = getfield(head,"width") or 0
+ lskip = getwidth(head) or 0
end
current = getnext(head)
id = getid(current)
@@ -194,7 +202,7 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
if id == glue_code then
if getsubtype(current) == rightskip_code then
rightskip = tail
- rskip = getfield(current,"width") or 0
+ rskip = getwidth(current) or 0
current = getprev(tail)
id = getid(current)
end
@@ -355,12 +363,14 @@ local function addanchortoline(n,anchor)
local anchor = tonut(anchor)
local where = line.where
if trace_anchors then
- local rule1 = new_rule(65536/2,4*65536,4*65536)
- local rule2 = new_rule(8*65536,65536/4,65536/4)
- local kern1 = new_kern(-65536/4)
- local kern2 = new_kern(-65536/4-4*65536)
- anchor = new_hlist(nuts.link { anchor, kern1, rule1, kern2, rule2 })
- setfield(anchor,"width",0)
+ anchor = new_hlist(setlink(
+ anchor,
+ new_kern(-65536/4),
+ new_rule(65536/2,4*65536,4*65536),
+ new_kern(-65536/4-4*65536),
+ new_rule(8*65536,65536/4,65536/4)
+ ))
+ setwidth(anchor,0)
end
if where.tail then
local head = where.head
@@ -393,15 +403,15 @@ function paragraphs.moveinline(n,blob,dx,dy)
if dx ~= 0 then
local prev, next = getboth(blob)
if prev and getid(prev) == kern_code then
- setfield(prev,"kern",getfield(prev,"kern") + dx)
+ setkern(prev,getkern(prev) + dx)
end
if next and getid(next) == kern_code then
- setfield(next,"kern",getfield(next,"kern") - dx)
+ setkern(next,getkern(next) - dx)
end
end
if dy ~= 0 then
if getid(blob) == hlist_code then
- setfield(blob,"shift",getfield(blob,"shift") + dy)
+ setshift(blob,getshift(blob) + dy)
end
end
else