summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-mps.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/font-mps.lua
parent95a1799032dc61dbca4a11e495be34b4397c8fec (diff)
downloadcontext-b14f992ef5f4e868c9959b174278c86516d60dbc.tar.gz
2017-02-17 10:23:00
Diffstat (limited to 'tex/context/base/mkiv/font-mps.lua')
-rw-r--r--tex/context/base/mkiv/font-mps.lua36
1 files changed, 21 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/font-mps.lua b/tex/context/base/mkiv/font-mps.lua
index 0cda202e6..6c441699b 100644
--- a/tex/context/base/mkiv/font-mps.lua
+++ b/tex/context/base/mkiv/font-mps.lua
@@ -262,6 +262,11 @@ local getsubtype = nuts.getsubtype
local getfield = nuts.getfield
local getbox = nuts.getbox
local getwhd = nuts.getwhd
+local getkern = nuts.getkern
+local getshift = nuts.getshift
+local getwidth = nuts.getwidth
+local getheight = nuts.getheight
+local getdepth = nuts.getdepth
local effective_glue = nuts.effective_glue
@@ -339,30 +344,30 @@ function fonts.metapost.boxtomp(n,kind)
dx = dx + horizontal(parent,replace,xoffset+dx,yoffset)
end
elseif id == kern_code then
- dx = dx + getfield(current,"kern") * fc
+ dx = dx + getkern(current) * fc
elseif id == glue_code then
dx = dx + effective_glue(current,parent) * fc
elseif id == hlist_code then
local list = getlist(current)
if list then
- horizontal(current,list,xoffset+dx,yoffset-getfield(current,"shift")*fc)
+ horizontal(current,list,xoffset+dx,yoffset-getshift(current)*fc)
end
- dx = dx + getfield(current,"width") * fc
+ dx = dx + getwidth(current) * fc
elseif id == vlist_code then
local list = getlist(current)
if list then
- vertical(current,list,xoffset+dx,yoffset-getfield(current,"shift")*fc)
+ vertical(current,list,xoffset+dx,yoffset-getshift(current)*fc)
end
- dx = dx + getfield(current,"width") * fc
+ dx = dx + getwidth(current) * fc
elseif id == rule_code then
local wd, ht, dp = getwhd(current)
if wd ~= 0 then
wd = wd * fc
if ht == signal then
- ht = getfield(parent,"height")
+ ht = getheight(parent)
end
if dp == signal then
- dp = getfield(parent,"depth")
+ dp = getdepth(parent)
end
local hd = (ht + dp) * fc
if hd ~= 0 and getsubtype(current) == normal_rule then
@@ -377,7 +382,7 @@ function fonts.metapost.boxtomp(n,kind)
end
vertical = function(parent,current,xoffset,yoffset)
- local dy = getfield(parent,"height") * fc
+ local dy = getheight(parent) * fc
while current do
local id = getid(current)
if id == hlist_code then
@@ -385,18 +390,19 @@ function fonts.metapost.boxtomp(n,kind)
dy = dy - ht * fc
local list = getlist(current)
if list then
- horizontal(current,list,xoffset+getfield(current,"shift")*fc,yoffset+dy)
+ horizontal(current,list,xoffset+getshift(current)*fc,yoffset+dy)
end
- dy = dy - ht * fc
+ dy = dy - dp * fc
elseif id == vlist_code then
- dy = dy - getfield(current,"height") * fc
+ local wd, ht, dp = getwhd(current)
+ dy = dy - ht * fc
local list = getlist(current)
if list then
- vertical(current,list,xoffset+getfield(current,"shift")*fc,yoffset+dy)
+ vertical(current,list,xoffset+getshift(current)*fc,yoffset+dy)
end
- dy = dy - getfield(current,"depth") * fc
+ dy = dy - dp * fc
elseif id == kern_code then
- dy = dy - getfield(current,"kern") * fc
+ dy = dy - getkern(current) * fc
elseif id == glue_code then
dy = dy - effective_glue(current,parent) * fc
elseif id == rule_code then
@@ -404,7 +410,7 @@ function fonts.metapost.boxtomp(n,kind)
local hd = (ht + dp) * fc
if hd ~= 0 then
if wd == signal then
- wd = getfield(parent,"width") * fc
+ wd = getwidth(parent) * fc
else
wd = wd * fc
end