summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
index 372a77f4181..e737b5d8688 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
@@ -27,7 +27,7 @@ local copy_node = node.copy
local write_node = node.write
local pen_info = mplib.pen_info
-local object_fields = mplib.fields
+local getfields = mplib.getfields or mplib.fields -- todo: in lmtx get them once and then use gettype
local save_table = false
local force_stroke = false
@@ -363,18 +363,20 @@ end
local stack = { }
local function pushproperties(figure)
+ -- maybe there will be getters in lmtx
local boundingbox = figure:boundingbox()
+ local slot = figure:charcode() or 0
local properties = {
llx = boundingbox[1],
lly = boundingbox[2],
urx = boundingbox[3],
ury = boundingbox[4],
- slot = figure:charcode(),
+ slot = slot,
width = figure:width(),
height = figure:height(),
depth = figure:depth(),
- italic = figure:italcorr(),
- number = figure:charcode() or 0,
+ italic = figure:italcorr(), -- figure:italic() in lmtx
+ number = slot,
}
insert(stack,properties)
metapost.properties = properties
@@ -460,7 +462,7 @@ function metapost.flush(specification,result)
result[#result+1] = evenodd and "W* n" or "W n"
elseif objecttype == "stop_clip" then
result[#result+1] = "Q"
- miterlimit, linecap, linejoin, dashed = -1, -1, -1, "" -- was false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then
-- skip
elseif objecttype == "start_group" then
@@ -475,7 +477,7 @@ function metapost.flush(specification,result)
bbox = toboundingbox(object.path),
})
result = { }
-miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
else
insert(groupstack,false)
end
@@ -490,7 +492,7 @@ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
result[#result+1] = reference
result = pluginactions(data.after,result,flushfigure)
result[#result+1] = "Q"
-miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
end
else
-- we use an indirect table as we want to overload
@@ -744,9 +746,9 @@ function metapost.totable(result,askedfig)
for o=1,#objects do
local object = objects[o]
local result = { }
- local fields = object_fields(object) -- hm, is this the whole list, if so, we can get it once
+ local fields = getfields(object) -- hm, is this the whole list, if so, we can get it once
for f=1,#fields do
- local field = fields[f]
+ local field = fields[f]
result[field] = object[field]
end
results[o] = result