summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-mps.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-01-27 16:14:16 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-01-27 16:14:16 +0100
commit95a1799032dc61dbca4a11e495be34b4397c8fec (patch)
tree4b24bf117a90ba704dedf19ab1b1a734d78f4e45 /tex/context/base/mkiv/font-mps.lua
parent0cfeab235554eeee0dddd6c3f44d3939ab490ff1 (diff)
downloadcontext-95a1799032dc61dbca4a11e495be34b4397c8fec.tar.gz
2017-01-27 14:46:00
Diffstat (limited to 'tex/context/base/mkiv/font-mps.lua')
-rw-r--r--tex/context/base/mkiv/font-mps.lua19
1 files changed, 8 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/font-mps.lua b/tex/context/base/mkiv/font-mps.lua
index 39c17a1cc..0cda202e6 100644
--- a/tex/context/base/mkiv/font-mps.lua
+++ b/tex/context/base/mkiv/font-mps.lua
@@ -261,6 +261,7 @@ local getfont = nuts.getfont
local getsubtype = nuts.getsubtype
local getfield = nuts.getfield
local getbox = nuts.getbox
+local getwhd = nuts.getwhd
local effective_glue = nuts.effective_glue
@@ -354,10 +355,9 @@ function fonts.metapost.boxtomp(n,kind)
end
dx = dx + getfield(current,"width") * fc
elseif id == rule_code then
- local wd = getfield(current,"width") * fc
+ local wd, ht, dp = getwhd(current)
if wd ~= 0 then
- local ht = getfield(current,"height")
- local dp = getfield(current,"depth")
+ wd = wd * fc
if ht == signal then
ht = getfield(parent,"height")
end
@@ -381,12 +381,13 @@ function fonts.metapost.boxtomp(n,kind)
while current do
local id = getid(current)
if id == hlist_code then
- dy = dy - getfield(current,"height") * fc
+ local _, ht, dp = getwhd(current)
+ dy = dy - ht * fc
local list = getlist(current)
if list then
horizontal(current,list,xoffset+getfield(current,"shift")*fc,yoffset+dy)
end
- dy = dy - getfield(current,"depth") * fc
+ dy = dy - ht * fc
elseif id == vlist_code then
dy = dy - getfield(current,"height") * fc
local list = getlist(current)
@@ -399,11 +400,9 @@ function fonts.metapost.boxtomp(n,kind)
elseif id == glue_code then
dy = dy - effective_glue(current,parent) * fc
elseif id == rule_code then
- local ht = getfield(current,"height")
- local dp = getfield(current,"depth")
+ local wd, ht, dp = getwhd(current)
local hd = (ht + dp) * fc
if hd ~= 0 then
- local wd = getfield(current,"width")
if wd == signal then
wd = getfield(parent,"width") * fc
else
@@ -427,9 +426,7 @@ function fonts.metapost.boxtomp(n,kind)
(getid(box) == hlist_code and horizontal or vertical)(box,list,0,0)
end
- local wd = getfield(box,"width")
- local ht = getfield(box,"height")
- local dp = getfield(box,"depth")
+ local wd, ht, dp = getwhd(box)
result[#result+1] = f_bounds(0,-dp*fc,wd*fc,ht*fc)