summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-07-16 22:58:17 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-07-16 22:58:17 +0200
commita06e8a0d7325ee248138a327e1117139b71aeaba (patch)
treec0ffdfcb82aac51b5e35fb3e5aa2ae0314d62220 /tex
parenteebab79d84255890c1a6d320fba146b1c422c3a6 (diff)
downloadcontext-a06e8a0d7325ee248138a327e1117139b71aeaba.tar.gz
2021-07-16 22:01:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-pe.mkii1
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/data-out.lua6
-rw-r--r--tex/context/base/mkiv/data-vir.lua5
-rw-r--r--tex/context/base/mkiv/mlib-pdf.lua16
-rw-r--r--tex/context/base/mkiv/mult-prm.lua3
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23621 -> 23617 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin248500 -> 248519 bytes
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/libs-imp-zint.lmt5
-rw-r--r--tex/context/base/mkxl/lpdf-mis.lmt2
-rw-r--r--tex/context/base/mkxl/meta-ini.mkxl4
-rw-r--r--tex/context/base/mkxl/mlib-fio.lmt11
-rw-r--r--tex/context/base/mkxl/mlib-pdf.lmt16
-rw-r--r--tex/context/base/mkxl/page-txt.mklx7
-rw-r--r--tex/context/interface/mkii/keys-pe.xml1
-rw-r--r--tex/context/modules/mkiv/m-asymptote.lua2
-rw-r--r--tex/context/modules/mkiv/m-asymptote.mkiv2
-rw-r--r--tex/context/modules/mkiv/m-barcodes.mkiv7
-rw-r--r--tex/context/modules/mkiv/m-escrito.lua361
-rw-r--r--tex/context/modules/mkiv/m-escrito.mkiv19
-rw-r--r--tex/context/modules/mkiv/m-pictex.mkiv11
-rw-r--r--tex/context/modules/mkiv/m-pstricks.mkiv11
-rw-r--r--tex/context/modules/mkiv/m-tikz.mkiv90
-rw-r--r--tex/context/modules/mkiv/m-zint.mkiv8
-rw-r--r--tex/context/modules/mkxl/m-barcodes.mkxl40
-rw-r--r--tex/context/modules/mkxl/m-gnuplot.mkxl (renamed from tex/context/modules/mkiv/m-gnuplot.mkxl)0
-rw-r--r--tex/context/modules/mkxl/m-tikz.mkxl112
-rw-r--r--tex/context/sample/common/spider.eps6
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
34 files changed, 511 insertions, 249 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index f40536141..5f88118e5 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2021.07.10 21:47}
+\newcontextversion{2021.07.16 21:58}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 2b275f541..f82269d66 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.07.10 21:47}
+\edef\contextversion{2021.07.16 21:58}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii
index 4eed24cd9..49abd76c3 100644
--- a/tex/context/base/mkii/mult-pe.mkii
+++ b/tex/context/base/mkii/mult-pe.mkii
@@ -1236,6 +1236,7 @@
\setinterfaceconstant{splitoffset}{شکافتن‌آفست}
\setinterfaceconstant{spot}{لکه}
\setinterfaceconstant{stack}{توده}
+\setinterfaceconstant{stacking}{stacking}
\setinterfaceconstant{stackname}{stackname}
\setinterfaceconstant{start}{شروع}
\setinterfaceconstant{starter}{starter}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 2e8e2ac4c..f805e1f8d 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.07.10 21:47}
+\newcontextversion{2021.07.16 21:58}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index be8e09179..11f827ce2 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.07.10 21:47}
+\edef\contextversion{2021.07.16 21:58}
%D Kind of special:
diff --git a/tex/context/base/mkiv/data-out.lua b/tex/context/base/mkiv/data-out.lua
index 6cd02a22e..cc20f50b3 100644
--- a/tex/context/base/mkiv/data-out.lua
+++ b/tex/context/base/mkiv/data-out.lua
@@ -14,4 +14,8 @@ local registermethod = resolvers.registermethod
local savers = allocate { helpers = { } }
resolvers.savers = savers
-registermethod("savers", savers, "uri")
+local cleaners = allocate { helpers = { } }
+resolvers.cleaners = cleaners
+
+registermethod("savers", savers, "uri")
+registermethod("cleaners", cleaners, "uri")
diff --git a/tex/context/base/mkiv/data-vir.lua b/tex/context/base/mkiv/data-vir.lua
index 4b19ee537..b78211fc9 100644
--- a/tex/context/base/mkiv/data-vir.lua
+++ b/tex/context/base/mkiv/data-vir.lua
@@ -17,6 +17,7 @@ trackers.register("resolvers.virtual", function(v) trace_virtual = v end)
local resolvers = resolvers
local savers = resolvers.savers
+local cleaners = resolvers.cleaners
local data = { }
local n = 0 -- hm, number can be query
@@ -37,6 +38,10 @@ function savers.virtual(specification,content,suffix)
return filename
end
+function cleaners.virtual(filename)
+ data[filename] = nil
+end
+
local finders = resolvers.finders
local notfound = finders.notfound
diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua
index 7566d9310..5c1dc88b8 100644
--- a/tex/context/base/mkiv/mlib-pdf.lua
+++ b/tex/context/base/mkiv/mlib-pdf.lua
@@ -214,7 +214,7 @@ local function flushnormalpath(path, t, open)
return t
end
-local function flushconcatpath(path, t, open)
+local function flushconcatpath(path, t, open, transform)
local pth, ith, nt
local length = #path
if t then
@@ -223,8 +223,10 @@ local function flushconcatpath(path, t, open)
t = { }
nt = 0
end
- nt = nt + 1
- t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ if transform then
+ nt = nt + 1
+ t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ end
for i=1,length do
nt = nt + 1
pth = path[i]
@@ -599,7 +601,7 @@ function metapost.flush(specification,result)
for i=1,#savedpath do
local path = savedpath[i]
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,i==1)
else
flushnormalpath(path,result,open)
end
@@ -609,7 +611,7 @@ function metapost.flush(specification,result)
if flush then
-- ignore this path
elseif transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,true)
else
flushnormalpath(path,result,open)
end
@@ -639,7 +641,7 @@ function metapost.flush(specification,result)
for i=1,#savedhtap do
local path = savedhtap[i]
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,i==1)
else
flushnormalpath(path,result,open)
end
@@ -648,7 +650,7 @@ function metapost.flush(specification,result)
evenodd = true
end
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,true)
else
flushnormalpath(path,result,open)
end
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index ae2b58a2a..05ab7bcf0 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -300,6 +300,7 @@ return {
"csstring",
"defcsname",
"dimensiondef",
+ "dimexpression",
"directlua",
"edefcsname",
"efcode",
@@ -460,6 +461,7 @@ return {
"nospaces",
"novrule",
"numericscale",
+ "numexpression",
"orelse",
"orunless",
"outputbox",
@@ -496,6 +498,7 @@ return {
"tokspre",
"tolerant",
"tpack",
+ "tracingexpressions",
"tracingfonts",
"tracinghyphenation",
"tracingmath",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 4b9018dc7..751c819da 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 44e5059a7..0737a3f55 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 974b7c4df..8c029b2e4 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.07.10 21:47}
+\newcontextversion{2021.07.16 21:58}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index efba80182..9b1e70180 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2021.07.10 21:47}
+\immutable\edef\contextversion{2021.07.16 21:58}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/libs-imp-zint.lmt b/tex/context/base/mkxl/libs-imp-zint.lmt
index a3ac97584..a7646c436 100644
--- a/tex/context/base/mkxl/libs-imp-zint.lmt
+++ b/tex/context/base/mkxl/libs-imp-zint.lmt
@@ -104,6 +104,11 @@ local function execute(specification)
if okay() then
local code = specification.code
local text = specification.text
+ --
+ if lower(code) == "isbn" then
+ specification.text = text and gsub(text,"[^%d]","") or ""
+ end
+ --
if code then
local id = mapping[code]
if id then
diff --git a/tex/context/base/mkxl/lpdf-mis.lmt b/tex/context/base/mkxl/lpdf-mis.lmt
index bd1d9990e..bf1a736c0 100644
--- a/tex/context/base/mkxl/lpdf-mis.lmt
+++ b/tex/context/base/mkxl/lpdf-mis.lmt
@@ -354,7 +354,7 @@ local pagespecs = {
[v_doublesided] = {
mode = "UseNone",
layout = "TwoColumnRight",
- fit = true,
+ fit = true,
},
[v_singlesided] = {
mode = "UseNone"
diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl
index 8fca5d503..8abd1339a 100644
--- a/tex/context/base/mkxl/meta-ini.mkxl
+++ b/tex/context/base/mkxl/meta-ini.mkxl
@@ -686,7 +686,7 @@
\begincsname\??mpgraphic#2\endcsname\empty
\meta_end_graphic_group}
-\def\meta_uniquempgraphic_nop#=#*#=%
+\tolerant\def\meta_uniquempgraphic_nop#=#*#=%
{\meta_begin_graphic_group{#1}%
\checkmpcategoryparent
\let\currentmpcategory\currentMPgraphicname
@@ -788,7 +788,7 @@
\fi
\meta_end_graphic_group}
-\def\meta_usempgraphic_nop#=#*#=%
+\tolerant\def\meta_usempgraphic_nop#=#*#=%
{\meta_begin_graphic_group{#1}%
\ifcsname\??mpgraphic#1\endcsname
\edef\currentmpcategory{#1}%
diff --git a/tex/context/base/mkxl/mlib-fio.lmt b/tex/context/base/mkxl/mlib-fio.lmt
index 8235fdbec..d51b222cf 100644
--- a/tex/context/base/mkxl/mlib-fio.lmt
+++ b/tex/context/base/mkxl/mlib-fio.lmt
@@ -62,11 +62,16 @@ end
-- We can have a list!
+local findtexfile = resolvers.findtexfile
+local opentexfile = resolvers.opentexfile
+local splitlines = string.splitlines
+
local suffixlist = { "mpxl", "mpiv", "mp" } -- no "mf"
local function findmpfile(name,ftype)
local validtyp = validftype(ftype)
- local fullname = findfile(name,validtyp)
+ -- local fullname = findfile(name,validtyp)
+ local fullname = findtexfile(name,validtyp)
if fullname and fullname ~= "" then
return fullname
elseif suffix(name) == "" then
@@ -97,10 +102,6 @@ local function finder(name,mode,kind) -- fake message for mpost.map and metafun.
return found
end
-local findtexfile = resolvers.findtexfile
-local opentexfile = resolvers.opentexfile
-local splitlines = string.splitlines
-
local function writetoterminal(terminaldata,maxterm,d)
local t = type(d)
local n = 0
diff --git a/tex/context/base/mkxl/mlib-pdf.lmt b/tex/context/base/mkxl/mlib-pdf.lmt
index 58a1129eb..ec13ef289 100644
--- a/tex/context/base/mkxl/mlib-pdf.lmt
+++ b/tex/context/base/mkxl/mlib-pdf.lmt
@@ -193,7 +193,7 @@ local function flushnormalpath(path, t, open, tolerance)
return t
end
-local function flushconcatpath(path, t, open, tolerance)
+local function flushconcatpath(path, t, open, tolerance, transform)
local pth, ith, nt
local length = #path
if t then
@@ -202,8 +202,10 @@ local function flushconcatpath(path, t, open, tolerance)
t = { }
nt = 0
end
- nt = nt + 1
- t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ if transform then
+ nt = nt + 1
+ t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ end
for i=1,length do
nt = nt + 1
pth = path[i]
@@ -565,7 +567,7 @@ function metapost.flush(specification,result)
for i=1,#savedpath do
local path = savedpath[i]
if transformed then
- flushconcatpath(path,result,open,tolerance)
+ flushconcatpath(path,result,open,tolerance,i==1)
else
flushnormalpath(path,result,open,tolerance)
end
@@ -575,7 +577,7 @@ function metapost.flush(specification,result)
if flush then
-- ignore this path
elseif transformed then
- flushconcatpath(path,result,open,tolerance)
+ flushconcatpath(path,result,open,tolerance,true)
else
flushnormalpath(path,result,open,tolerance)
end
@@ -605,7 +607,7 @@ function metapost.flush(specification,result)
for i=1,#savedhtap do
local path = savedhtap[i]
if transformed then
- flushconcatpath(path,result,open,tolerance)
+ flushconcatpath(path,result,open,tolerance,i==1)
else
flushnormalpath(path,result,open,tolerance)
end
@@ -614,7 +616,7 @@ function metapost.flush(specification,result)
evenodd = true
end
if transformed then
- flushconcatpath(path,result,open,tolerance)
+ flushconcatpath(path,result,open,tolerance,true)
else
flushnormalpath(path,result,open,tolerance)
end
diff --git a/tex/context/base/mkxl/page-txt.mklx b/tex/context/base/mkxl/page-txt.mklx
index 3b46d42f9..969f0a447 100644
--- a/tex/context/base/mkxl/page-txt.mklx
+++ b/tex/context/base/mkxl/page-txt.mklx
@@ -478,13 +478,13 @@
\page_layouts_left_edge_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth
\fi
\ifdim\leftmarginwidth>\zeropoint
- \page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\zerocount
+ \page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\plusone
\fi
\ifdim\makeupwidth>\zeropoint
\page_layouts_text_body_element_e_r_m_l
\fi
\ifdim\rightmarginwidth>\zeropoint
- \page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\plusone
+ \page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\zerocount
\fi
\ifdim\rightedgewidth>\zeropoint
\page_layouts_right_edge_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth
@@ -526,6 +526,9 @@
% margin needs checking!
+% \hbox to \leftmarginwidth{\hss\layoutelementparameter\c!margintext}%
+% \hbox to \rightmarginwidth{\layoutelementparameter\c!margintext\hss}%
+
\def\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo%
{\letfromlayoutelementparameter\p_text#text%
\ifempty\p_text
diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml
index 691b93919..f41ba8cae 100644
--- a/tex/context/interface/mkii/keys-pe.xml
+++ b/tex/context/interface/mkii/keys-pe.xml
@@ -1242,6 +1242,7 @@
<cd:constant name='splitoffset' value='شکافتن‌آفست'/>
<cd:constant name='spot' value='لکه'/>
<cd:constant name='stack' value='توده'/>
+ <cd:constant name='stacking' value='stacking'/>
<cd:constant name='stackname' value='stackname'/>
<cd:constant name='start' value='شروع'/>
<cd:constant name='starter' value='starter'/>
diff --git a/tex/context/modules/mkiv/m-asymptote.lua b/tex/context/modules/mkiv/m-asymptote.lua
index 31a81433f..9a93e166d 100644
--- a/tex/context/modules/mkiv/m-asymptote.lua
+++ b/tex/context/modules/mkiv/m-asymptote.lua
@@ -29,7 +29,7 @@ sandbox.registerrunner {
checkers = { filename = "readable" },
}
-function moduledata.asympote.process(name,type)
+function moduledata.asymptote.process(name,type)
if type == "prc" then
local result = buffers.run(name,false,"asymptote prc","prc")
local jsdata = { js = replacesuffix(result,"js") }
diff --git a/tex/context/modules/mkiv/m-asymptote.mkiv b/tex/context/modules/mkiv/m-asymptote.mkiv
index 9cd4037fb..6317fc072 100644
--- a/tex/context/modules/mkiv/m-asymptote.mkiv
+++ b/tex/context/modules/mkiv/m-asymptote.mkiv
@@ -51,7 +51,7 @@
{\iffirstargument
\begingroup
\getdummyparameters[#2]%
- \edef\lasttypesetbuffer{\ctxlua{moduledata.asympote.process("asymptote:#1","\dummyparameter\c!type")}}%
+ \edef\lasttypesetbuffer{\ctxlua{moduledata.asymptote.process("asymptote:#1","\dummyparameter\c!type")}}%
\externalfigure
[\lasttypesetbuffer]%
[\c!controls=\lasttypesetbuffer,#2]%
diff --git a/tex/context/modules/mkiv/m-barcodes.mkiv b/tex/context/modules/mkiv/m-barcodes.mkiv
index 84f093c56..17afb5753 100644
--- a/tex/context/modules/mkiv/m-barcodes.mkiv
+++ b/tex/context/modules/mkiv/m-barcodes.mkiv
@@ -1,3 +1,5 @@
+% engine=luatex
+
%D \module
%D [ file=m-barcodes,
%D version=2010.03.14,
@@ -20,6 +22,11 @@
\unexpanded\def\barcode[#1]%
{\normalbarcode[\c!text=\dummyparameter\c!code,\c!alternative=\dummyparameter\c!type,#1]}
+%D We keep the following for historic reasons to show progress over years. The
+%D original idea was to use escrito fro the code below but it never happened as
+%D we went zint. I'll look into that when users really want to use pstricks but I
+%D never had requests and the chemical mpoduel also moved on.
+
\iffalse
% \startTEXpage
diff --git a/tex/context/modules/mkiv/m-escrito.lua b/tex/context/modules/mkiv/m-escrito.lua
index 0d7a04741..8a45f1a2c 100644
--- a/tex/context/modules/mkiv/m-escrito.lua
+++ b/tex/context/modules/mkiv/m-escrito.lua
@@ -48,6 +48,24 @@ if not modules then modules = { } end modules ['m-escrito'] = {
-- of the VM calls (in direct mode they are no-ops anyway). We can also share some
-- more code here and there.
+-- Notes:
+--
+-- -- all modules are checked / adapted to lmtx but how about this one ... i noticed
+-- that a file in the test suite failed
+--
+-- -- the idea was to use this for the m4all eps files but we swichted the format
+-- there; nevertheless i patched a littl but it's still not ok (cold winter work)
+--
+-- -- for instance some ppor mans fancy shading doesn't show up (not that efficient
+-- either so ...)
+--
+-- -- let's see what the new fast ps->pdf lib from artifact brings ... makes more
+-- sense in the perspective of ps 2 and 3 .. but there is some sentiment involved
+--
+-- -- room for implification (like no integer / real distinction needed)
+--
+-- -- so for now this is not part of the mkiv/lmtx code split (then also go Lua 5.4)
+
local type, unpack, tonumber, tostring, next = type, unpack, tonumber, tostring, next
local format = string.format
@@ -78,7 +96,7 @@ local log10 = math.log10
local random = math.random
local setranseed = math.randomseed
-local bitand = bit32.band
+local bitand = bit32.band -- when lmtx: Lua 5.4
local bitor = bit32.bor
local bitxor = bit32.bxor
local bitrshift = bit32.rshift
@@ -133,7 +151,7 @@ initializers[#initializers+1] = function()
VM = { }
end
-local directvm = true
+local directvm = false -- true (but then we ned to patch more VM[..]
local add_VM, get_VM
@@ -245,6 +263,9 @@ end
local opstack
local opstackptr
+local b_true = { 'boolean', 'unlimited', 'literal', true }
+local b_false = { 'boolean', 'unlimited', 'literal', false }
+
initializers[#initializers+1] = function()
opstack = { }
opstackptr = 0
@@ -489,7 +510,7 @@ function operators.exch()
if opstackptr < 2 then
return ps_error('stackunderflow')
end
- local prv = opstackptr-1
+ local prv = opstackptr - 1
opstack[opstackptr], opstack[prv] = opstack[prv], opstack[opstackptr]
return true
end
@@ -498,7 +519,7 @@ function operators.dup()
if opstackptr < 1 then
return ps_error('stackunderflow')
end
- local nxt = opstackptr+1
+ local nxt = opstackptr + 1
opstack[nxt] = opstack[opstackptr]
opstackptr = nxt
return true
@@ -1835,10 +1856,10 @@ function operators.anchorsearch()
local post = sub(thestring,#thesearch+1)
push_opstack { 'string', 'unlimited', 'literal', add_VM(post), 1, #post }
push_opstack { 'string', 'unlimited', 'literal', add_VM(prefix), 1, #prefix }
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack (b_true)
else
push_opstack(a)
- push_opstack { 'boolean', 'unlimited', 'literal', false }
+ push_opstack (b_false)
end
return true
end
@@ -1884,10 +1905,10 @@ function operators.search()
push_opstack { 'string', 'unlimited', 'literal', add_VM(post), 1, #post }
push_opstack { 'string', 'unlimited', 'literal', add_VM(thesearch), 1, #thesearch }
push_opstack { 'string', 'unlimited', 'literal', add_VM(prefix), 1, #prefix }
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack (b_true)
else
push_opstack(a)
- push_opstack { 'boolean', 'unlimited', 'literal', false }
+ push_opstack(b_false)
end
return true
end
@@ -1913,7 +1934,7 @@ function operators.token()
if not v then
pop_execstack()
pop_execstack()
- push_opstack { 'boolean', 'unlimited', 'literal', false }
+ push_opstack(b_false)
else
local q = pop_execstack()
if execstack[execstackptr][1] == '.token' then
@@ -1933,7 +1954,7 @@ function operators.token()
end
push_opstack { ta, aa, a[3], add_VM(substring), 1, #substring}
push_opstack(v)
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack(b_true)
end
else -- file
if a[7] ~= 'r' then
@@ -1945,7 +1966,7 @@ function operators.token()
if not v then
pop_execstack()
pop_execstack()
- push_opstack { 'boolean', 'unlimited', 'literal', false }
+ push_opstack(b_false)
else
local q = pop_execstack() -- the file
a[5] = q[5]
@@ -1953,7 +1974,7 @@ function operators.token()
pop_execstack()
end
push_opstack(v)
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack(b_true)
end
end
return true
@@ -1994,7 +2015,7 @@ end
function operators.eq()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a == b }
+ push_opstack(a == b and b_true or b_false)
return true
else
return a
@@ -2004,7 +2025,7 @@ end
function operators.ne()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a ~= b }
+ push_opstack(a ~= b and b_true or b_false)
return true
else
return a
@@ -2040,7 +2061,7 @@ end
function operators.ge()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a >= b }
+ push_opstack(a >= b and b_true or b_false)
return true
else
return a
@@ -2050,7 +2071,7 @@ end
function operators.gt()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a > b }
+ push_opstack(a > b and b_true or b_false)
return true
else
return a
@@ -2060,7 +2081,7 @@ end
function operators.le()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a <= b }
+ push_opstack(a <= b and b_true or b_false)
return true
else
return a
@@ -2070,7 +2091,7 @@ end
function operators.lt()
local ok, a, b = both()
if ok then
- push_opstack { 'boolean', 'unlimited', 'literal', a < b }
+ push_opstack(a < b and b_true or b_false)
return true
else
return a
@@ -2104,7 +2125,7 @@ end
operators["and"]= function()
local ok, a, b = both()
if ok == 'boolean' then
- push_opstack { 'boolean', 'unlimited', 'literal', a[1] and b[1] }
+ push_opstack((a[1] and b[1]) and b_true or b_false)
return true
elseif ok == 'integer' then
push_opstack { 'integer', 'unlimited', 'literal', bitand(a[1],b[1]) }
@@ -2117,7 +2138,7 @@ end
operators["or"] = function()
local ok, a, b = both()
if ok == 'boolean' then
- push_opstack {'boolean', 'unlimited', 'literal', a[1] or b[1] }
+ push_opstack((a[1] or b[1]) and b_true or b_false)
return true
elseif ok == 'integer' then
push_opstack {'integer', 'unlimited', 'literal', bitor(a[1],b[1]) }
@@ -2130,7 +2151,7 @@ end
function operators.xor()
local ok, a, b = both()
if ok == 'boolean' then
- push_opstack {'boolean', 'unlimited', 'literal', a[1] ~= b[1] }
+ push_opstack ((a[1] ~= b[1]) and b_true or b_false) -- hm, unequal ?
return true
elseif ok == 'integer' then
push_opstack {'integer', 'unlimited', 'literal', bitxor(a[1],b[1]) }
@@ -2151,7 +2172,7 @@ operators["not"] = function()
return ps_error('invalidaccess')
end
if ta == 'boolean' then
- push_opstack { 'boolean', 'unlimited', 'literal', not a[4] }
+ push_opstack ((not a[4]) and b_true or b_false)
elseif ta == 'integer' then
push_opstack { 'integer', 'unlimited', 'literal', -a[4] - 1 }
else
@@ -2516,7 +2537,7 @@ function operators.xcheck()
if not a then
return ps_error('stackunderflow')
end
- push_opstack { 'boolean', 'unlimited', 'literal', a[3] == 'executable' }
+ push_opstack((a[3] == 'executable') and b_true or b_false)
return true
end
@@ -2602,7 +2623,7 @@ function operators.rcheck()
else
return ps_error('typecheck')
end
- push_opstack { 'boolean', 'unlimited', 'literal', aa == 'unlimited' or aa == 'read-only' }
+ push_opstack((aa == 'unlimited' or aa == 'read-only') and p_true or p_false)
return true
end
@@ -2621,7 +2642,7 @@ function operators.wcheck()
else
return ps_error('typecheck')
end
- push_opstack { 'boolean', 'unlimited', 'literal', aa == 'unlimited' }
+ push_opstack((aa == 'unlimited') and p_true or p_false)
return true
end
@@ -2906,10 +2927,10 @@ function operators.read()
end
if b then
push_opstack { 'integer', 'unlimited', 'literal', byte(b) }
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack (p_true)
else
f:close()
- push_opstack { 'boolean', 'unlimited', 'literal', false}
+ push_opstack (p_false)
end
return true
end
@@ -3042,7 +3063,7 @@ do
end
if not va then
push_opstack { 'string', 'unlimited', 'literal', add_VM(''), 0, 0 }
- push_opstack { 'boolean', 'unlimited', 'literal', false }
+ push_opstack (p_false)
else
local n = #va
if n > b[6] then
@@ -3051,7 +3072,7 @@ do
local thestring = get_VM(b[4])
VM[b[4]] = va .. sub(thestring,#va+1, -1)
push_opstack { 'string', 'unlimited', 'literal', add_VM(va), n, n }
- push_opstack { 'boolean', 'unlimited', 'literal', true }
+ push_opstack (p_true)
end
return true
end
@@ -3100,7 +3121,7 @@ do
local n = #va
VM[b[4]] = repl .. sub(thestring,n+1,-1)
push_opstack { b[1], b[2], b[3], add_VM(va), n, n }
- push_opstack { 'boolean', 'unlimited', 'literal', n == b[6] }
+ push_opstack ((n == b[6]) and p_true or p_false)
return true
end
@@ -3335,8 +3356,8 @@ local function commonstack(seperator)
for n=1,opstackptr do
push_opstack { 'string', 'unlimited', 'literal', add_VM(seperator), 1 ,1 }
push_opstack(opstack[n])
- push_execstack { 'operator','unlimited','executable', operators.print, 'print'}
- push_execstack { 'operator','unlimited','executable', operators.equal, '=='}
+ push_execstack { 'operator','unlimited','executable', operators.print, 'print' }
+ push_execstack { 'operator','unlimited','executable', operators.equal, '==' }
end
return true
end
@@ -3377,15 +3398,21 @@ end
function operators.save()
local saved_VM = { }
- for k1, v1 in next, VM do
+-- for k1, v1 in next, VM do
+ for k1 = 1, #VM do
+ local v1 = VM[k1]
if type(v1) == "table" then
local t1 = { }
saved_VM[k1] = t1
- for k2, v2 in next, t1 do
+-- for k2, v2 in next, v1 do
+ for k2=1,#v1 do
+ local v2 = v1[k2]
if type(v2) == "table" then
local t2 = { }
t1[k2] = t2
- for k3, v3 in next, v2 do
+-- for k3, v3 in next, v2 do
+ for k3=1,#v2 do
+ local v3 = v2[k3]
t2[k3] = v3
end
else
@@ -3401,6 +3428,13 @@ function operators.save()
push_opstack { 'save', 'unlimited', 'executable', add_VM(saved_VM) }
end
+function operators.save()
+ local saved_VM = table.copy(VM)
+ push_gsstack { 'save', copy_gsstate() }
+ savelevel = savelevel + 1
+ push_opstack { 'save', 'unlimited', 'executable', add_VM(saved_VM) }
+end
+
do
local function validstack(stack,index,saved_VM)
@@ -3532,6 +3566,9 @@ end
function operators.gsave()
push_gsstack { 'gsave', copy_gsstate() }
+ currentpage[#currentpage+1] = {
+ type = 'gsave',
+ }
return true
end
@@ -3543,6 +3580,9 @@ function operators.grestore()
gsstate = g[2]
end
end
+ currentpage[#currentpage+1] = {
+ type = 'grestore',
+ }
return true
end
@@ -4183,7 +4223,7 @@ function operators.setmatrix()
if i > 6 then
return ps_error('rangecheck')
end
- matrix[i] = va
+ matrix[i] = tv
end
return true
end
@@ -4856,7 +4896,7 @@ local function commonarc(action)
if not a then
return ps_error('stackunderflow')
end
- local ta, tb, tc, td, te = a[1], b[1], c[1], d[1], e[1], f[1]
+ local ta, tb, tc, td, te = a[1], b[1], c[1], d[1], e[1]
if not (ta == 'real' or ta == 'integer') then return ps_error('typecheck') end
if not (tb == 'real' or tb == 'integer') then return ps_error('typecheck') end
if not (tc == 'real' or tc == 'integer') then return ps_error('typecheck') end
@@ -5058,6 +5098,7 @@ function operators.rcurveto()
if #position == 0 then
return ps_error('nocurrentpoint')
end
+ local matrix = gsstate.matrix
local x, y = do_transform(matrix, e[4], f[4])
local ax, ay = do_transform(matrix, a[4], b[4])
local bx, by = do_transform(matrix, c[4], d[4])
@@ -5485,6 +5526,17 @@ end
------------------------------------------------------------------
+function operators.pathbbox()
+ print("todo: pathbbox")
+ push_opstack { "real", 'unlimited', 'literal', 0 }
+ push_opstack { "real", 'unlimited', 'literal', 0 }
+ push_opstack { "real", 'unlimited', 'literal', 1 }
+ push_opstack { "real", 'unlimited', 'literal', 1 }
+ return true
+end
+
+------------------------------------------------------------------
+
-- most time is spend in calculating the boundingbox
-- NULL output
@@ -5537,113 +5589,136 @@ function pdf.showpage(page)
local object = page[i]
local path = object.path
local otyp = object.type
- if otype ~= "clip" and otype ~= "eoclip" then
- local colortype = object.colortype
- local color = object.color
- if colortype == "gray" then
- local v = formatters["%f g %f G"](color,color)
- if g_color ~= v then
- g_colortype = "gray"
- g_color = v
- n = n + 1 ; t[n] = v
+ if otyp == "gsave" then
+ n = n + 1 ; t[n] = "q"
+ -- todo push / pop
+g_colortype = "notacolor"
+g_color = ""
+g_miterlimit = -1
+g_linejoin = -1
+g_linecap = -1
+g_linewidth = -1
+g_dashpattern = nil
+g_dashoffset = -1
+ elseif otyp == "grestore" then
+g_colortype = "notacolor"
+g_color = ""
+g_miterlimit = -1
+g_linejoin = -1
+g_linecap = -1
+g_linewidth = -1
+g_dashpattern = nil
+g_dashoffset = -1
+ n = n + 1 ; t[n] = "Q"
+ else
+ if otyp ~= "clip" and otyp ~= "eoclip" then
+ local colortype = object.colortype
+ local color = object.color
+ if colortype == "gray" then
+ local v = formatters["%f g %f G"](color,color)
+ if g_color ~= v then
+ g_colortype = "gray"
+ g_color = v
+ n = n + 1 ; t[n] = v
+ end
+ elseif colortype == "rgb" then
+ local r, g, b = color[1], color[2], color[3]
+ local v = formatters["%f %f %f rg %f %f %f RG"](r,g,b,r,g,b)
+ if g_color ~= v then
+ g_colortype = "rgb"
+ g_color = v
+ n = n + 1 ; t[n] = v
+ end
+ elseif colortype == "cmyk" then
+ local c, m, y, k = color[1], color[2], color[3], color[4]
+ local v = formatters["%f %f %f %f k %f %f %f %f K"](c,m,y,k,c,m,y,k)
+ if g_color ~= v then
+ g_colortype = "cmyk"
+ g_color = v
+ n = n + 1 ; t[n] = v
+ end
+ elseif colortype == "hsb" then
+ local r, g, b = hsv_to_rgb(color[1],color[2],color[3])
+ local v = formatters["%f %f %f rg %f %f %f RG"](r,g,b,r,g,b)
+ if g_color ~= v then
+ g_colortype = "rgb"
+ g_color = v
+ n = n + 1 ; t[n] = v
+ end
end
- elseif colortype == "rgb" then
- local r, g, b = color[1], color[2], color[3]
- local v = formatters["%f %f %f rg %f %f %f RG"](r,g,b,r,g,b)
- if g_color ~= v then
- g_colortype = "rgb"
- g_color = v
- n = n + 1 ; t[n] = v
+ end
+ if otyp == "stroke" then
+ local miterlimit = object.miterlimit
+ if g_miterlimit ~= miterlimit then
+ g_miterlimit = miterlimit
+ n = n + 1 ; t[n] = formatters["%f M"](miterlimit)
end
- elseif colortype == "cmyk" then
- local c, m, y, k = color[1], color[2], color[3], color[4]
- local v = formatters["%f %f %f %f k %f %f %f %f K"](c,m,y,k,c,m,y,k)
- if g_color ~= v then
- g_colortype = "cmyk"
- g_color = v
- n = n + 1 ; t[n] = v
+ local linejoin = object.linejoin
+ if g_linejoin ~= linejoin then
+ g_linejoin = linejoin
+ n = n + 1 ; t[n] = formatters["%d j"](linejoin)
end
- elseif colortype == "hsb" then
- local r, g, b = hsv_to_rgb(color[1],color[2],color[3])
- local v = formatters["%f %f %f rg %f %f %f RG"](r,g,b,r,g,b)
- if g_color ~= v then
- g_colortype = "rgb"
- g_color = v
- n = n + 1 ; t[n] = v
+ local linecap = object.linecap
+ if g_linecap ~= linecap then
+ g_linecap = linecap
+ n = n + 1 ; t[n] = formatters["%d J"](linecap)
end
- end
- end
- if otype == "stroke" then
- local miterlimit = object.miterlimit
- if g_miterlimit ~= miterlimit then
- g_miterlimit = miterlimit
- n = n + 1 ; t[n] = formatters["%f M"](miterlimit)
- end
- local linejoin = object.linejoin
- if g_linejoin ~= linejoin then
- g_linejoin = linejoin
- n = n + 1 ; t[n] = formatters["%d j"](linejoin)
- end
- local linecap = object.linecap
- if g_linecap ~= linecap then
- g_linecap = linecap
- n = n + 1 ; t[n] = formatters["%d J"](linecap)
- end
- local linewidth = object.linewidth
- if g_linewidth ~= linewidth then
- g_linewidth = linewidth
- n = n + 1 ; t[n] = formatters["%f w"](linewidth)
- end
- local dashpattern = object.dashpattern
- local dashoffset = object.dashoffset
- if g_dashpattern ~= dashpattern or g_dashoffset ~= dashoffset then
- g_dashpattern = dashpattern
- g_dashoffset = dashoffset
- local l = #dashpattern
- if l == 0 then
- n = n + 1 ; t[n] = "[] 0 d"
- else
- n = n + 1 ; t[n] = formatters["[% t] %d d"](dashpattern,dashoffset)
+ local linewidth = object.linewidth
+ if g_linewidth ~= linewidth then
+ g_linewidth = linewidth
+ n = n + 1 ; t[n] = formatters["%f w"](linewidth)
+ end
+ local dashpattern = object.dashpattern
+ local dashoffset = object.dashoffset
+ if g_dashpattern ~= dashpattern or g_dashoffset ~= dashoffset then
+ g_dashpattern = dashpattern
+ g_dashoffset = dashoffset
+ local l = #dashpattern
+ if l == 0 then
+ n = n + 1 ; t[n] = "[] 0 d"
+ else
+ n = n + 1 ; t[n] = formatters["[% t] %d d"](dashpattern,dashoffset)
+ end
end
end
- end
- if path then
- for i=1,#path do
- local segment = path[i]
- local styp = segment[1]
- if styp == "moveto" then
- n = n + 1 ; t[n] = formatters["%f %f m"](segment[2],segment[3])
- elseif styp == "lineto" then
- n = n + 1 ; t[n] = formatters["%f %f l"](segment[2],segment[3])
- elseif styp == "curveto" then
- n = n + 1 ; t[n] = formatters["%f %f %f %f %f %f c"](segment[2],segment[3],segment[4],segment[5],segment[6],segment[7])
- elseif styp == "closepath" then
- n = n + 1 ; t[n] = "h"
- else
- report("unknown path segment type %a",styp)
+ if path then
+ for i=1,#path do
+ local segment = path[i]
+ local styp = segment[1]
+ if styp == "moveto" then
+ n = n + 1 ; t[n] = formatters["%f %f m"](segment[2],segment[3])
+ elseif styp == "lineto" then
+ n = n + 1 ; t[n] = formatters["%f %f l"](segment[2],segment[3])
+ elseif styp == "curveto" then
+ n = n + 1 ; t[n] = formatters["%f %f %f %f %f %f c"](segment[2],segment[3],segment[4],segment[5],segment[6],segment[7])
+ elseif styp == "closepath" then
+ n = n + 1 ; t[n] = "h"
+ else
+ report("unknown path segment type %a",styp)
+ end
end
end
- end
- if otyp == "stroke" then
- n = n + 1 ; t[n] = "S"
- elseif otyp == "fill" then
- n = n + 1 ; t[n] = "f"
- elseif otyp == "eofill" then
- n = n + 1 ; t[n] = "f*"
- elseif otyp == "clip" then
- n = n + 1 ; t[n] = "W n"
- elseif otyp == "eoclip" then
- n = n + 1 ; t[n] = "W* n"
- elseif otyp == "show" then
- if showfont then
- if n > 0 then
- flushpage(concat(t,"\n"))
- n = 0 ; t = { }
+ if otyp == "stroke" then
+ n = n + 1 ; t[n] = "S"
+ elseif otyp == "fill" then
+ n = n + 1 ; t[n] = "f"
+ elseif otyp == "eofill" then
+ n = n + 1 ; t[n] = "f*"
+ elseif otyp == "clip" then
+ n = n + 1 ; t[n] = "W n"
+ elseif otyp == "eoclip" then
+ n = n + 1 ; t[n] = "W* n"
+ elseif otyp == "show" then
+ if showfont then
+ if n > 0 then
+ flushpage(concat(t,"\n"))
+ n = 0 ; t = { }
+ end
+ showfont(object)
end
- showfont(object)
+ else
+ -- nothing to do
end
- else
- -- nothing to do
end
end
n = n + 1 ; t[n] = "Q"
@@ -6198,7 +6273,7 @@ function operators.kshow()
local entry = execstack[execstackptr]
if entry[1] == '.exit' and entry[4] == true then
pop_execstack()
- return true;
+ return true
end
do_show(fontdict,w)
v = w
@@ -6332,6 +6407,7 @@ initializers[#initializers+1] = function(reset)
['cleartomark'] = { 'operator', 'unlimited', 'executable', operators.cleartomark, 'cleartomark' },
['clip'] = { 'operator', 'unlimited', 'executable', operators.clip, 'clip' },
['clippath'] = { 'operator', 'unlimited', 'executable', operators.clippath, 'clippath' },
+ ['pathbbox'] = { 'operator', 'unlimited', 'executable', operators.pathbbox, 'pathbbox' },
['closefile'] = { 'operator', 'unlimited', 'executable', operators.closefile, 'closefile' },
['closepath'] = { 'operator', 'unlimited', 'executable', operators.closepath, 'closepath' },
['concat'] = { 'operator', 'unlimited', 'executable', operators.concat, 'concat' },
@@ -6535,7 +6611,7 @@ initializers[#initializers+1] = function(reset)
size = 1,
maxsize = 40,
dict = {
- newerror = { 'boolean', 'unlimited', 'literal', false }
+ newerror = p_false
},
}
--
@@ -6638,7 +6714,7 @@ do
local sign = S('+-')^-1
local digit = R('09')
local period = P('.')
- local letters = R('!~') - S('[]<>{}()%')
+ local letters = R('!~') - S('[]<>{}()%/')
local hexdigit = R('09','af','AF')
local radixdigit = R('09','az','AZ')
@@ -6732,7 +6808,12 @@ do
object[5] = position
end
if not value then
- return false -- handle_error('syntaxerror')
+ if tokentype == "eof" then
+ -- pop_execstack()
+ return true
+ else
+ return false -- handle_error('syntaxerror')
+ end
elseif tokentype == 'integer' or tokentype == 'real' then
if push { tokentype, 'unlimited', 'literal', value } then
return true
@@ -6759,6 +6840,8 @@ do
end
elseif tokentype == 'bounding' then
specials.boundingbox = value
+ else
+ -- comment
end
end
return position >= length
@@ -6833,7 +6916,7 @@ do
return false
end
local otyp = object[1]
- if DEBUG then
+ if false then -- debugging
if otyp == 'operator' then
report_exec("%s %s %s",otyp,object[3],object[5])
elseif otyp == 'dict' then
diff --git a/tex/context/modules/mkiv/m-escrito.mkiv b/tex/context/modules/mkiv/m-escrito.mkiv
index 704108cee..94251d843 100644
--- a/tex/context/modules/mkiv/m-escrito.mkiv
+++ b/tex/context/modules/mkiv/m-escrito.mkiv
@@ -14,12 +14,16 @@
\registerctxluafile{m-escrito}{}
%D This is a fun project and not meant for production (yet). It's a follow up on a
-%D project by Taco presented at a Bacho\TeX\ meeting years ago. I probably messed up
+%D project by Taco presented at a Bacho\TEX\ meeting years ago. I probably messed up
%D the code so much that some things don't work but then, fonts are not really
%D supported well anyway. However for simple \POSTSCRIPT\ things work out ok.
%D
%D I (Hans) will occasionally have a look at the code. Who knows what our trips to
-%D \TeX\ meetings lead to.
+%D \TEX\ meetings lead to.
+
+%D Ecause the (already split) barcode modules don't need this I'll postpone the
+%D splitting of this one till later. It's more fun project anyway and there are
+%D buglets as well as no support for tricky features.
\unprotect
@@ -78,15 +82,6 @@
\startluacode
- local literal = nodes.pool.register(node.new("whatsit",nodes.whatsitcodes.pdfliteral))
- literal.mode = 0
-
- local function newliteral(result)
- local l = nodes.copy(literal)
- l.data = result
- return l
- end
-
local p = escrito.devices.pdf
function p.startpage(llx,lly,urx,ury)
@@ -98,7 +93,7 @@
end
function p.flushpage(result)
- context.(newliteral(result))
+ context.pdfliteral(result) -- LMTX save (test suite reported issue)
end
-- todo
diff --git a/tex/context/modules/mkiv/m-pictex.mkiv b/tex/context/modules/mkiv/m-pictex.mkiv
index 73aad3f57..8843ac4ce 100644
--- a/tex/context/modules/mkiv/m-pictex.mkiv
+++ b/tex/context/modules/mkiv/m-pictex.mkiv
@@ -11,7 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Just in case someone still uses \PICTEX:
+%D Just in case someone still uses \PICTEX\ we provide a loader. However, because it
+%D expect some plain helpers to be present (like \type {\newhelp} and because it
+%D defined some already used dimensions, we'd either need to adapt or add some
+%D push|/|pop here. Because \CONTEXT\ users have \METAPOST\ support we no longer
+%D support \PICTEX\ in \LMTX.
+
+\ifcase\contextlmtxmode \else
+ \writestatus{modules}{the PicTeX graphic system is not supported in LMTX}
+ \expandafter \endinput
+\fi
\ifdefined\beginpicture \else
diff --git a/tex/context/modules/mkiv/m-pstricks.mkiv b/tex/context/modules/mkiv/m-pstricks.mkiv
index 421607aaf..c3c6f769b 100644
--- a/tex/context/modules/mkiv/m-pstricks.mkiv
+++ b/tex/context/modules/mkiv/m-pstricks.mkiv
@@ -11,6 +11,17 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D We don't support \PSTRICKS\ in \LMTX. In \MKIV\ it was already doen by calling
+%D \PDFTEX\ and going the \POSTSCRIPT\ route. We could actually support it sort of
+%D integrated if it were just graphics but I suppose fonts will make it a mess not
+%D worth the trouble. One can always use \MKII\ directly if needed to make graphics
+%D that get included as \PDF.
+
+\ifcase\contextlmtxmode \else
+ \writestatus{modules}{the PStricks graphic system is not supported in LMTX}
+ \expandafter \endinput
+\fi
+
\registerctxluafile{m-pstricks}{}
\unprotect
diff --git a/tex/context/modules/mkiv/m-tikz.mkiv b/tex/context/modules/mkiv/m-tikz.mkiv
index ed9cb914f..536ab554a 100644
--- a/tex/context/modules/mkiv/m-tikz.mkiv
+++ b/tex/context/modules/mkiv/m-tikz.mkiv
@@ -1,4 +1,19 @@
-%D A fixed variant if the t-tikz module distributed with tikz.
+%D \module
+%D [ file=m-tikz,
+%D version=2021.07.12,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=TIKZ support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D A fixed variant of the t-tikz module distributed with tikz. For
+%D practical reasons per 2021 we split the module for \MKIV\ and
+%D \LMTX. (Maybe some day I'll optimize TIKZ a bit.)
\ifdefined\pdflastxpos \else
\unprotect
@@ -7,70 +22,35 @@
\protect
\fi
+\pushcatcodetable
-\pushoverloadmode
+ \setcatcodetable\texcatcodes
- \pushcatcodetable
+ \catcode`\@=11
+ \catcode`\|=12
+ \catcode`\!=12
- \setcatcodetable\texcatcodes
+ \input t-pgf.tex
+ \input t-pgffor.tex
+ \input tikz.code.tex
- \catcode`\@=11
- \catcode`\|=12
- \catcode`\!=12
-
- \input t-pgf.tex
- \input t-pgffor.tex
- \input tikz.code.tex
-
- \popcatcodetable
-
-\popoverloadmode
+\popcatcodetable
\permanent\protected\def\tikzerrormessage#1#2#3%
{\writestatus{#1}{#2}}
-\ifcase\contextlmtxmode
-
- \let\starttikzsettings\relax
- \let\stoptikzsettings \relax
-
- \protected\def\starttikzpicture
- {% \dontleavehmode
- \begingroup
- \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
- \tikzpicture}
-
- \protected\def\stoptikzpicture
- {\endtikzpicture
- \endgroup}
+\let\starttikzsettings\relax
+\let\stoptikzsettings \relax
-\else
+\protected\def\starttikzpicture
+ {% \dontleavehmode
+ \begingroup
+ \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
+ \tikzpicture}
- % for now:
-
- \overloadmode\zerocount
-
- % but this will be mandate for settings outside the start .. stop
-
- \permanent\protected\def\starttikzsettings
- {\pushoverloadmode}
-
- \permanent\protected\def\stoptikzsettings
- {\popoverloadmode}
-
- \permanent\protected\def\starttikzpicture
- {\dontleavehmode
- \hcontainer\bgroup
- % \pushoverloadmode
- \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
- \tikzpicture}
-
- \permanent\protected\def\stoptikzpicture
- {\endtikzpicture
- % \popoverloadmode
- \egroup}
-
-\fi
+\protected\def\stoptikzpicture
+ {\endtikzpicture
+ \endgroup}
% \input t-pgf.tex
diff --git a/tex/context/modules/mkiv/m-zint.mkiv b/tex/context/modules/mkiv/m-zint.mkiv
index 4957c8461..7fe9f761c 100644
--- a/tex/context/modules/mkiv/m-zint.mkiv
+++ b/tex/context/modules/mkiv/m-zint.mkiv
@@ -11,16 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Using \type {zint} seems to be the easiest way to generate
-%D (PDF417) barcodes so therefore we now have this module. There
-%D are proper (also windows) binaries at:
+%D Using \type {zint} seems to be the easiest way to generate (PDF417) barcodes so
+%D therefore we now have this module. There are proper (also windows) binaries at:
%D
%D \starttyping
%D http://www.zint.org.uk
%D \stoptyping
%D
-%D There is a bit more code than needed as we want to be able to
-%D feed names.
+%D There is a bit more code than needed as we want to be able to feed names.
\startluacode
diff --git a/tex/context/modules/mkxl/m-barcodes.mkxl b/tex/context/modules/mkxl/m-barcodes.mkxl
new file mode 100644
index 000000000..43540e457
--- /dev/null
+++ b/tex/context/modules/mkxl/m-barcodes.mkxl
@@ -0,0 +1,40 @@
+%D \module
+%D [ file=m-barcodes,
+%D version=2010.03.14,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Barcodes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{barcodes}{the 'zint' module is a better choice}
+
+\usemodule[zint]
+
+\unprotect
+
+\pushoverloadmode
+
+\let\normalbarcode\barcode
+
+\permanent\protected\def\barcode[#1]%
+ {\normalbarcode[\c!text=\dummyparameter{code},\c!alternative=\dummyparameter{type},#1]}
+
+\popoverloadmode
+
+\protect
+
+\continueifinputfile{m-barcodes.mkxl}
+
+\starttext
+ \startTEXpage
+ \barcode[type=isbn,text=978-9490688011]
+ \blank
+ \barcode[type=isbn,text=9780500518724]
+ \stopTEXpage
+\stoptext
+
diff --git a/tex/context/modules/mkiv/m-gnuplot.mkxl b/tex/context/modules/mkxl/m-gnuplot.mkxl
index e844edd1b..e844edd1b 100644
--- a/tex/context/modules/mkiv/m-gnuplot.mkxl
+++ b/tex/context/modules/mkxl/m-gnuplot.mkxl
diff --git a/tex/context/modules/mkxl/m-tikz.mkxl b/tex/context/modules/mkxl/m-tikz.mkxl
new file mode 100644
index 000000000..5b1f6e76c
--- /dev/null
+++ b/tex/context/modules/mkxl/m-tikz.mkxl
@@ -0,0 +1,112 @@
+%D \module
+%D [ file=m-tikz,
+%D version=2021.07.12,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=TIKZ support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D A fixed variant of the t-tikz module distributed with tikz. For
+%D practical reasons per 2021 we split the module for \MKIV\ and
+%D \LMTX. (Maybe some day I'll optimize TIKZ a bit.)
+
+\ifdefined\pdflastxpos \else
+ \unprotect
+ \frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}
+ \frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
+ \protect
+\fi
+
+
+\pushoverloadmode
+
+ \pushcatcodetable
+
+ \setcatcodetable\texcatcodes
+
+ \catcode`\@=11
+ \catcode`\|=12
+ \catcode`\!=12
+
+ \input t-pgf.tex
+ \input t-pgffor.tex
+ \input tikz.code.tex
+
+ \popcatcodetable
+
+\popoverloadmode
+
+\permanent\protected\def\tikzerrormessage#1#2#3%
+ {\writestatus{#1}{#2}}
+
+% For now we need this but we need to educate the user to wrap settings
+% in the wrappers. So some day the next line will go. I need to check what
+% commands are possible outside a picture.
+
+\overloadmode\zerocount
+
+\permanent\protected\def\starttikzsettings
+ {\pushoverloadmode}
+
+\permanent\protected\def\stoptikzsettings
+ {\popoverloadmode}
+
+\permanent\protected\def\starttikzpicture
+ {\dontleavehmode
+ \hcontainer\bgroup
+ % \pushoverloadmode
+ \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
+ \tikzpicture}
+
+\permanent\protected\def\stoptikzpicture
+ {\endtikzpicture
+ % \popoverloadmode
+ \egroup}
+
+% \input t-pgf.tex
+
+\ifx\pgfdefined\undefined
+
+ \let\pgfdefined\relax
+
+ % \input t-pgfcor.tex
+
+ \ifx\pgfcoredefined\undefined
+
+ \let\pgfcoredefined=\relax
+
+ \input t-pgfsys.tex
+
+ \edef\pgfcoreatcode {\the\catcode`\@}
+ \edef\pgfcorebarcode {\the\catcode`\|}
+ \edef\pgfcoreexclaimcode{\the\catcode`\!}
+
+ \catcode`\@=11
+ \catcode`\|=12
+ \catcode`\!=12
+
+ \input pgfcore.code.tex
+
+ \catcode`\@=\pgfcoreatcode
+ \catcode`\|=\pgfcorebarcode
+ \catcode`\!=\pgfcoreexclaimcode
+
+ \let\startpgfpicture \pgfpicture \let\stoppgfpicture \endpgfpicture
+ \let\startpgfscope \pgfscope \let\stoppgfscope \endpgfscope
+ \let\startpgflowlevelscope \pgflowlevelscope \let\stoppgflowlevelscope \endpgflowlevelscope
+ \let\startpgfinterruptpath \pgfinterruptpath \let\stoppgfinterruptpath \endpgfinterruptpath
+ \let\startpgfinterruptpicture \pgfinterruptpicture \let\stoppgfinterruptpicture \endpgfinterruptpicture
+ \let\startpgfinterruptboundingbox\pgfinterruptboundinbox \let\stoppgfinterruptboudingbox\endpgfinterruptboundingbox
+
+ \fi
+
+ \usepgfmodule[shapes,plot]
+
+\fi
+
+\stopmodule
diff --git a/tex/context/sample/common/spider.eps b/tex/context/sample/common/spider.eps
index ecaafb847..b9745ee22 100644
--- a/tex/context/sample/common/spider.eps
+++ b/tex/context/sample/common/spider.eps
@@ -1,11 +1,11 @@
%!PS-Adobe-2.0 EPSF-2.0
-%%BoundingBox: 250 352 362 440
+%%BoundingBox: 250 352 362 440
%%Creator: CorelDRAW!
%%Title: SPIN016.EPS
%%CreationDate: Thu Feb 16 13:27:54 1995
-%%DocumentFonts:
-%%DocumentProcessColors: Magenta Yellow Black
+%%DocumentFonts:
+%%DocumentProcessColors: Magenta Yellow Black
%%EndComments
%%BeginProlog
/AutoFlatness false def
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 4b3932b1e..85fbc6b48 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2021-07-10 21:47
+-- merge date : 2021-07-16 21:58
do -- begin closure to overcome local limits and interference