From 9fb4a5e992bb10daf1cb0ad8f298a452e50caea8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 19 Feb 2023 03:02:00 +0000 Subject: CTAN sync 202302190301 --- .../pstricks/contrib/luapstricks/luapstricks.lua | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'graphics/pstricks/contrib') 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 -- cgit v1.2.3