diff options
author | Karl Berry <karl@freefriends.org> | 2023-02-19 02:01:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-02-19 02:01:23 +0000 |
commit | 799e0f7683412d331452a236ddf0ca44189967ea (patch) | |
tree | 47b9e0a5081d4c52ae945f343f92ea5cfe051370 /Master/texmf-dist/tex | |
parent | 4aa051c709f6187830198add6e837dec07b3f945 (diff) |
luapstricks (19feb23)
git-svn-id: svn://tug.org/texlive/trunk@65913 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/luapstricks/luapstricks.lua | 23 |
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 |