summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-19 01:54:51 +0000
committerKarl Berry <karl@freefriends.org>2023-02-19 01:54:51 +0000
commit4a72c24d73681db172aa6b8d6431b28781e8eac5 (patch)
tree33a1d4f56722062ef4021032f6f7498a35192c7a /Master
parent502b5cc4665c49513a23e6a0df8fddf6e66f5422 (diff)
luapstricks (19feb23) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2022.final@65900 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua b/Master/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua
index 5482582d153..ee88e489932 100644
--- a/Master/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua
+++ b/Master/texmf-dist/tex/lualatex/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