From fb3b765b371f68ddb981a34defc17358d18b29bc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 3 Jul 2024 19:30:33 +0000 Subject: luamplib (3jul24) git-svn-id: svn://tug.org/texlive/trunk@71698 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/luatex/luamplib/luamplib.lua | 25 ++++++++++++---------- Master/texmf-dist/tex/luatex/luamplib/luamplib.sty | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/luamplib') diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua index a68edaf9fdb..ffe7c0e0c41 100644 --- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua +++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua @@ -11,8 +11,8 @@ luatexbase.provides_module { name = "luamplib", - version = "2.32.3", - date = "2024/06/21", + version = "2.32.4", + date = "2024/07/03", description = "Lua package to typeset Metapost with LuaTeX's MPLib.", } @@ -316,6 +316,7 @@ local function reporterror (result, prevlog) end end +if not math.initialseed then math.randomseed(currenttime) end local function luamplibload (name) local mpx = mplib.new { ini_version = true, @@ -965,7 +966,7 @@ function luamplib.glyph (f, c) if not gid then return mperr"cannot get GID (glyph id)" end local fac = 1000 / (shapedata.units or 1000) local t = shapedata.glyphs[gid].segments - if not t then return "image(fill fullcircle scaled 0;)" end + if not t then return "image()" end for i,v in ipairs(t) do if type(v) == "table" then for ii,vv in ipairs(v) do @@ -1215,7 +1216,7 @@ function luamplib.outlinetext (text) local id = tonumber(fmt:match"mplibtexboxid=(%d+):") local box = texgetbox(id) local res = outline_horz({ }, box, box.head, 0, 0) - if #res == 0 then res = { "mpliboutlinepic[1]:=image(fill fullcircle scaled 0;);" } end + if #res == 0 then res = { "mpliboutlinepic[1]:=image();" } end return tableconcat(res) .. format("mpliboutlinenum:=%i;", #res) end @@ -1737,13 +1738,14 @@ end if pdfmode then pdfetcs.getpageres = pdf.getpageresources or function() return pdf.pageresources end - pdfetcs.setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end - pdfetcs.initialize_resources = function (name) + local getpageres = pdfetcs.getpageres + local setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end + local initialize_resources = function (name) local tabname = format("%s_res",name) pdfetcs[tabname] = { } if luatexbase.callbacktypes.finish_pdffile then -- ltluatex local obj = pdf.reserveobj() - pdfetcs.setpageres(format("%s/%s %i 0 R", pdfetcs.getpageres() or "", name, obj)) + setpageres(format("%s/%s %i 0 R", getpageres() or "", name, obj)) luatexbase.add_to_callback("finish_pdffile", function() pdf.immediateobj(obj, format("<<%s>>", tableconcat(pdfetcs[tabname]))) end, @@ -1753,18 +1755,18 @@ if pdfmode then pdfetcs.fallback_update_resources = function (name, res) local tabname = format("%s_res",name) if not pdfetcs[tabname] then - pdfetcs.initialize_resources(name) + initialize_resources(name) end if luatexbase.callbacktypes.finish_pdffile then local t = pdfetcs[tabname] t[#t+1] = res else - local tpr, n = pdfetcs.getpageres() or "", 0 + local tpr, n = getpageres() or "", 0 tpr, n = tpr:gsub(format("/%s<<",name), "%1"..res) if n == 0 then tpr = format("%s/%s<<%s>>", tpr, name, res) end - pdfetcs.setpageres(tpr) + setpageres(tpr) end end else @@ -2032,7 +2034,8 @@ local function do_preobj_SH(object,prescript) return shade_no end -patterns = { } +pdfetcs.patterns = { } +local patterns = pdfetcs.patterns function luamplib.registerpattern ( boxid, name, opts ) local box = texgetbox(boxid) local wd = format("%.3f",box.width/factor) diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty index 3d20838d3f0..94ad015d473 100644 --- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty +++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty @@ -14,7 +14,7 @@ \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2024/06/21 v2.32.3 mplib package for LuaTeX] + [2024/07/03 v2.32.4 mplib package for LuaTeX] \ifx\newluafunction\@undefined \input ltluatex \fi -- cgit v1.2.3