summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
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/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/math-noa.lua8
-rw-r--r--tex/context/base/mkiv/mult-prm.lua16
-rw-r--r--tex/context/base/mkiv/node-met.lua73
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23943 -> 23940 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin229651 -> 229594 bytes
-rw-r--r--tex/context/base/mkxl/back-pdf.lmt9
-rw-r--r--tex/context/base/mkxl/back-pdf.mkxl7
-rw-r--r--tex/context/base/mkxl/back-pdp.lmt64
-rw-r--r--tex/context/base/mkxl/cont-fil.mkxl5
-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/font-ogr.lmt152
-rw-r--r--tex/context/base/mkxl/libs-imp-zint.lmt64
-rw-r--r--tex/context/base/mkxl/libs-imp-zint.mkxl17
-rw-r--r--tex/context/base/mkxl/lpdf-ano.lmt26
-rw-r--r--tex/context/base/mkxl/lpdf-col.lmt31
-rw-r--r--tex/context/base/mkxl/lpdf-emb.lmt90
-rw-r--r--tex/context/base/mkxl/lpdf-epa.lmt11
-rw-r--r--tex/context/base/mkxl/lpdf-fld.lmt23
-rw-r--r--tex/context/base/mkxl/lpdf-fmt.lmt6
-rw-r--r--tex/context/base/mkxl/lpdf-fnt.lmt7
-rw-r--r--tex/context/base/mkxl/lpdf-grp.lmt7
-rw-r--r--tex/context/base/mkxl/lpdf-img.lmt13
-rw-r--r--tex/context/base/mkxl/lpdf-ini.lmt12
-rw-r--r--tex/context/base/mkxl/lpdf-lmt.lmt119
-rw-r--r--tex/context/base/mkxl/lpdf-mis.lmt15
-rw-r--r--tex/context/base/mkxl/lpdf-pde.lmt17
-rw-r--r--tex/context/base/mkxl/lpdf-ren.lmt11
-rw-r--r--tex/context/base/mkxl/lpdf-rul.lmt8
-rw-r--r--tex/context/base/mkxl/lpdf-tag.lmt22
-rw-r--r--tex/context/base/mkxl/lpdf-u3d.lmt10
-rw-r--r--tex/context/base/mkxl/lpdf-wid.lmt37
-rw-r--r--tex/context/base/mkxl/lpdf-xmp.lmt8
-rw-r--r--tex/context/base/mkxl/math-map.lmt2
-rw-r--r--tex/context/base/mkxl/math-noa.lmt34
-rw-r--r--tex/context/base/mkxl/node-met.lmt53
-rw-r--r--tex/context/base/mkxl/page-ffl.mkxl2
-rw-r--r--tex/context/base/mkxl/page-ini.mkxl2
-rw-r--r--tex/context/base/mkxl/page-ins.mkxl8
-rw-r--r--tex/context/base/mkxl/page-one.mkxl6
-rw-r--r--tex/context/base/mkxl/page-pcl.mkxl2
-rw-r--r--tex/context/base/mkxl/toks-aux.lmt16
-rw-r--r--tex/context/fonts/mkiv/type-imp-koeielettersot.mkiv20
-rw-r--r--tex/context/modules/mkiv/m-zint.mkiv112
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
49 files changed, 527 insertions, 632 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index f2a0b51c1..84c5862ab 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.05.26 09:57}
+\newcontextversion{2021.05.27 14:12}
%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 991288c27..f84ac0910 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.05.26 09:57}
+\edef\contextversion{2021.05.27 14:12}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index aac21a01b..98a99ad06 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.05.26 09:57}
+\newcontextversion{2021.05.27 14:12}
%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 68cb51afe..f6324f7f0 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.05.26 09:57}
+\edef\contextversion{2021.05.27 14:12}
%D Kind of special:
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 309642747..0a5ee4aeb 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -55,7 +55,7 @@ local trace_processing = false registertracker("math.processing", function(v
local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end)
local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end)
local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end)
-local trace_fixing = false registertracker("math.fixing", function(v) trace_foxing = v end)
+local trace_fixing = false registertracker("math.fixing", function(v) trace_fixing = v end)
local trace_patching = false registertracker("math.patching", function(v) trace_patching = v end)
local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end)
local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end)
@@ -1930,8 +1930,6 @@ do
mathematics.virtualize(movesub)
- local options_supported = tokens.defined("Unosuperscript")
-
local function fixsupscript(parent,current,current_char,new_char)
if new_char ~= current_char and new_char ~= true then
setchar(current,new_char)
@@ -1943,9 +1941,7 @@ do
report_fixing("fixing subscript, superscript %U",current_char)
end
end
- if options_supported then
- setfield(parent,"options",0x08+0x22)
- end
+ setfield(parent,"options",0x08+0x22)
end
-- local function movesubscript(parent,current_nucleus,oldchar,newchar)
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 710934ae6..e7eb8dde4 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -356,6 +356,7 @@ return {
"ifhastoks",
"ifhasxtoks",
"ifincsname",
+ "ifinsert",
"ifmathparameter",
"ifmathstyle",
"ifnumval",
@@ -368,8 +369,19 @@ return {
"immediate",
"immutable",
"initcatcodetable",
+ "insertbox",
+ "insertcopy",
+ "insertdepth",
+ "insertdistance",
+ "insertheight",
"insertheights",
- "insertht",
+ "insertlimit",
+ "insertmode",
+ "insertmultiplier",
+ "insertprogress",
+ "insertunbox",
+ "insertuncopy",
+ "insertwidth",
"instance",
"integerdef",
"lastarguments",
@@ -382,7 +394,6 @@ return {
"letprotected",
"linedirection",
"linepar",
- "listcallbackmode",
"localbrokenpenalty",
"localcontrol",
"localcontrolled",
@@ -457,6 +468,7 @@ return {
"swapcsvalues",
"textdirection",
"thewithoutunit",
+ "thewithproperty",
"tokenized",
"toksapp",
"tokspre",
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index c39c9dd86..45639b5ba 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -558,76 +558,3 @@ metatable.__unm = function(head)
n_setnext(last)
return first
end
-
--- see node-nut.lua for more info on going nuts
-
--- if not gonuts then
---
--- local nuts = { }
--- nodes.nuts = nuts
---
--- local function dummy(f) return f end
---
--- nodes.vianuts = dummy
--- nodes.vianodes = dummy
---
--- for k, v in next, nodes do
--- if type(v) == "function" then
--- nuts[k] = v
--- end
--- end
---
--- end
-
--- also handy
-
-local tonode = nodes.tonode
-local whatsit_code = nodecodes.whatsit
-local getfields = node.fields
-local sort = table.sort
-local whatsitkeys = { }
-local keys = { whatsit = whatsitkeys }
-local messyhack = table.tohash { -- temporary solution
- nodecodes.attributelist,
- nodecodes.attribute,
- nodecodes.action, -- hm
-}
-
-setmetatableindex(keys,function(t,k)
- local v = (k == "attributelist" or k == nodecodes.attributelist) and { } or getfields(k)
- if messyhack[k] then
- for i=1,#v do
- if v[i] == "subtype" then
- remove(v,i)
- break
- end
- end
- end
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-setmetatableindex(whatsitkeys,function(t,k)
- local v = getfields(whatsit_code,k)
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-local function nodefields(n)
- n = tonode(n)
- local id = n.id
- if id == whatsit_code then
- return whatsitkeys[n.subtype]
- else
- return keys[id]
- end
-end
-
-nodes.keys = keys -- [id][subtype]
-nodes.fields = nodefields -- (n)
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 965fc11ee..bfff547ae 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 f7532b9ac..7180e25c2 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/back-pdf.lmt b/tex/context/base/mkxl/back-pdf.lmt
index 44d0230bd..fa564a195 100644
--- a/tex/context/base/mkxl/back-pdf.lmt
+++ b/tex/context/base/mkxl/back-pdf.lmt
@@ -12,13 +12,8 @@ if not modules then modules = { } end modules ['back-pdf'] = {
local setmetatableindex = table.setmetatableindex
-local pdfsetcompression
-local pdfimmediateobject
-
-updaters.register("backend.update.lpdf",function()
- pdfsetcompression = lpdf.setcompression
- pdfimmediateobject = lpdf.immediateobject
-end)
+local pdfsetcompression = lpdf.setcompression
+local pdfimmediateobject = lpdf.immediateobject
interfaces.implement {
name = "setpdfcompression",
diff --git a/tex/context/base/mkxl/back-pdf.mkxl b/tex/context/base/mkxl/back-pdf.mkxl
index baa90ff22..4ec1501a5 100644
--- a/tex/context/base/mkxl/back-pdf.mkxl
+++ b/tex/context/base/mkxl/back-pdf.mkxl
@@ -15,6 +15,13 @@
%D {\pdf*} ones completely. For the moment I keep them commented but even that will
%D go away.
+%D Todo: a few delayed binding left:
+
+% ./lpdf-ini.lmt : reserve | immediate | positions | matrix | pos | fontobject
+% ./lpdf-lmt.lmt : fontname | object | boxresources
+% ./lpdf-rul.lmt : mp stuff
+% ./back-res.lmt : boxresources
+
\writestatus{loading}{ConTeXt Backend Macros / PDF}
\registerctxluafile{lpdf-ini}{autosuffix}
diff --git a/tex/context/base/mkxl/back-pdp.lmt b/tex/context/base/mkxl/back-pdp.lmt
index 1b3a17007..76a6f4b67 100644
--- a/tex/context/base/mkxl/back-pdp.lmt
+++ b/tex/context/base/mkxl/back-pdp.lmt
@@ -12,43 +12,33 @@ if not modules then modules = { } end modules ['back-pdp'] = {
local context = context
local lpdf = lpdf
-local pdfreserveobject
-local pdfcompresslevel
-local pdfobject
-local pdfpagereference
-local pdfgetxformname
-local pdfminorversion
-local pdfmajorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfcompresslevel = lpdf.compresslevel
- pdfobject = lpdf.object
- pdfpagereference = lpdf.pagereference
- pdfgetxformname = lpdf.getxformname
- pdfminorversion = lpdf.minorversion
- pdfmajorversion = lpdf.majorversion
-end)
-
-local tokenscanners = tokens.scanners
-local scanword = tokenscanners.word
-local scankeyword = tokenscanners.keyword
-local scanstring = tokenscanners.string
-local scaninteger = tokenscanners.integer
-local scanwhd = tokenscanners.whd
-
-local trace = false trackers.register("backend", function(v) trace = v end)
-local report = logs.reporter("backend")
-
-local nodepool = nodes.pool
-local newliteral = nodepool.literal
-local newsave = nodepool.save
-local newrestore = nodepool.restore
-local newsetmatrix = nodepool.setmatrix
-
-local implement = interfaces.implement
-local constants = interfaces.constants
-local variables = interfaces.variables
+local pdfreserveobject = lpdf.reserveobject
+local pdfcompresslevel = lpdf.compresslevel
+local pdfobject = lpdf.object
+local pdfpagereference = lpdf.pagereference
+local pdfgetxformname = lpdf.getxformname
+local pdfminorversion = lpdf.minorversion
+local pdfmajorversion = lpdf.majorversion
+
+local tokenscanners = tokens.scanners
+local scanword = tokenscanners.word
+local scankeyword = tokenscanners.keyword
+local scanstring = tokenscanners.string
+local scaninteger = tokenscanners.integer
+local scanwhd = tokenscanners.whd
+
+local trace = false trackers.register("backend", function(v) trace = v end)
+local report = logs.reporter("backend")
+
+local nodepool = nodes.pool
+local newliteral = nodepool.literal
+local newsave = nodepool.save
+local newrestore = nodepool.restore
+local newsetmatrix = nodepool.setmatrix
+
+local implement = interfaces.implement
+local constants = interfaces.constants
+local variables = interfaces.variables
-- literals
diff --git a/tex/context/base/mkxl/cont-fil.mkxl b/tex/context/base/mkxl/cont-fil.mkxl
index 0ca3bb05a..57bfd2794 100644
--- a/tex/context/base/mkxl/cont-fil.mkxl
+++ b/tex/context/base/mkxl/cont-fil.mkxl
@@ -146,7 +146,8 @@
%definefilesynonym [set-13] [setups-proofing]
%definefilesynonym [set-15] [setups-generate]
-\definefilesynonym [ecmascript] [libs-imp-mujs]
-\definefilesynonym [zint] [libs-imp-zint]
+\definefilesynonym [ecmascript] [libs-imp-mujs]
+\definefilesynonym [zint] [libs-imp-zint]
+\definefilesynonym [barcode] [libs-imp-zint]
\endinput
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 73a869560..31dac9413 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.05.26 09:57}
+\newcontextversion{2021.05.27 14:12}
%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 ff9142c68..6a327faf1 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.05.26 09:57}
+\immutable\edef\contextversion{2021.05.27 14:12}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/font-ogr.lmt b/tex/context/base/mkxl/font-ogr.lmt
index 698593ac7..1f930c78d 100644
--- a/tex/context/base/mkxl/font-ogr.lmt
+++ b/tex/context/base/mkxl/font-ogr.lmt
@@ -474,7 +474,7 @@ do -- this will move to its own module
end
--- This sits here for historcal reasons so for now we keep it here.
+-- This sits here for historical reasons so for now we keep it here.
local startactualtext = nil
local stopactualtext = nil
@@ -487,20 +487,8 @@ function otf.getactualtext(s)
return startactualtext(s), stopactualtext()
end
--- This is also somewhat specific.
-
-local color_direct = function() return false end
-local color_indirect = color_direct
-
-updaters.register("backend.update",function()
- color_direct = lpdf.fonts.color_direct
- color_indirect = lpdf.fonts.color_indirect
-end)
-
local sharedpalettes = { } do
- local register = attributes.colors.register
-
local colors = attributes.list[attributes.private('color')] or { }
local transparencies = attributes.list[attributes.private('transparency')] or { }
@@ -510,20 +498,10 @@ local sharedpalettes = { } do
local v = values[i]
if v == "textcolor" then
values[i] = false
- else
- local c = nil
- local t = nil
- if type(v) == "table" then
- c = register(name,"rgb",
- max(round((v.r or 0)*255),255)/255,
- max(round((v.g or 0)*255),255)/255,
- max(round((v.b or 0)*255),255)/255
- )
- else
- c = colors[v]
- t = transparencies[v]
- end
- values[i] = color_indirect(c,t)
+ elseif type(v) == "table" then
+ values[i] = { kind = "values", data = v }
+ else -- freezing
+ values[i] = { kind = "attributes", color = colors[v], transparency = transparencies[v] }
end
end
end
@@ -532,83 +510,73 @@ end
local initializeoverlay do
- local function autoconvert(t,k)
- local v = { }
- for i=1,#k do
- local p = k[i]
- v[i] = color_direct(p[1]/255, p[2]/255, p[3]/255)
- end
- t[k] = v
- return v
- end
-
initializeoverlay = function(tfmdata,kind,value) -- we really need the id ... todo
if value then
local resources = tfmdata.resources
local palettes = resources.colorpalettes
if palettes then
- --
- local converted = resources.converted
- if not converted then
- converted = setmetatableindex(autoconvert)
- resources.converted = converted
- end
- local colorvalues = sharedpalettes[value]
- local default = false -- so the text color (bad for icon overloads)
- if colorvalues then
- default = colorvalues[#colorvalues]
+ local colorvalues = false
+ local colordata = sharedpalettes[value]
+ if colordata and #colordata > 0 then
+ colorvalues = {
+ kind = "user",
+ data = colordata,
+ }
else
- colorvalues = converted[palettes[tonumber(value) or 1] or palettes[1]] or { }
- end
- local classes = #colorvalues
- if classes == 0 then
- return
+ colordata = palettes[tonumber(value) or 1] or palettes[1]
+ if colordata and #colordata > 0 then
+ colorvalues = {
+ kind = "font",
+ data = colordata,
+ }
+ end
end
- --
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
- local idx = 255
- local slot = 0
- --
- -- maybe delay in which case we have less fonts as we can be sparse
- --
- for k, v in next, characters do
- local index = v.index
- if index then
- local description = descriptions[k]
- if description then
- local colorlist = description.colors
- if colorlist then
- if idx >= 255 then
- idx = 1
- colrshapes = { }
- slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues)
- dropchars = tfmdrop.characters
- dropdescs = tfmdrop.descriptions
- else
- idx = idx + 1
- end
- --
- colrshapes[idx] = description
- -- todo: use extender
- local u = { "use", 0 }
- for i=1,#colorlist do
- u[i+2] = colorlist[i].slot
+ if colorvalues then
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
+ local idx = 255
+ local slot = 0
+ --
+ -- maybe delay in which case we have less fonts as we can be sparse
+ --
+ for k, v in next, characters do
+ local index = v.index
+ if index then
+ local description = descriptions[k]
+ if description then
+ local colorlist = description.colors
+ if colorlist then
+ if idx >= 255 then
+ idx = 1
+ colrshapes = { }
+ slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues)
+ dropchars = tfmdrop.characters
+ dropdescs = tfmdrop.descriptions
+ else
+ idx = idx + 1
+ end
+ --
+ colrshapes[idx] = description
+ -- todo: use extender
+ local u = { "use", 0 }
+ for i=1,#colorlist do
+ u[i+2] = colorlist[i].slot
+ end
+ v.commands = { u, { "slot", slot, idx } }
+ -- hack to prevent that type 3 also gets 'use' flags .. todo
+ local c = { commands = false, index = idx, dropin = tfmdata }
+ local d = { } -- index = idx, dropin = tfmdrop
+ setmetatableindex(c,v)
+ setmetatableindex(d,description)
+ dropchars[idx] = c
+ dropdescs[idx] = d -- not needed
end
- v.commands = { u, { "slot", slot, idx } }
- -- hack to prevent that type 3 also gets 'use' flags .. todo
- local c = { commands = false, index = idx, dropin = tfmdata }
- local d = { } -- index = idx, dropin = tfmdrop
- setmetatableindex(c,v)
- setmetatableindex(d,description)
- dropchars[idx] = c
- dropdescs[idx] = d -- not needed
end
end
end
+ return true
end
- return true
end
end
end
diff --git a/tex/context/base/mkxl/libs-imp-zint.lmt b/tex/context/base/mkxl/libs-imp-zint.lmt
index 2c346ae7d..a3ac97584 100644
--- a/tex/context/base/mkxl/libs-imp-zint.lmt
+++ b/tex/context/base/mkxl/libs-imp-zint.lmt
@@ -28,8 +28,9 @@ utilities.zint = zint
local zintlib_execute = zintlib.execute
-local next, type, unpack = next, type, unpack
+local next, type, unpack, rawget = next, type, unpack, rawget
local lower, gsub = string.lower, string.gsub
+local formatters = string.formatters
local mapping = {
["code 11"] = 1, ["pharma one-track"] = 51, ["aztec code"] = 92,
@@ -65,6 +66,12 @@ local mapping = {
["logmars"] = 50, ["kix code"] = 90, ["rmqr"] = 145,
}
+for k, v in table.sortedhash(mapping) do
+ mapping[gsub(lower(k),"[^a-z0-9]","")]= v
+end
+
+mapping.qr = mapping.qrcode
+
table.setmetatableindex(mapping,function(t,k)
local s = gsub(lower(k),"[^a-z0-9]","")
local v = rawget(t,s) or false
@@ -76,7 +83,22 @@ local report = logs.reporter("zint")
local context = context
local shown = false
------ f_rectangle = string.formatters["%sofill unitsquare xysized (%N,%N) shifted (%N,%N);"]
+-- Same performance as just context(fmt,...): 113pps (On 2013 i7 laptop.)
+
+----- f_rectangle = formatters["%sofill unitsquare xysized (%N,%N) shifted (%N,%N);"]
+local f_hexagon = formatters["%sofill (%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle;"]
+local f_circle = formatters["%sofill unitcircle scaled %N shifted (%N,%N);"]
+local f_string = formatters['draw textext("%s") scaled (%N/10) shifted (%N,%N);']
+
+-- A bit faster: 130pps (When I see hexagons I'll do that too but MP takes way more time.)
+
+local s_preamble = [[
+ save ns; def ns (expr a, b) = nofill unitsquare xyscaled a shifted b ; enddef;
+ save ds; def ds (expr a, b) = dofill unitsquare xyscaled a shifted b ; enddef;
+]]
+
+----- f_rectangle = formatters["%ss((%N,%N),(%N,%N));"]
+local f_rectangle = formatters["%ss((%i,%i),(%i,%i));"]
local function execute(specification)
if okay() then
@@ -90,6 +112,7 @@ local function execute(specification)
if result then
-- not that fast but if needed we can speed it up
context.startMPcode()
+ context(s_preamble)
local rectangles = result.rectangles
local hexagons = result.hexagons
local circles = result.circles
@@ -98,34 +121,45 @@ local function execute(specification)
local n = #rectangles
for i=1,n do
local r = rectangles[i]
- context("%sofill unitsquare xysized (%N,%N) shifted (%N,%N);",
- i == n and "d" or "n",r[3],r[4],r[1],r[2])
- -- rectangles[i] = f_rectangle(i == n and "d" or "n",r[3],r[4],r[1],r[2])
+ -- context("%sofill unitsquare xysized (%N,%N) shifted (%N,%N);",
+ rectangles[i] = f_rectangle(
+ i == n and "d" or "n",r[3],r[4],r[1],r[2]
+ )
end
- -- context("% t",rectangles)
+ context("% t",rectangles)
end
if hexagons then
local n = #hexagons
- for i=1,#hexagons do
- context("%sofill (%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle;",
- i == n and "d" or "n",unpack(hexagons[i]))
+ for i=1,n do
+ -- context("%sofill (%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle;",
+ hexagons[i] = f_hexagon(
+ i == n and "d" or "n",unpack(hexagons[i])
+ )
end
+ context("% t",hexagons)
end
if circles then
local n = #circles
- for i=1,#circles do
+ for i=1,n do
local c = circles[i]
- context("%sofill unitcircle scaled %N shifted (%N,%N);",
- i == n and "d" or "n",c[3],c[1],c[2])
+ -- context("%sofill unitcircle scaled %N shifted (%N,%N);",
+ circles[i] = f_circle(
+ i == n and "d" or "n",c[3],c[1],c[2]
+ )
end
+ context("% t",circles)
end
if strings then
-- We set the font at the encapsulating level.
- for i=1,#strings do
+ local n = #strings
+ for i=1,n do
local s = strings[i]
- context('draw textext("%s") scaled (%N/10) shifted (%N,%N);',
- s[4],s[3],s[1],s[2])
+ -- context('draw textext("%s") scaled (%N/10) shifted (%N,%N);',
+ strings[i] = f_string(
+ s[4],s[3],s[1],s[2]
+ )
end
+ context("% t",strings)
end
context.stopMPcode()
end
diff --git a/tex/context/base/mkxl/libs-imp-zint.mkxl b/tex/context/base/mkxl/libs-imp-zint.mkxl
index b2adf05ad..51b72c68a 100644
--- a/tex/context/base/mkxl/libs-imp-zint.mkxl
+++ b/tex/context/base/mkxl/libs-imp-zint.mkxl
@@ -11,16 +11,16 @@
%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.
+%D
+%D % e:\tex-context\tex\texmf-win64\bin\lib\luametatex\zint\libzint.dll
\registerctxluafile{libs-imp-zint}{autosuffix}
@@ -38,7 +38,7 @@
{\clf_zint
code {\dummyparameter\c!alternative}
text {\dummyparameter\c!text}
- \relax}
+ \relax}%
\egroup}
\protect
@@ -56,6 +56,11 @@
\barcode[alternative=ISBN,text=9789490688011]%
\blank
\barcode[alternative=isbn,text=9789490688011,width=3cm]%
+ \blank
+ \dontleavehmode
+ \barcode[alternative=qr code,text={This is ConTeXt MKIV}]
+ \barcode[alternative=qr code,text={This is ConTeXt LMTX}]
+ \barcode[alternative=qr code,text={\cldloadfile{tufte}},width=3cm]
\stopTEXpage
% }
diff --git a/tex/context/base/mkxl/lpdf-ano.lmt b/tex/context/base/mkxl/lpdf-ano.lmt
index 86bcd4ad5..5498627b8 100644
--- a/tex/context/base/mkxl/lpdf-ano.lmt
+++ b/tex/context/base/mkxl/lpdf-ano.lmt
@@ -85,21 +85,15 @@ local pdfaddtonames = lpdf.addtonames
local pdfaddtopageattributes = lpdf.addtopageattributes
local pdfrectangle = lpdf.rectangle
-local pdfflushobject
-local pdfshareobjectreference
-local pdfreserveobject
-local pdfpagereference
-local pdfdelayedobject
-local pdfregisterannotation
+local pdfflushobject = lpdf.flushobject
+local pdfshareobjectreference = lpdf.shareobjectreference
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfdelayedobject = lpdf.delayedobject
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfshareobjectreference = lpdf.shareobjectreference
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfdelayedobject = lpdf.delayedobject
- pdfregisterannotation = lpdf.registerannotation
-end)
+-- defined later on:
+
+local pdfregisterannotation
-- todo: 3dview
@@ -868,7 +862,7 @@ end
local annotations = nil
-function lpdf.registerannotation(n)
+pdfregisterannotation = function(n)
if annotations then
annotations[#annotations+1] = pdfreference(n)
else
@@ -876,7 +870,7 @@ function lpdf.registerannotation(n)
end
end
-pdfregisterannotation = lpdf.registerannotation
+lpdf.registerannotation = pdfregisterannotation
function lpdf.annotationspecification()
if annotations then
diff --git a/tex/context/base/mkxl/lpdf-col.lmt b/tex/context/base/mkxl/lpdf-col.lmt
index ea60e0551..e76471b89 100644
--- a/tex/context/base/mkxl/lpdf-col.lmt
+++ b/tex/context/base/mkxl/lpdf-col.lmt
@@ -31,17 +31,22 @@ local pdfarray = lpdf.array
local pdfreference = lpdf.reference
local pdfverbose = lpdf.verbose
-local pdfflushobject
-local pdfdelayedobject
-local pdfflushstreamobject
-local pdfshareobjectreference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfdelayedobject = lpdf.delayedobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfshareobjectreference = lpdf.shareobjectreference
-end)
+local pdfflushobject = lpdf.flushobject
+local pdfdelayedobject = lpdf.delayedobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfshareobjectreference = lpdf.shareobjectreference
+
+-- local pdfflushobject
+-- local pdfdelayedobject
+-- local pdfflushstreamobject
+-- local pdfshareobjectreference
+--
+-- updaters.register("backend.update.lpdf",function()
+-- pdfflushobject = lpdf.flushobject
+-- pdfdelayedobject = lpdf.delayedobject
+-- pdfflushstreamobject = lpdf.flushstreamobject
+-- pdfshareobjectreference = lpdf.shareobjectreference
+-- end)
local addtopageattributes = lpdf.addtopageattributes
local adddocumentcolorspace = lpdf.adddocumentcolorspace
@@ -818,8 +823,8 @@ do
local colors = attributes.colors
local rgbtocmyk = colors.rgbtocmyk
- local f_cmyk = formatters["%.3N %.3f %.3N %.3N k"]
- local f_rgb = formatters["%.3N %.3f %.3N rg"]
+ local f_cmyk = formatters["%.3N %.3N %.3N %.3N k"]
+ local f_rgb = formatters["%.3N %.3N %.3N rg"]
local f_gray = formatters["%.3N g"]
fonts.color_direct = function(r,g,b)
diff --git a/tex/context/base/mkxl/lpdf-emb.lmt b/tex/context/base/mkxl/lpdf-emb.lmt
index bfbbf118d..fa2cbe8cf 100644
--- a/tex/context/base/mkxl/lpdf-emb.lmt
+++ b/tex/context/base/mkxl/lpdf-emb.lmt
@@ -47,15 +47,19 @@ local pdfconstant = lpdf.constant
local pdfstring = lpdf.string
local pdfreference = lpdf.reference
-local pdfreserveobject
-local pdfflushobject
-local pdfflushstreamobject
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
-end)
+local pdfreserveobject = lpdf.reserveobject
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+
+-- local pdfreserveobject
+-- local pdfflushobject
+-- local pdfflushstreamobject
+--
+-- updaters.register("backend.update.lpdf",function()
+-- pdfreserveobject = lpdf.reserveobject
+-- pdfflushobject = lpdf.flushobject
+-- pdfflushstreamobject = lpdf.flushstreamobject
+-- end)
local report_fonts = logs.reporter("backend","fonts")
@@ -1793,6 +1797,39 @@ do
end
end
+ local function registercolors(hash)
+ local kind = hash.kind
+ local data = hash.data
+ local direct = lpdf.fonts.color_direct
+ local indirect = lpdf.fonts.color_indirect
+ if kind == "font" then
+ return setmetatableindex(function(t,k)
+ local h = data[k]
+ local v = direct(h[1]/255,h[2]/255,h[3]/255)
+ t[k] = v
+ return v
+ end)
+ elseif kind == "user" then
+ return setmetatableindex(function(t,k)
+ local list = data[k]
+ local kind = list.kind
+ local v
+ if kind == "values" then
+ local d = list.data
+ v = direct(d.r or 0,d.g or 0,d.b or 0)
+ elseif kind == "attributes" then
+ v = indirect(list.color,list.transparency)
+ else
+ v = false -- textcolor
+ end
+ t[k] = v
+ return v
+ end)
+ else
+ return { }
+ end
+ end
+
function methods.color(filename,details)
local colrshapes = details.properties.indexdata[1]
local colrvalues = details.properties.indexdata[2]
@@ -1805,19 +1842,24 @@ do
local dropid = dropdata.properties.id
local dropunits = dropdata.parameters.units -- shared
local descriptions = dropdata.descriptions
+ local directcolors = registercolors(colrvalues)
usedfonts[dropid] = dropid
local w = description.width or 0
local s = #colorlist
- local l = nil
+ local l = false
local t = { f_width(w) }
local n = 1
- local d = colrvalues[#colrvalues]
+ local d = #colrvalues
for i=1,s do
local entry = colorlist[i]
- local v = colrvalues[entry.class] or d
- if v and l ~= v then
- n = n + 1 ; t[n] = v
- l = v
+ local class = entry.class or d
+ if class then
+ -- false is textcolor (we should actually go back)
+ local c = directcolors[class]
+ if c and l ~= c then
+ n = n + 1 ; t[n] = c
+ l = c
+ end
end
local e = descriptions[entry.slot]
if e then
@@ -2218,15 +2260,6 @@ end)
-- this is temporary
-function lpdf.setomitcidset(v)
- -- dummy: no longer needed
- includecidset = not toboolean(v)
-end
-
-function lpdf.setomitcharset(v)
- -- dummy
-end
-
function lpdf.getfontobjectnumber(k)
return objects[k]
end
@@ -2235,11 +2268,4 @@ function lpdf.getfontname(k)
return names[k]
end
--- local done = false -- todo:
-
--- updaters.register("backend.update",function()
--- if not done then
- lpdf.registerdocumentfinalizer(lpdf.flushfonts,1,"wrapping up fonts")
--- done = true
--- end
--- end)
+lpdf.registerdocumentfinalizer(lpdf.flushfonts,1,"wrapping up fonts")
diff --git a/tex/context/base/mkxl/lpdf-epa.lmt b/tex/context/base/mkxl/lpdf-epa.lmt
index 98f59e93e..a88e48a5e 100644
--- a/tex/context/base/mkxl/lpdf-epa.lmt
+++ b/tex/context/base/mkxl/lpdf-epa.lmt
@@ -41,15 +41,8 @@ local pdfarray = lpdf.array
local pdfdictionary = lpdf.dictionary
local pdfconstant = lpdf.constant
local pdfreference = lpdf.reference
-
-local pdfreserveobject
-local pdfgetpos
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfgetpos = lpdf.getpos
-end)
-
+local pdfreserveobject = lpdf.reserveobject
+local pdfgetpos = lpdf.getpos
local pdfcopyboolean = lpdf.copyboolean
local pdfcopyunicode = lpdf.copyunicode
local pdfcopyarray = lpdf.copyarray
diff --git a/tex/context/base/mkxl/lpdf-fld.lmt b/tex/context/base/mkxl/lpdf-fld.lmt
index 4c17a47fe..fd671b747 100644
--- a/tex/context/base/mkxl/lpdf-fld.lmt
+++ b/tex/context/base/mkxl/lpdf-fld.lmt
@@ -86,23 +86,12 @@ local pdfunicode = lpdf.unicode
local pdfstring = lpdf.string
local pdfconstant = lpdf.constant
local pdfaction = lpdf.action
-
-local pdfflushobject
-local pdfshareobjectreference
-local pdfshareobject
-local pdfreserveobject
-local pdfpagereference
-local pdfmajorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfshareobjectreference = lpdf.shareobjectreference
- pdfshareobject = lpdf.shareobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfmajorversion = lpdf.majorversion
-end)
-
+local pdfflushobject = lpdf.flushobject
+local pdfshareobjectreference = lpdf.shareobjectreference
+local pdfshareobject = lpdf.shareobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfmajorversion = lpdf.majorversion
local pdfcolor = lpdf.color
local pdfcolorvalues = lpdf.colorvalues
local pdflayerreference = lpdf.layerreference
diff --git a/tex/context/base/mkxl/lpdf-fmt.lmt b/tex/context/base/mkxl/lpdf-fmt.lmt
index c6a3f25ff..23534c518 100644
--- a/tex/context/base/mkxl/lpdf-fmt.lmt
+++ b/tex/context/base/mkxl/lpdf-fmt.lmt
@@ -903,12 +903,6 @@ function codeinjections.setformat(s)
majorversion,minorversion)
end
--
- -- cid sets can always omitted now, but those validators still complain so let's
- -- for a while keep it (for luigi):
- --
- lpdf.setomitcidset (formatspecification.include_cidsets == false and 1 or 0) -- why a number
- lpdf.setomitcharset(formatspecification.include_charsets == false and 1 or 0) -- why a number
- --
-- maybe block by pdf version
--
codeinjections.settaggingsupport(formatspecification.tagging)
diff --git a/tex/context/base/mkxl/lpdf-fnt.lmt b/tex/context/base/mkxl/lpdf-fnt.lmt
index ee16303b0..36f296105 100644
--- a/tex/context/base/mkxl/lpdf-fnt.lmt
+++ b/tex/context/base/mkxl/lpdf-fnt.lmt
@@ -13,12 +13,7 @@ local tonumber, rawget = tonumber, rawget
local pdfe = lpdf.epdf
local pdfreference = lpdf.reference
-
-local pdfreserveobject
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
-end)
+local pdfreserveobject = lpdf.reserveobject
local tobemerged = { }
local trace_merge = false trackers.register("graphics.fonts",function(v) trace_merge = v end)
diff --git a/tex/context/base/mkxl/lpdf-grp.lmt b/tex/context/base/mkxl/lpdf-grp.lmt
index 9040e1252..e5d04c5a9 100644
--- a/tex/context/base/mkxl/lpdf-grp.lmt
+++ b/tex/context/base/mkxl/lpdf-grp.lmt
@@ -27,12 +27,7 @@ local pdfarray = lpdf.array
local pdfconstant = lpdf.constant
local pdfboolean = lpdf.boolean
local pdfreference = lpdf.reference
-
-local pdfflushobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
-end)
+local pdfflushobject = lpdf.flushobject
local createimage = images.create
local wrapimage = images.wrap
diff --git a/tex/context/base/mkxl/lpdf-img.lmt b/tex/context/base/mkxl/lpdf-img.lmt
index 6914b2b29..f937f2ed4 100644
--- a/tex/context/base/mkxl/lpdf-img.lmt
+++ b/tex/context/base/mkxl/lpdf-img.lmt
@@ -55,16 +55,9 @@ local pdfconstant = lpdf.constant
local pdfstring = lpdf.string
local pdfreference = lpdf.reference
local pdfverbose = lpdf.verbose
-
-local pdfflushstreamobject
-local pdfmajorversion
-local pdfminorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfmajorversion = lpdf.majorversion
- pdfminorversion = lpdf.minorversion
-end)
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfmajorversion = lpdf.majorversion
+local pdfminorversion = lpdf.minorversion
local createimage = images.create
diff --git a/tex/context/base/mkxl/lpdf-ini.lmt b/tex/context/base/mkxl/lpdf-ini.lmt
index 9b4a2379c..f58727edf 100644
--- a/tex/context/base/mkxl/lpdf-ini.lmt
+++ b/tex/context/base/mkxl/lpdf-ini.lmt
@@ -117,6 +117,8 @@ end)
do
+ local pdfgetmatrix, pdfhasmatrix, pdfgetpos
+
updaters.register("backend.update.lpdf",function()
job.positions.registerhandlers {
getpos = drivers.getpos,
@@ -124,17 +126,13 @@ do
gethpos = drivers.gethpos,
getvpos = drivers.getvpos,
}
- lpdf.getpos = drivers.getpos
- end)
-
- local pdfgetmatrix, pdfhasmatrix, pdfgetpos
-
- updaters.register("backend.update.lpdf",function()
pdfgetmatrix = lpdf.getmatrix
pdfhasmatrix = lpdf.hasmatrix
- pdfgetpos = lpdf.getpos
+ pdfgetpos = drivers.getpos
end)
+ function lpdf.getpos() return pdfgetpos() end
+
-- local function transform(llx,lly,urx,ury,rx,sx,sy,ry)
-- local x1 = llx * rx + lly * sy
-- local y1 = llx * sx + lly * ry
diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt
index 036c64da9..ca7e70945 100644
--- a/tex/context/base/mkxl/lpdf-lmt.lmt
+++ b/tex/context/base/mkxl/lpdf-lmt.lmt
@@ -39,47 +39,38 @@ local concat, sortedhash = table.concat, table.sortedhash
local setmetatableindex = table.setmetatableindex
local loaddata = io.loaddata
-local bpfactor = number.dimenfactors.bp
+local bpfactor = number.dimenfactors.bp
-local osuuid = os.uuid
-local zlibcompress = xzip.compress
-local zlibcompresssize = xzip.compresssize
+local osuuid = os.uuid
+local zlibcompress = xzip.compress
+local zlibcompresssize = xzip.compresssize
-local nuts = nodes.nuts
-local tonut = nodes.tonut
+local nuts = nodes.nuts
+local tonut = nodes.tonut
-local pdfreference = lpdf.reference
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfliteral = lpdf.literal -- not to be confused with a whatsit!
+local pdfreference = lpdf.reference
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfconstant = lpdf.constant
+local pdfliteral = lpdf.literal -- not to be confused with a whatsit!
-local pdfreserveobject
-local pdfpagereference
-local pdfflushobject
-local pdfsharedobject
-local pdfflushstreamobject
-local pdfdeferredobject
-local pdfimmediateobject
+local pdfreserveobject -- forward reference
+local pdfpagereference -- forward reference
+local pdfgetpagereference -- forward reference
+local pdfsharedobject -- forward reference
+local pdfflushobject -- forward reference
+local pdfflushstreamobject -- forward reference
+local pdfdeferredobject -- forward reference
+local pdfimmediateobject -- forward reference
-local pdfgetfontname
-local pdfgetfontobjectnumber
+local pdfincludeimage -- forward reference
-local pdfgetpagereference
+local pdfgetfontname -- elsewhere
+local pdfgetfontobjectnumber -- elsewhere
updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfflushobject = lpdf.flushobject
- pdfsharedobject = lpdf.shareobjectreference
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfdeferredobject = lpdf.deferredobject
- pdfimmediateobject = lpdf.immediateobject
- --
pdfgetfontname = lpdf.getfontname
pdfgetfontobjectnumber = lpdf.getfontobjectnumber
- --
- pdfgetpagereference = lpdf.getpagereference -- move code so we don't need this
end)
local pdf_pages = pdfconstant("Pages")
@@ -1087,7 +1078,6 @@ local flushimage do
end
end
- -- updaters.register("backend.update.tex",function()
updaters.register("backend.update.lpdf",function()
tex.saveboxresource = saveboxresource
tex.useboxresource = useboxresource
@@ -1187,12 +1177,6 @@ local flushimage do
-- end of experiment
- local pdfincludeimage
-
- updaters.register("backend.update.lpdf",function()
- pdfincludeimage = lpdf.includeimage
- end)
-
local function flushpdfximage(current,pos_h,pos_v,pos_r,size_h,size_v)
local width,
@@ -2063,7 +2047,7 @@ do
local texgetcount = tex.getcount
- function lpdf.reserveobject(name)
+ pdfreserveobject = function(name)
nofobjects = nofobjects + 1
objects[nofobjects] = false
if name then
@@ -2077,22 +2061,7 @@ do
return nofobjects
end
- -- function lpdf.pagereference(n,complete) -- true | false | nil | n [true,false]
- -- if nofpages == 0 then
- -- nofpages = structures.pages.nofpages
- -- if nofpages == 0 then
- -- nofpages = 1
- -- end
- -- end
- -- if n == true or not n then
- -- complete = n
- -- n = texgetcount("realpageno")
- -- end
- -- local r = n > nofpages and pdfgetpagereference(nofpages) or pdfgetpagereference(n)
- -- return complete and pdfreference(r) or r
- -- end
-
- function lpdf.pagereference(n,complete) -- true | false | nil | n [true,false]
+ pdfpagereference = function(n,complete) -- true | false | nil | n [true,false]
if n == true or not n then
complete = n
n = texgetcount("realpageno")
@@ -2104,6 +2073,9 @@ do
return complete and pdfreference(r) or r
end
+ lpdf.reserveobject = pdfreserveobject
+ lpdf.pagereference = pdfpagereference
+
function lpdf.lastreferredpage()
return nofpages
end
@@ -2126,7 +2098,7 @@ do
return n
end
- function lpdf.flushobject(name,data)
+ pdfflushobject = function(name,data)
if data then
local named = names[name]
if named then
@@ -2154,7 +2126,7 @@ do
end
end
- function lpdf.flushstreamobject(data,dict,compressed,objnum) -- default compressed
+ pdfflushstreamobject = function(data,dict,compressed,objnum) -- default compressed
if trace_objects then
report_objects("flushing stream object of %s bytes",#data)
end
@@ -2208,7 +2180,7 @@ do
end
end
- function lpdf.shareobjectreference(content)
+ pdfsharedobject = function(content)
if content == nil then
-- invalid object not created
else
@@ -2227,6 +2199,11 @@ do
end
end
+ lpdf.flushobject = pdfflushobject
+ lpdf.flushstreamobject = pdfflushstreamobject
+ lpdf.shareobjectreference = pdfsharedobject
+ lpdf.sharedobject = pdfsharedobject
+
end
local pages = table.setmetatableindex(function(t,k)
@@ -2235,10 +2212,12 @@ local pages = table.setmetatableindex(function(t,k)
return v
end)
-function lpdf.getpagereference(n)
+pdfgetpagereference = function(n)
return pages[n]
end
+lpdf.getpagereference = pdfgetpagereference
+
local function flushnormalobj(data,n)
if not n then
nofobjects = nofobjects + 1
@@ -2345,7 +2324,7 @@ flushdeferred = function() -- was forward defined
end
end
-function lpdf.immediateobject(a,b,c,d)
+pdfimmediateobject = function(a,b,c,d)
local kind --, immediate
local objnum, data, attr, filename
local compresslevel, objcompression, nolength
@@ -2417,7 +2396,10 @@ function lpdf.immediateobject(a,b,c,d)
return objnum
end
-lpdf.deferredobject = lpdf.immediateobject
+pdfdeferredobject = pdfimmediateobject
+
+lpdf.deferredobject = pdfimmediateobject
+lpdf.immediateobject = pdfimmediateobject
-- In lua 5.4 the methods are now moved one metalevel deeper so we need to get them
-- from mt.__index instead. (I did get that at first.) It makes for a slightly (imo)
@@ -2713,7 +2695,7 @@ end
-- For the moment we overload it here, although back-fil.lua eventually will
-- be merged with back-pdf as it's pdf specific, or maybe back-imp-pdf or so.
-do -- updaters.register("backend.update.pdf",function()
+do
-- We overload img but at some point it will even go away, so we just
-- reimplement what we need in context. This will change completely i.e.
@@ -2834,7 +2816,7 @@ do -- updaters.register("backend.update.pdf",function()
return n
end
- function lpdf.includeimage(index)
+ pdfincludeimage = function(index)
local specification = indices[index]
if specification then
local bbox = specification.bbox
@@ -2856,9 +2838,11 @@ do -- updaters.register("backend.update.pdf",function()
end
end
+ lpdf.includeimage = pdfincludeimage
+
end -- )
-do -- updaters.register("backend.update.lpdf",function()
+do
-- todo: an md5 or sha2 hash can save space
-- todo: make a type 3 font instead
@@ -2870,7 +2854,6 @@ do -- updaters.register("backend.update.lpdf",function()
local closepdf
local copypage
-
updaters.register("backend.update.lpdf",function()
pdfimage = lpdf.epdf.image
newpdf = pdfimage.new
@@ -2979,13 +2962,7 @@ do
local function prepare(driver)
if not environment.initex then
- -- install new functions in pdf namespace
--- updaters.apply("backend.update.pdf")
- -- install new functions in lpdf namespace
updaters.apply("backend.update.lpdf")
- -- adapt existing shortcuts to lpdf namespace
--- updaters.apply("backend.update.tex")
--- -- adapt existing shortcuts to tex namespace
updaters.apply("backend.update")
--
pdfname = tex.jobname .. ".pdf"
diff --git a/tex/context/base/mkxl/lpdf-mis.lmt b/tex/context/base/mkxl/lpdf-mis.lmt
index afb149d8a..bd1d9990e 100644
--- a/tex/context/base/mkxl/lpdf-mis.lmt
+++ b/tex/context/base/mkxl/lpdf-mis.lmt
@@ -44,24 +44,15 @@ local pdfunicode = lpdf.unicode
local pdfverbose = lpdf.verbose
local pdfstring = lpdf.string
local pdfaction = lpdf.action
-
-local pdfflushobject
-local pdfflushstreamobject
-local pdfminorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfminorversion = lpdf.minorversion
-end)
-
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfminorversion = lpdf.minorversion
local formattedtimestamp = lpdf.pdftimestamp
local adddocumentextgstate = lpdf.adddocumentextgstate
local addtocatalog = lpdf.addtocatalog
local addtoinfo = lpdf.addtoinfo
local addtopageattributes = lpdf.addtopageattributes
local addtonames = lpdf.addtonames
-
local pdfgetmetadata = lpdf.getmetadata
local texset = tex.set
diff --git a/tex/context/base/mkxl/lpdf-pde.lmt b/tex/context/base/mkxl/lpdf-pde.lmt
index f8778f602..58f5723a3 100644
--- a/tex/context/base/mkxl/lpdf-pde.lmt
+++ b/tex/context/base/mkxl/lpdf-pde.lmt
@@ -80,12 +80,10 @@ local getversion = pdfe.getversion
local getbox = pdfe.getbox
local getstatus = pdfe.getstatus
local unencrypt = pdfe.unencrypt
-
local dictionarytotable = pdfe.dictionarytotable
local arraytotable = pdfe.arraytotable
local pagestotable = pdfe.pagestotable
local readwholestream = pdfe.readwholestream
-
local getfromreference = pdfe.getfromreference
local report_epdf = logs.reporter("epdf")
@@ -841,17 +839,10 @@ if images then do
local pdfnull = lpdf.null
local pdfliteral = lpdf.literal
- local pdfreserveobject
- local shareobjectreference
- local pdfflushobject
- local pdfflushstreamobject
-
- updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- shareobjectreference = lpdf.shareobjectreference
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- end)
+ local pdfreserveobject = lpdf.reserveobject
+ local shareobjectreference = lpdf.shareobjectreference
+ local pdfflushobject = lpdf.flushobject
+ local pdfflushstreamobject = lpdf.flushstreamobject
local report = logs.reporter("backend","xobjects")
diff --git a/tex/context/base/mkxl/lpdf-ren.lmt b/tex/context/base/mkxl/lpdf-ren.lmt
index 3794250d9..a50dcdc79 100644
--- a/tex/context/base/mkxl/lpdf-ren.lmt
+++ b/tex/context/base/mkxl/lpdf-ren.lmt
@@ -40,15 +40,8 @@ local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfreference = lpdf.reference
-
-local pdfflushobject
-local pdfreserveobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfreserveobject = lpdf.reserveobject
-end)
-
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
local addtopageattributes = lpdf.addtopageattributes
local addtopageresources = lpdf.addtopageresources
local addtocatalog = lpdf.addtocatalog
diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt
index efcc62073..baf4509ed 100644
--- a/tex/context/base/mkxl/lpdf-rul.lmt
+++ b/tex/context/base/mkxl/lpdf-rul.lmt
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['lpdf-rul'] = {
license = "see context related readme files"
}
+-- todo: split backend and pdf
+
local tonumber, next, type = tonumber, next, type
local concat = table.concat
@@ -35,8 +37,6 @@ local formatters = string.formatters
local pdfprint ; pdfprint = function(...) pdfprint = lpdf.print return pdfprint(...) end
--- updaters.register("backend.update",function() pdfprint = lpdf.print end)
-
do
local simplemetapost = metapost.simple
@@ -382,7 +382,3 @@ h %s]]
end
-
- ruleactions.mp = unsupported
-
-
diff --git a/tex/context/base/mkxl/lpdf-tag.lmt b/tex/context/base/mkxl/lpdf-tag.lmt
index 44a84ea59..e1bfcf955 100644
--- a/tex/context/base/mkxl/lpdf-tag.lmt
+++ b/tex/context/base/mkxl/lpdf-tag.lmt
@@ -39,15 +39,19 @@ local pdfmakenametree = lpdf.makenametree
local addtocatalog = lpdf.addtocatalog
local addtopageattributes = lpdf.addtopageattributes
-local pdfflushobject
-local pdfreserveobject
-local pdfpagereference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
-end)
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+
+-- local pdfflushobject
+-- local pdfreserveobject
+-- local pdfpagereference
+--
+-- updaters.register("backend.update.lpdf",function()
+-- pdfflushobject = lpdf.flushobject
+-- pdfreserveobject = lpdf.reserveobject
+-- pdfpagereference = lpdf.pagereference
+-- end)
local texgetcount = tex.getcount
diff --git a/tex/context/base/mkxl/lpdf-u3d.lmt b/tex/context/base/mkxl/lpdf-u3d.lmt
index 6e02fde30..54dc8a227 100644
--- a/tex/context/base/mkxl/lpdf-u3d.lmt
+++ b/tex/context/base/mkxl/lpdf-u3d.lmt
@@ -32,14 +32,8 @@ local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfnull = lpdf.null
local pdfreference = lpdf.reference
-
-local pdfflushstreamobject
-local pdfflushstreamfileobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfflushstreamfileobject = lpdf.flushstreamfileobject
-end)
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfflushstreamfileobject = lpdf.flushstreamfileobject
local checkedkey = lpdf.checkedkey
local limited = lpdf.limited
diff --git a/tex/context/base/mkxl/lpdf-wid.lmt b/tex/context/base/mkxl/lpdf-wid.lmt
index 8c0aa74af..2309d1686 100644
--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -72,21 +72,28 @@ local pdfborder = lpdf.border
local pdftransparencyvalue = lpdf.transparencyvalue
local pdfcolorvalues = lpdf.colorvalues
-local pdfflushobject
-local pdfflushstreamobject
-local pdfflushstreamfileobject
-local pdfreserveobject
-local pdfpagereference
-local pdfshareobjectreference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfflushstreamfileobject = lpdf.flushstreamfileobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfshareobjectreference = lpdf.shareobjectreference
-end)
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfflushstreamfileobject = lpdf.flushstreamfileobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfshareobjectreference = lpdf.shareobjectreference
+
+-- local pdfflushobject
+-- local pdfflushstreamobject
+-- local pdfflushstreamfileobject
+-- local pdfreserveobject
+-- local pdfpagereference
+-- local pdfshareobjectreference
+--
+-- updaters.register("backend.update.lpdf",function()
+-- pdfflushobject = lpdf.flushobject
+-- pdfflushstreamobject = lpdf.flushstreamobject
+-- pdfflushstreamfileobject = lpdf.flushstreamfileobject
+-- pdfreserveobject = lpdf.reserveobject
+-- pdfpagereference = lpdf.pagereference
+-- pdfshareobjectreference = lpdf.shareobjectreference
+-- end)
-- symbols
diff --git a/tex/context/base/mkxl/lpdf-xmp.lmt b/tex/context/base/mkxl/lpdf-xmp.lmt
index 313488a39..776bdff4f 100644
--- a/tex/context/base/mkxl/lpdf-xmp.lmt
+++ b/tex/context/base/mkxl/lpdf-xmp.lmt
@@ -26,14 +26,8 @@ local codeinjections = backends.pdf.codeinjections -- normally it is regis
local pdfdictionary = lpdf.dictionary
local pdfconstant = lpdf.constant
local pdfreference = lpdf.reference
-
local pdfgetmetadata = lpdf.getmetadata
-
-local pdfflushstreamobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
-end)
+local pdfflushstreamobject = lpdf.flushstreamobject
-- The XMP packet wrapper is kind of fixed, see page 10 of XMPSpecificationsPart1.pdf from
-- XMP-Toolkit-SDK-CC201607.zip. So we hardcode the id.
diff --git a/tex/context/base/mkxl/math-map.lmt b/tex/context/base/mkxl/math-map.lmt
index de738a304..783b9db74 100644
--- a/tex/context/base/mkxl/math-map.lmt
+++ b/tex/context/base/mkxl/math-map.lmt
@@ -190,7 +190,7 @@ local regular_tf = {
},
symbols = {
[0x2202]=0x2202, [0x2207]=0x2207,
- [0x0027]=0x2032, -- prime
+ [0x0027]=0x2032, -- prime
},
}
diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt
index ee284ea88..5ce0702de 100644
--- a/tex/context/base/mkxl/math-noa.lmt
+++ b/tex/context/base/mkxl/math-noa.lmt
@@ -54,7 +54,7 @@ local trace_processing = false registertracker("math.processing", function(v
local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end)
local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end)
local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end)
-local trace_fixing = false registertracker("math.fixing", function(v) trace_foxing = v end)
+local trace_fixing = false registertracker("math.fixing", function(v) trace_fixing = v end)
local trace_patching = false registertracker("math.patching", function(v) trace_patching = v end)
local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end)
local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end)
@@ -1941,7 +1941,7 @@ do
mathematics.virtualize(movesub)
- local options_supported = tokens.defined("Unosuperscript")
+ local nosuperscript_code = tex.mathoptioncodes.nosuperscript
local function fixsupscript(parent,current,current_char,new_char)
if new_char ~= current_char and new_char ~= true then
@@ -1954,37 +1954,9 @@ do
report_fixing("fixing subscript, superscript %U",current_char)
end
end
- if options_supported then
- setfield(parent,"options",0x08+0x22)
- end
+ setfield(parent,"options",nosuperscript_code)
end
- -- local function movesubscript(parent,current_nucleus,oldchar,newchar)
- -- local prev = getprev(parent)
- -- if prev and getid(prev) == noad_code then
- -- local psup = getsup(prev)
- -- local psub = getsub(prev)
- -- if not psup and not psub then
- -- fixsupscript(prev,current_nucleus,oldchar,newchar)
- -- local nucleus = getnucleus(parent)
- -- local sub = getsub(parent)
- -- setsup(prev,nucleus)
- -- setsub(prev,sub)
- -- local dummy = copy_node(nucleus)
- -- setchar(dummy,0)
- -- setnucleus(parent,dummy)
- -- setsub(parent)
- -- elseif not psup then
- -- fixsupscript(prev,current_nucleus,oldchar,newchar)
- -- local nucleus = getnucleus(parent)
- -- setsup(prev,nucleus)
- -- local dummy = copy_node(nucleus)
- -- setchar(dummy,0)
- -- setnucleus(parent,dummy)
- -- end
- -- end
- -- end
-
local function move_none_none(parent,prev,nuc,oldchar,newchar)
fixsupscript(prev,nuc,oldchar,newchar)
local sub = getsub(parent)
diff --git a/tex/context/base/mkxl/node-met.lmt b/tex/context/base/mkxl/node-met.lmt
index 72f4cf844..83712b5e7 100644
--- a/tex/context/base/mkxl/node-met.lmt
+++ b/tex/context/base/mkxl/node-met.lmt
@@ -534,56 +534,3 @@ metatable.__unm = function(head)
n_setnext(last)
return first
end
-
--- also handy n.. do we still need this ... needs an update anyway
-
-local tonode = node.direct.tonode
-local whatsit_code = nodecodes.whatsit
-local getfields = node.fields
-local sort = table.sort
-local whatsitkeys = { }
-local keys = { whatsit = whatsitkeys }
-local messyhack = table.tohash { -- temporary solution
- nodecodes.attributelist,
- nodecodes.attribute,
- nodecodes.action, -- hm
-}
-
-setmetatableindex(keys,function(t,k)
- local v = (k == "attributelist" or k == nodecodes.attributelist) and { } or getfields(k)
- if messyhack[k] then
- for i=1,#v do
- if v[i] == "subtype" then
- remove(v,i)
- break
- end
- end
- end
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-setmetatableindex(whatsitkeys,function(t,k)
- local v = getfields(whatsit_code,k)
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-local function nodefields(n)
- n = tonode(n)
- local id = n.id
- if id == whatsit_code then
- return whatsitkeys[n.subtype]
- else
- return keys[id]
- end
-end
-
-nodes.keys = keys -- [id][subtype]
-nodes.fields = nodefields -- (n)
diff --git a/tex/context/base/mkxl/page-ffl.mkxl b/tex/context/base/mkxl/page-ffl.mkxl
index 350c45000..4c467253b 100644
--- a/tex/context/base/mkxl/page-ffl.mkxl
+++ b/tex/context/base/mkxl/page-ffl.mkxl
@@ -109,7 +109,7 @@
\permanent\protected\def\strc_floats_facing_flush_indeed
{\global\advance\c_strc_floats_facing_flushed\plusone
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup
\forgetall
\ifconditional\c_page_one_top_of_insert
\ifconditional\c_page_one_correct_top_insert
diff --git a/tex/context/base/mkxl/page-ini.mkxl b/tex/context/base/mkxl/page-ini.mkxl
index fe07f9fb5..8c04c6cfc 100644
--- a/tex/context/base/mkxl/page-ini.mkxl
+++ b/tex/context/base/mkxl/page-ini.mkxl
@@ -323,7 +323,7 @@
%
% \def\flushatthispage
% {\bgroup
-% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
+% \dowithnextbox{\page_inserts_inject\thispageinsert{\box\nextbox}\egroup}%
% \hbox}
%
% \appendtoks
diff --git a/tex/context/base/mkxl/page-ins.mkxl b/tex/context/base/mkxl/page-ins.mkxl
index 0a4faa7c0..872af4807 100644
--- a/tex/context/base/mkxl/page-ins.mkxl
+++ b/tex/context/base/mkxl/page-ins.mkxl
@@ -93,7 +93,7 @@
\protected\def\page_inserts_synchronize#1% yes or no
{\ifvoid#1\else
- \insert#1{\unvbox#1}%
+ \page_inserts_inject#1{\unvbox#1}%
\fi}
\permanent\protected\def\doifelseinsertion#1%
@@ -106,7 +106,7 @@
\aliased\let\doifinsertionelse\doifelseinsertion
% \protected\def\startinsertion[#1]%
-% {\insert\csname\??insertionnumber#1\endcsname\bgroup}
+% {\page_inserts_inject\csname\??insertionnumber#1\endcsname\bgroup}
%
% \protected\def\stopinsertion
% {\egroup}
@@ -127,6 +127,8 @@
\c_syst_max_allocated_insert = 255 % 254
\c_syst_last_allocated_insertion = 1 %
+ \protected\def\page_inserts_inject {\insert}
+
\protected\def\page_inserts_set_limit {\insertlimit}
\protected\def\page_inserts_set_distance {\insertdistance}
\protected\def\page_inserts_set_multiplier{\insertmultiplier}
@@ -146,6 +148,8 @@
\else
+ \protected\def\page_inserts_inject {\insert}
+
\protected\def\page_inserts_set_limit {\global\dimen}
\protected\def\page_inserts_set_distance {\global\skip }
\protected\def\page_inserts_set_multiplier{\global\count}
diff --git a/tex/context/base/mkxl/page-one.mkxl b/tex/context/base/mkxl/page-one.mkxl
index 7ea43c1d6..f332b0d8e 100644
--- a/tex/context/base/mkxl/page-one.mkxl
+++ b/tex/context/base/mkxl/page-one.mkxl
@@ -305,7 +305,7 @@
\def\page_one_insert_top_float % maybe remember last beforeskip
{\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup
\forgetall
\ifconditional\c_page_one_top_of_insert
\ifconditional\c_page_one_correct_top_insert
@@ -380,7 +380,7 @@
\global\advance\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
\ifdim\d_page_floats_inserted_bottom<\pagegoal\relax
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!bottomfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!bottomfloat\bgroup
\forgetall
\blank[\rootfloatparameter\c!spacebefore]%
\page_otr_command_flush_float_box
@@ -740,7 +740,7 @@
\def\page_one_place_float_bottom_indeed
{\global\advance\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!bottomfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!bottomfloat\bgroup
\forgetall
\blank[\rootfloatparameter\c!spacebefore]%
\page_otr_command_flush_float_box
diff --git a/tex/context/base/mkxl/page-pcl.mkxl b/tex/context/base/mkxl/page-pcl.mkxl
index e2cf44bd4..3ef07c9c5 100644
--- a/tex/context/base/mkxl/page-pcl.mkxl
+++ b/tex/context/base/mkxl/page-pcl.mkxl
@@ -221,7 +221,7 @@
\ifdim\dimexpr\d_page_col_top_width>\d_page_col_sofar\relax
\begingroup
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup
\vbox to \d_page_col_top_height{\vss}
% can be an option
\page_col_command_flush_top_insertions
diff --git a/tex/context/base/mkxl/toks-aux.lmt b/tex/context/base/mkxl/toks-aux.lmt
index a8bdae5e8..86b796b1e 100644
--- a/tex/context/base/mkxl/toks-aux.lmt
+++ b/tex/context/base/mkxl/toks-aux.lmt
@@ -133,22 +133,22 @@ interfaces.implement {
local groupcodes = { }
local glyphoptioncodes = { }
local discoptioncodes = { }
+local mathoptioncodes = { }
local hyphenationcodes = { }
local frozenparcodes = { }
local flagcodes = { }
local normalizecodes = { }
--- local parcontextcodes = { }
--- local parbegincodes = { }
+----- parcontextcodes = { }
+----- parbegincodes = { }
for k, v in next, tex.getgroupvalues() do groupcodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.gethyphenationvalues() do hyphenationcodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.getglyphoptionvalues() do glyphoptioncodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.getdiscoptionvalues() do discoptioncodes[k] = gsub(v,"[_ ]","") end
+for k, v in next, tex.getmathoptionvalues() do mathoptioncodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.getfrozenparvalues() do frozenparcodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.getflagvalues() do flagcodes[k] = gsub(v,"[_ ]","") end
for k, v in next, tex.getnormalizevalues() do normalizecodes[k] = gsub(v,"[_ ]","") end
--- for k, v in next, tex.getparcontextvalues() do parcontextcodes[k] = gsub(v,"[_ ]","") end
--- for k, v in next, tex.getparbeginvalues() do parbegincodes[k] = gsub(v,"[_ ]","") end
if environment.initex then
@@ -161,27 +161,23 @@ if environment.initex then
for k, v in next, frozenparcodes do texintegerdef("frozen" .. v .. "code", k,"immutable") end
for k, v in next, flagcodes do texintegerdef(v .. "flagcode", k,"immutable") end
for k, v in next, normalizecodes do texintegerdef(v .. "code", k,"immutable") end
- -- for k, v in next, parcontextcodes do texintegerdef(v .. "parcontextcode", k,"immutable") end
- -- for k, v in next, parbegincodes do texintegerdef(v .. "parbegincode", k,"immutable") end
end
groupcodes = utilities.storage.allocate(table.swapped(groupcodes, groupcodes))
glyphoptioncodes = utilities.storage.allocate(table.swapped(glyphoptioncodes,glyphoptioncodes))
discoptioncodes = utilities.storage.allocate(table.swapped(discoptioncodes, discoptioncodes))
+mathoptioncodes = utilities.storage.allocate(table.swapped(mathoptioncodes, mathoptioncodes))
hyphenationcodes = utilities.storage.allocate(table.swapped(hyphenationcodes,hyphenationcodes))
frozenparcodes = utilities.storage.allocate(table.swapped(frozenparcodes, frozenparcodes))
flagcodes = utilities.storage.allocate(table.swapped(flagcodes, flagcodes))
normalizecodes = utilities.storage.allocate(table.swapped(normalizecodes, normalizecodes))
--- parcontextcodes = utilities.storage.allocate(table.swapped(parcontextcodes, parcontextcodes))
--- parbegincodes = utilities.storage.allocate(table.swapped(parbegincodes, parbegincodes))
tex.groupcodes = groupcodes
tex.glyphoptioncodes = glyphoptioncodes
tex.discoptioncodes = discoptioncodes
+tex.mathoptioncodes = mathoptioncodes
tex.hyphenationcodes = hyphenationcodes
tex.frozenparcodes = frozenparcodes
tex.flagcodes = flagcodes
tex.normalizecodes = normalizecodes
--- tex.parcontextcodes = parcontextcodes
--- tex.parbegincodes = parbegincodes
diff --git a/tex/context/fonts/mkiv/type-imp-koeielettersot.mkiv b/tex/context/fonts/mkiv/type-imp-koeielettersot.mkiv
index e3e8fc277..da0401016 100644
--- a/tex/context/fonts/mkiv/type-imp-koeielettersot.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-koeielettersot.mkiv
@@ -134,11 +134,11 @@
\setupbodyfont[cows]
-\input tufte
+% \input tufte
-\stoptext
+% \stoptext
-\starttext
+% \starttext
\loadtypescriptfile[cowotf]
@@ -147,17 +147,17 @@
\definecolor[cowblue] [b=.50]
\definecolor[cowyellow][y=.25]
+\definefontcolorpalette[cows][cowgreen,cowyellow,cowblue,cowred]
+
\startluacode
- fonts.handlers.otf.registerpalette("demo", {
- { g = .50 },
- { y = .25 },
- { b = .50 },
- { r = .50 },
+ fonts.handlers.otf.registerpalette("cows", {
+ { g = .5 },
+ { r = .75, g = .75 },
+ { b = .5 },
+ { r = .5 },
})
\stopluacode
-\definefontcolorpalette[cows][cowgreen,cowyellow,cowblue,cowred]
-
\adaptfontfeature[cowscolored] [colr=cows]
\setupbodyfont[coloredcows,12pt]
diff --git a/tex/context/modules/mkiv/m-zint.mkiv b/tex/context/modules/mkiv/m-zint.mkiv
new file mode 100644
index 000000000..4957c8461
--- /dev/null
+++ b/tex/context/modules/mkiv/m-zint.mkiv
@@ -0,0 +1,112 @@
+%D \module
+%D [ file=m-zint,
+%D version=2010.12.07,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Zint Barcode Generator,
+%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 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
+%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.
+
+\startluacode
+
+moduledata.zint = { }
+
+local format, lower, gsub = string.format, string.lower, string.gsub
+local patterns = lpeg.patterns
+
+local zint = "zint" -- '"c:/program files/zint/zint.exe"'
+local defaultcode = "PDF417"
+
+local whitespace = patterns.whitespace
+local spaces = whitespace^0
+local key = (spaces / "") * patterns.digit^0 * (patterns.colon * spaces / "")
+local value = (whitespace / "" + (1 - key))^1
+local pattern = lpeg.Cf(lpeg.Ct("") * (lpeg.Cg((lpeg.Cs(key) / tonumber) * (lpeg.Cs(value) / lower)) + patterns.anything)^0,rawset)
+
+local reverse
+
+local function cleancode(code)
+ if not code or code == "" then
+ code = defaultcode
+ end
+ return lower(gsub(code," ",""))
+end
+
+local function numberofcode(code)
+ if not reverse then
+ local types = os.resultof(format("%s --types",zint)) or ""
+ local formats = lpeg.match(pattern,types)
+ if not formats or not next(formats) then
+ return code
+ end
+ reverse = table.swapped(formats) or { }
+ end
+ code = cleancode(code)
+ return reverse[code] or code
+end
+
+function moduledata.zint.generate(code,data,suffix,options)
+ if not data or data == "" then
+ data = "unset"
+ end
+ local code = cleancode(code)
+ local base = format("zint-%s-%s",code,md5.hex(data))
+ local name = file.addsuffix(base,suffix or "eps")
+ if not lfs.isfile(name) then
+ local temp = file.addsuffix(base,"tmp")
+ local code = numberofcode(code)
+ logs.simple("using 'zint' to generate '%s'",base)
+ io.savedata(temp,data)
+ os.execute(format('%s --barcode=%s --output="%s" --input="%s" %s',zint,code,name,temp,options or ""))
+ os.remove(temp)
+ end
+ return name
+end
+
+\stopluacode
+
+\unprotect
+
+\unexpanded\def\barcode[#1]% [alternative=,text=]
+ {\bgroup
+ \getdummyparameters
+ [\c!alternative=,\c!text=,#1]%
+ \externalfigure
+ [\cldcontext{moduledata.zint.generate("\dummyparameter\c!alternative",\!!bs\dummyparameter\c!text\!!es)}]%
+ [#1,\c!alternative=,\c!text=]%
+ \egroup}
+
+\protect
+
+\continueifinputfile{m-zint.mkiv}
+
+\starttext
+
+ \externalfigure[\cldcontext{moduledata.zint.generate("PDF417",[[Hans Hagen]])}]
+ \blank
+ \externalfigure[\cldcontext{moduledata.zint.generate("PDF417","Ton Otten")}]
+ \blank
+ \externalfigure[\cldcontext{moduledata.zint.generate("ISBN","9789490688011")}]
+ \blank
+ \barcode[text=Does It Work?,width=\textwidth]
+ \blank
+ \barcode[alternative=isbn,text=9789490688011,width=3cm]
+
+\stoptext
+
+
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 0721d5d77..ac8132e27 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-05-26 09:57
+-- merge date : 2021-05-27 14:12
do -- begin closure to overcome local limits and interference