texlive[71698] Master/texmf-dist: luamplib (3jul24)
commits+karl at tug.org
commits+karl at tug.org
Wed Jul 3 21:30:33 CEST 2024
Revision: 71698
https://tug.org/svn/texlive?view=revision&revision=71698
Author: karl
Date: 2024-07-03 21:30:33 +0200 (Wed, 03 Jul 2024)
Log Message:
-----------
luamplib (3jul24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS 2024-07-03 19:30:24 UTC (rev 71697)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS 2024-07-03 19:30:33 UTC (rev 71698)
@@ -1,5 +1,10 @@
History of the luamplib package
+2024/07/03 2.32.4
+ * make the variable 'patterns' local
+ * 'math.randomseed' on plain TeX
+ * remove redundant code 'fullcircle scaled 0'
+
2024/06/21 2.32.3
* 'coloured' is a synonym of the option 'colored' in pattern definition.
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
===================================================================
--- trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx 2024-07-03 19:30:24 UTC (rev 71697)
+++ trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx 2024-07-03 19:30:33 UTC (rev 71698)
@@ -85,7 +85,7 @@
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luamplib.drv}%
- [2024/06/21 v2.32.3 Interface for using the mplib library]%
+ [2024/07/03 v2.32.4 Interface for using the mplib library]%
\documentclass{ltxdoc}
\usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
\usepackage[x11names]{xcolor}
@@ -153,7 +153,7 @@
% \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
% Maintainer: LuaLaTeX Maintainers ---
% Support: \email{lualatex-dev at tug.org}}
-% \date{2024/06/21 v2.32.3}
+% \date{2024/07/03 v2.32.4}
%
% \maketitle
%
@@ -690,8 +690,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.",
}
@@ -1076,6 +1076,12 @@
end
end
+% \end{macrocode}
+%
+% |lualibs-os.lua| installs a randomseed. When this file is not loaded,
+% we should explicitly seed a unique interger to get random randomseed for each run.
+% \begin{macrocode}
+if not math.initialseed then math.randomseed(currenttime) end
local function luamplibload (name)
local mpx = mplib.new {
ini_version = true,
@@ -1888,7 +1894,7 @@
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
@@ -2142,7 +2148,7 @@
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
@@ -2718,13 +2724,14 @@
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,
@@ -2734,18 +2741,18 @@
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
@@ -3025,7 +3032,8 @@
%
% Patterns
% \begin{macrocode}
-patterns = { }
+pdfetcs.patterns = { }
+local patterns = pdfetcs.patterns
function luamplib.registerpattern ( boxid, name, opts )
local box = texgetbox(boxid)
local wd = format("%.3f",box.width/factor)
@@ -3495,7 +3503,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
Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua 2024-07-03 19:30:24 UTC (rev 71697)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua 2024-07-03 19:30:33 UTC (rev 71698)
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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)
Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty 2024-07-03 19:30:24 UTC (rev 71697)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty 2024-07-03 19:30:33 UTC (rev 71698)
@@ -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
More information about the tex-live-commits
mailing list.