summaryrefslogtreecommitdiff
path: root/graphics/pstricks
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-02-19 03:02:00 +0000
committerNorbert Preining <norbert@preining.info>2023-02-19 03:02:00 +0000
commit9fb4a5e992bb10daf1cb0ad8f298a452e50caea8 (patch)
tree654b8fb7c54e92588bedee7210168c112a3c4af4 /graphics/pstricks
parent4ff14bd6227f033e0d226f68a153f4a8c6458d16 (diff)
CTAN sync 202302190301
Diffstat (limited to 'graphics/pstricks')
-rw-r--r--graphics/pstricks/contrib/luapstricks/luapstricks.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/graphics/pstricks/contrib/luapstricks/luapstricks.lua b/graphics/pstricks/contrib/luapstricks/luapstricks.lua
index 5482582d15..ee88e48993 100644
--- a/graphics/pstricks/contrib/luapstricks/luapstricks.lua
+++ b/graphics/pstricks/contrib/luapstricks/luapstricks.lua
@@ -18,8 +18,8 @@
if luatexbase then
luatexbase.provides_module {
name = 'luapstricks',
- version = 'v0.6',
- date = '2022-09-10',
+ version = 'v0.8',
+ date = '2023-02-17',
description = 'PSTricks backend for LuaLaTeX',
}
end
@@ -3016,11 +3016,16 @@ systemdict = {kind = 'dict', value = {
texio.write_nl('term and log', ps_to_string(operand_stack[i]))
end
end,
+ pstack = function()
+ for i=#operand_stack, 1, -1 do
+ texio.write_nl('term and log', ps_to_string(require'inspect'(operand_stack[i])))
+ end
+ end,
['='] = function()
texio.write_nl('term and log', ps_to_string(pop()))
end,
['=='] = function() -- FIXME: Should give a better representation
- texio.write_nl('term and log', ps_to_string(pop()))
+ texio.write_nl('term and log', require'inspect'((pop())))
end,
stringwidth = function()
@@ -3941,12 +3946,14 @@ local register_texbox do
local op = function()
flush_delayed()
local state = graphics_stack[#graphics_stack]
- local w, h, d = node.direct.dimensions(box.box)
+ local copied = node.direct.copy(box.box)
+ local w, h, d = node.direct.dimensions(copied)
register_point(state, 0, -d/65781.76)
register_point(state, w/65781.76, h/65781.76)
vf.push()
- vf.node(box.box)
+ vf.node(copied)
vf.pop()
+ node.direct.free(copied)
end
lua_node_lookup[op] = box
dict[id] = op
@@ -4155,7 +4162,11 @@ lua.get_functions_table()[func] = function()
local tokens = token.scan_argument(true)
if file then
context = tokens
- local f = io.open(kpse.find_file(tokens, 'PostScript header'), 'r')
+ local resolved, msg = kpse.find_file(tokens, 'PostScript header')
+ if not resolved then
+ return tex.error(string.format('luapstricks: Unable to open %q: %s', tokens, msg))
+ end
+ local f = io.open(resolved, 'r')
tokens = f:read'a'
f:close()
end