summaryrefslogtreecommitdiff
path: root/tex/context/base
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base')
-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-de.mkii8
-rw-r--r--tex/context/base/mkiv/back-pdf.mkiv6
-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/context.mkxl2
-rw-r--r--tex/context/base/mkiv/core-con.lua16
-rw-r--r--tex/context/base/mkiv/font-aux.lua4
-rw-r--r--tex/context/base/mkiv/font-ocl.lua56
-rw-r--r--tex/context/base/mkiv/lpdf-lmt.lua6
-rw-r--r--tex/context/base/mkiv/mlib-pdf.lua11
-rw-r--r--tex/context/base/mkiv/mlib-scn.lua50
-rw-r--r--tex/context/base/mkiv/mult-fun.lua20
-rw-r--r--tex/context/base/mkiv/mult-mps.lua1
-rw-r--r--tex/context/base/mkiv/page-col.mkiv3
-rw-r--r--tex/context/base/mkiv/page-cst.mkiv6
-rw-r--r--tex/context/base/mkiv/page-mix.mkiv7
-rw-r--r--tex/context/base/mkiv/page-one.mkiv3
-rw-r--r--tex/context/base/mkiv/page-pcl.mkiv11
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26704 -> 26674 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin268937 -> 268804 bytes
-rw-r--r--tex/context/base/mkiv/strc-ref.lua38
-rw-r--r--tex/context/base/mkiv/strc-ref.mkvi15
24 files changed, 198 insertions, 73 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index bca3721ce..eced6e05b 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{2019.09.09 13:44}
+\newcontextversion{2019.09.10 20:03}
%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 f56da6309..b3afbbceb 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{2019.09.09 13:44}
+\edef\contextversion{2019.09.10 20:03}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii
index 6b2995517..a957e8f17 100644
--- a/tex/context/base/mkii/mult-de.mkii
+++ b/tex/context/base/mkii/mult-de.mkii
@@ -637,6 +637,7 @@
\setinterfaceconstant{aligntitle}{titelausrichten}
\setinterfaceconstant{alternative}{alternative}
\setinterfaceconstant{anchor}{anchor}
+\setinterfaceconstant{anchoring}{anchoring}
\setinterfaceconstant{andtext}{andtext}
\setinterfaceconstant{apa}{apa}
\setinterfaceconstant{arguments}{arguments}
@@ -866,6 +867,7 @@
\setinterfaceconstant{hfil}{hfil}
\setinterfaceconstant{hidenumber}{hidenumber}
\setinterfaceconstant{hoffset}{hoffset}
+\setinterfaceconstant{horizontal}{horizontal}
\setinterfaceconstant{horoffset}{rumpfabstand}
\setinterfaceconstant{hyphen}{hyphen}
\setinterfaceconstant{hyphens}{hyphens}
@@ -966,9 +968,12 @@
\setinterfaceconstant{menu}{menue}
\setinterfaceconstant{method}{methode}
\setinterfaceconstant{middle}{mittig}
+\setinterfaceconstant{middlecolor}{middlecolor}
\setinterfaceconstant{middlecommand}{middlecommand}
\setinterfaceconstant{middlespeech}{middlespeech}
+\setinterfaceconstant{middlestyle}{middlestyle}
\setinterfaceconstant{middletext}{mittigertext}
+\setinterfaceconstant{middlewidth}{middlewidth}
\setinterfaceconstant{midsentence}{midsentence}
\setinterfaceconstant{min}{min}
\setinterfaceconstant{mindepth}{mindepth}
@@ -1286,6 +1291,7 @@
\setinterfaceconstant{vcompact}{vcompact}
\setinterfaceconstant{vector}{vector}
\setinterfaceconstant{veroffset}{kopfoffset}
+\setinterfaceconstant{vertical}{vertikal}
\setinterfaceconstant{vfactor}{vfaktor}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{viewerprefix}{viewerprefix}
@@ -1296,6 +1302,7 @@
\setinterfaceconstant{white}{weiss}
\setinterfaceconstant{width}{breite}
\setinterfaceconstant{words}{words}
+\setinterfaceconstant{xanchor}{xanchor}
\setinterfaceconstant{xfactor}{xfaktor}
\setinterfaceconstant{xhtml}{xhtml}
\setinterfaceconstant{xmax}{xmax}
@@ -1303,6 +1310,7 @@
\setinterfaceconstant{xoffset}{xoffset}
\setinterfaceconstant{xscale}{xformat}
\setinterfaceconstant{xstep}{xschritt}
+\setinterfaceconstant{yanchor}{yanchor}
\setinterfaceconstant{yfactor}{yfaktor}
\setinterfaceconstant{ymax}{ymax}
\setinterfaceconstant{yoffset}{yoffset}
diff --git a/tex/context/base/mkiv/back-pdf.mkiv b/tex/context/base/mkiv/back-pdf.mkiv
index 2541755a6..ff05e647f 100644
--- a/tex/context/base/mkiv/back-pdf.mkiv
+++ b/tex/context/base/mkiv/back-pdf.mkiv
@@ -143,4 +143,10 @@
\let\pdfactualtext\pdfbackendactualtext
+%D Bah, this is also needed for tikz:
+
+\let\pdfsavepos \savepos
+\let\pdflastxpos\lastxpos
+\let\pdflastypos\lastypos
+
\protect \endinput
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 37364a19a..0a68310a0 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{2019.09.09 13:44}
+\newcontextversion{2019.09.10 20:03}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index b417e09a7..2c17d4b91 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{2019.09.09 13:44}
+\edef\contextversion{2019.09.10 20:03}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl
index aaf35d985..39f647cc2 100644
--- a/tex/context/base/mkiv/context.mkxl
+++ b/tex/context/base/mkiv/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2019.09.09 13:44}
+\edef\contextversion{2019.09.10 20:03}
\edef\contextkind {beta}
%D Kind of special:
diff --git a/tex/context/base/mkiv/core-con.lua b/tex/context/base/mkiv/core-con.lua
index 6d71071a0..4f6090ef5 100644
--- a/tex/context/base/mkiv/core-con.lua
+++ b/tex/context/base/mkiv/core-con.lua
@@ -311,12 +311,15 @@ local function textime()
return tonumber(osdate("%H")) * 60 + tonumber(osdate("%M"))
end
-function converters.year () return osdate("%Y") end
-function converters.month () return osdate("%m") end -- always two digits
-function converters.day () return osdate("%d") end
-function converters.hour () return osdate("%H") end
-function converters.minute() return osdate("%M") end
-function converters.second() return osdate("%S") end
+-- For consistenty we need to add day here but that conflicts with the current
+-- serializer so then best is to have none from now on:
+
+-- function converters.year () return osdate("%Y") end
+-- function converters.month () return osdate("%m") end -- always two digits
+-- function converters.day () return osdate("%d") end -- conflicts
+-- function converters.hour () return osdate("%H") end
+-- function converters.minute() return osdate("%M") end
+-- function converters.second() return osdate("%S") end
converters.weekday = weekday
converters.isleapyear = isleapyear
@@ -330,6 +333,7 @@ implement { name = "nofdays", actions = { nofdays, context }, arguments = { "i
implement { name = "year", actions = { osdate, context }, arguments = "'%Y'" }
implement { name = "month", actions = { osdate, context }, arguments = "'%m'" }
+implement { name = "day", actions = { osdate, context }, arguments = "'%d'" }
implement { name = "hour", actions = { osdate, context }, arguments = "'%H'" }
implement { name = "minute", actions = { osdate, context }, arguments = "'%M'" }
implement { name = "second", actions = { osdate, context }, arguments = "'%S'" }
diff --git a/tex/context/base/mkiv/font-aux.lua b/tex/context/base/mkiv/font-aux.lua
index 4ac6278cb..0e4d7add3 100644
--- a/tex/context/base/mkiv/font-aux.lua
+++ b/tex/context/base/mkiv/font-aux.lua
@@ -240,3 +240,7 @@ function fonts.getmultiple(tfmdata,k,kind)
return 0
end
end
+
+function fonts.getindices(tfmdata)
+ return getindices(tfmdata)
+end
diff --git a/tex/context/base/mkiv/font-ocl.lua b/tex/context/base/mkiv/font-ocl.lua
index 29aa3eac7..10d2df270 100644
--- a/tex/context/base/mkiv/font-ocl.lua
+++ b/tex/context/base/mkiv/font-ocl.lua
@@ -10,12 +10,15 @@ if not modules then modules = { } end modules ['font-ocl'] = {
local tostring, tonumber, next = tostring, tonumber, next
local round, max = math.round, math.round
-local sortedkeys, sortedhash = table.sortedkeys, table.sortedhash
+local gsub, find = string.gsub, string.find
+local sortedkeys, sortedhash, concat = table.sortedkeys, table.sortedhash, table.concat
local setmetatableindex = table.setmetatableindex
local formatters = string.formatters
local tounicode = fonts.mappings.tounicode
+local bpfactor = number.dimenfactors.bp
+
local helpers = fonts.helpers
local charcommand = helpers.commands.char
@@ -371,8 +374,8 @@ local function pdftovirtual(tfmdata,pdfshapes,kind) -- kind = png|svg
local dy = nil
if typ == "table" then
data = pdf.data
- dx = pdf.dx or 0
- dy = pdf.dy or 0
+ dx = pdf.x or pdf.dx or 0
+ dy = pdf.y or pdf.dy or 0
elseif typ == "string" then
data = pdf
dx = 0
@@ -386,11 +389,19 @@ local function pdftovirtual(tfmdata,pdfshapes,kind) -- kind = png|svg
local wd = character.width or 0
local ht = character.height or 0
local dp = character.depth or 0
- -- The down and right will change too (we can move that elsewhere).
+ -- The down and right will change too (we can move that elsewhere). We have
+ -- a different treatment in lmtx but the next kind of works. These images are
+ -- a mess anyway as in svg the bbox can be messed up absent). A png image
+ -- needs the x/y. I might normalize this once we moev to lmtx exlusively.
character.commands = {
not unicode and actualb or { "pdf", "page", (getactualtext(unicode)) },
- downcommand[dp + dy * hfactor],
- rightcommand[dx * hfactor],
+ -- lmtx (when we deal with depth in vfimage, currently disabled):
+ -- downcommand [dy * hfactor],
+ -- rightcommand[dx * hfactor],
+ -- vfimage(wd,ht,dp,data,name),
+ -- mkiv
+ downcommand [dp + dy * hfactor],
+ rightcommand[ dx * hfactor],
vfimage(wd,ht,dp,data,name),
actuale,
}
@@ -437,7 +448,7 @@ do
name = "otfsvg",
program = "inkscape",
method = "pipeto",
- template = "--shell > temp-otf-svg-shape.log",
+ template = "--export-area-drawing --shell > temp-otf-svg-shape.log",
reporter = report_svg,
}
@@ -446,20 +457,25 @@ do
-- poor mans variant for generic:
--
runner = function()
- return io.open("inkscape --shell > temp-otf-svg-shape.log","w")
+ return io.open("inkscape --export-area-drawing --shell > temp-otf-svg-shape.log","w")
end
end
- function otfsvg.topdf(svgshapes)
+ -- There are svg out there with bad viewBox specifications where shapes lay outside that area,
+ -- but trying to correct that didin'w work out well enough so I discarded that code.
+
+ function otfsvg.topdf(svgshapes,tfmdata)
local pdfshapes = { }
local inkscape = runner()
if inkscape then
- local nofshapes = #svgshapes
- local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
- local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-pdf=%s\n"]
- local filterglyph = otfsvg.filterglyph
- local nofdone = 0
+ local indices = fonts.getindices(tfmdata)
+ local descriptions = tfmdata.descriptions
+ local nofshapes = #svgshapes
+ local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
+ local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
+ local f_convert = formatters["%s --export-pdf=%s\n"]
+ local filterglyph = otfsvg.filterglyph
+ local nofdone = 0
report_svg("processing %i svg containers",nofshapes)
statistics.starttiming()
for i=1,nofshapes do
@@ -485,7 +501,13 @@ do
for index in next, pdfshapes do
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
- pdfshapes[index] = loaddata(pdffile)
+ -- local fntdata = descriptions[indices[index]]
+ -- local bounds = fntdata and fntdata.boundingbox
+ pdfshapes[index] = {
+ data = loaddata(pdffile),
+ -- x = bounds and bounds[1] or 0,
+ -- y = bounds and bounds[2] or 0,
+ }
remove(svgfile)
remove(pdffile)
end
@@ -512,7 +534,7 @@ local function initializesvg(tfmdata,kind,value) -- hm, always value
if not pdfshapes or pdffile.timestamp ~= timestamp then
local svgfile = containers.read(otf.svgcache,hash)
local svgshapes = svgfile and svgfile.svgshapes
- pdfshapes = svgshapes and otfsvg.topdf(svgshapes) or { }
+ pdfshapes = svgshapes and otfsvg.topdf(svgshapes,tfmdata) or { }
containers.write(otf.pdfcache, hash, {
pdfshapes = pdfshapes,
timestamp = timestamp,
diff --git a/tex/context/base/mkiv/lpdf-lmt.lua b/tex/context/base/mkiv/lpdf-lmt.lua
index 6913e24e9..709a9d48a 100644
--- a/tex/context/base/mkiv/lpdf-lmt.lua
+++ b/tex/context/base/mkiv/lpdf-lmt.lua
@@ -1137,14 +1137,16 @@ local flushrule, flushsimplerule, flushimage do
xsize, ysize,
rotation,
objnum,
- groupref = pdfincludeimage(index)
+ groupref = pdfincludeimage(index)
local rx = width / xsize
local sx = 0
local sy = 0
local ry = total / ysize
local tx = pos_h
- local ty = pos_v - 2 * depth -- to be sorted out
+ -- to be sorted out
+ -- local ty = pos_v - depth
+ local ty = pos_v -- we assume that depth is dealt with in the caller (for now)
usedximages[index] = objnum
diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua
index 65f3b2016..524e930a9 100644
--- a/tex/context/base/mkiv/mlib-pdf.lua
+++ b/tex/context/base/mkiv/mlib-pdf.lua
@@ -460,12 +460,15 @@ local linewidth = false
local evenodd = false
local collect = false
local both = false
+ local flush = false
local postscript = object.postscript
if not object.istext then
if postscript == "evenodd" then
evenodd = true
elseif postscript == "collect" then
collect = true
+ elseif postscript == "flush" then
+ flush = true
elseif postscript == "both" then
both = true
elseif postscript == "eoboth" then
@@ -474,7 +477,9 @@ local linewidth = false
end
end
--
- if collect then
+ if flush and not savedpath then
+ -- forget about it
+ elseif collect then
if not savedpath then
savedpath = { object.path or false }
savedhtap = { object.htap or false }
@@ -554,7 +559,9 @@ end
end
savedpath = nil
end
- if transformed then
+ if flush then
+ -- ignore this path
+ elseif transformed then
flushconcatpath(path,result,open)
else
flushnormalpath(path,result,open)
diff --git a/tex/context/base/mkiv/mlib-scn.lua b/tex/context/base/mkiv/mlib-scn.lua
index ec0f7397b..a85c861bd 100644
--- a/tex/context/base/mkiv/mlib-scn.lua
+++ b/tex/context/base/mkiv/mlib-scn.lua
@@ -625,30 +625,30 @@ local function getparametertext()
end
end
-local function getparameteroption()
- local list, n = collectnames()
- local last = list[n]
- if type(last) == "string" then
- n = n - 1
- else
- return false
- end
- local v = namespaces
- for i=1,n do
- v = v[list[i]]
- if not v then
- break
- end
- end
- if type(v) == "string" and v ~= "" then
- for s in gmatch(v,"[^ ,]+") do
- if s == last then
- return true
- end
- end
- end
- return false
-end
+-- local function getparameteroption()
+-- local list, n = collectnames()
+-- local last = list[n]
+-- if type(last) == "string" then
+-- n = n - 1
+-- else
+-- return false
+-- end
+-- local v = namespaces
+-- for i=1,n do
+-- v = v[list[i]]
+-- if not v then
+-- break
+-- end
+-- end
+-- if type(v) == "string" and v ~= "" then
+-- for s in gmatch(v,"[^ ,]+") do
+-- if s == last then
+-- return true
+-- end
+-- end
+-- end
+-- return false
+-- end
metapost.registerscript("getparameters", getparameters)
metapost.registerscript("applyparameters", applyparameters)
@@ -661,7 +661,7 @@ metapost.registerscript("getparametercount", getparametercount)
metapost.registerscript("getmaxparametercount",getmaxparametercount)
metapost.registerscript("getparameterpath", getparameterpath)
metapost.registerscript("getparametertext", getparametertext)
-metapost.registerscript("getparameteroption", getparameteroption)
+--------.registerscript("getparameteroption", getparameteroption)
metapost.registerscript("pushparameters", pushparameters)
metapost.registerscript("popparameters", popparameters)
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index b652e4d44..d18d1bc0e 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -18,6 +18,24 @@ return {
"dq", "sq",
"crossingscale", "crossingoption",
"contextlmtxmode",
+ --
+ -- for the moment we put these here as they need to stand out
+ --
+ "getparameters",
+ "presetparameters",
+ "hasparameter",
+ "hasoption",
+ "getparameter",
+ "getparameterdefault",
+ "getparametercount",
+ "getmaxparametercount",
+ "getparameterpath",
+ "getparametertext",
+ -- "getparameteroption",
+ "applyparameters",
+ "pushparameters",
+ "popparameters",
+ "definecolor",
},
commands = {
"loadfile", "loadimage", "loadmodule",
@@ -137,7 +155,7 @@ return {
"passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote",
"startpassingvariable", "stoppassingvariable",
--
- "eofill", "eoclip", "nofill", "fillup", "eofillup", "nodraw",
+ "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw",
"area",
--
"addbackground",
diff --git a/tex/context/base/mkiv/mult-mps.lua b/tex/context/base/mkiv/mult-mps.lua
index 701b7b6da..35035308e 100644
--- a/tex/context/base/mkiv/mult-mps.lua
+++ b/tex/context/base/mkiv/mult-mps.lua
@@ -118,6 +118,7 @@ return {
"mm", "pt", "dd", "bp", "cm", "pc", "cc", "in",
--
"triplet", "quadruplet", "totransform",
+ --
},
internals = { -- we need to remove duplicates above
--
diff --git a/tex/context/base/mkiv/page-col.mkiv b/tex/context/base/mkiv/page-col.mkiv
index 14b512421..272ffe181 100644
--- a/tex/context/base/mkiv/page-col.mkiv
+++ b/tex/context/base/mkiv/page-col.mkiv
@@ -30,6 +30,9 @@
\setnewconstant\maxnofcolumns 50
\setnewconstant\allocatednofcolumns 0
+\newdimen\columnwidth
+\newdimen\columndistance
+
%D During initialization the temporary boxes are allocated. This enables us to
%D use as much columns as we want, without exhausting the pool of boxes too
%D fast. We could have packed them in one box, but we've got enough boxes.
diff --git a/tex/context/base/mkiv/page-cst.mkiv b/tex/context/base/mkiv/page-cst.mkiv
index 8444e4e16..1c89f3443 100644
--- a/tex/context/base/mkiv/page-cst.mkiv
+++ b/tex/context/base/mkiv/page-cst.mkiv
@@ -181,6 +181,12 @@
\setupoutputroutine[\s!pagegrid]%
\page_grd_command_set_hsize
\page_grd_command_set_vsize
+ %
+ \columnwidth \d_page_grd_column_width
+ \columndistance\d_page_grd_distance
+ \nofcolumns \c_page_grd_n_of_left % not always ok
+ \textwidth \d_page_grd_column_width % kind of redundant but we had it so ...
+ %
}%\begingroup}
\unexpanded\def\stoppagegrid
diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv
index 993edb89a..f41d739be 100644
--- a/tex/context/base/mkiv/page-mix.mkiv
+++ b/tex/context/base/mkiv/page-mix.mkiv
@@ -261,7 +261,7 @@
\unexpanded\def\page_mix_command_set_hsize
{\hsize\d_page_mix_column_width
- \textwidth\d_page_mix_column_width}
+ \columnwidth\d_page_mix_column_width}
%D When setting the vsize we make sure that we collect a few more lines than needed
%D so that we have enough to split over the columns. Collecting too much is somewhat
@@ -566,6 +566,11 @@
%
\d_page_mix_column_width\dimexpr(\d_page_mix_max_width-\d_page_mix_distance*\numexpr(\c_page_mix_n_of_columns-\plusone)\relax)/\c_page_mix_n_of_columns\relax
%
+ \columnwidth \d_page_mix_column_width
+ \columndistance\d_page_mix_distance
+ \nofcolumns \c_page_mix_n_of_columns
+ \textwidth \d_page_mix_column_width % kind of redundant but we had it so ...
+ %
\usemixedcolumnscolorparameter\c!color
%
\insidecolumnstrue % new
diff --git a/tex/context/base/mkiv/page-one.mkiv b/tex/context/base/mkiv/page-one.mkiv
index dc157fbeb..31b4e22d9 100644
--- a/tex/context/base/mkiv/page-one.mkiv
+++ b/tex/context/base/mkiv/page-one.mkiv
@@ -29,7 +29,8 @@
{\page_otr_eject_page_and_flush_inserts}
\unexpanded\def\page_one_command_set_hsize
- {\global\hsize\textwidth}
+ {\global\hsize\textwidth
+ \columnwidth\textwidth} % bonus so that it's not zero
\unexpanded\def\page_one_command_set_float_hsize
{\global\hsize\textwidth}
diff --git a/tex/context/base/mkiv/page-pcl.mkiv b/tex/context/base/mkiv/page-pcl.mkiv
index 3cb5bf1c8..61c542e1c 100644
--- a/tex/context/base/mkiv/page-pcl.mkiv
+++ b/tex/context/base/mkiv/page-pcl.mkiv
@@ -94,7 +94,9 @@
\else
\numexpr\c_page_col_n_of_columns-\plusone\relax
\dimexpr\d_page_col_column_width+\d_page_col_distance\relax
- \fi}
+ \fi
+ % consistent with mixed:
+ \textwidth\d_page_col_column_width}
%D \unknown
@@ -729,9 +731,6 @@
\setuevalue{\e!stop \currentpagecolumns}{\stoppagecolumns}%
\to \everydefinepagecolumns
-\ifdefined \columnwidth \else \newdimen\columnwidth \fi
-\ifdefined \columndistance \else \newdimen\columndistance \fi
-
\def\page_col_pickup_preceding
{\begingroup
\setupoutputroutine[\s!mixedcolumn]%
@@ -800,6 +799,8 @@
%
\columnwidth \d_page_col_column_width
\columndistance \d_page_col_distance
+ \nofcolumns \c_page_col_n_of_columns
+ \textwidth \columnwidth % kind of redundant
%
\nopenalties
%
@@ -835,8 +836,6 @@
\page_col_command_set_vsize
\page_col_command_set_hsize
%
- \nofcolumns\c_page_mix_n_of_columns
- %
\unexpanded\def\page_col_start[##1]%
{\page_col_start_nop}%
%
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 274a5a155..75ea1077e 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 f2e008447..726657bc3 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/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index e01bacaac..ec5ed5e03 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -2603,16 +2603,40 @@ implement {
arguments = { "string", "boolean", "boolean" }
}
-local function referencerealpage()
+-- local function referencerealpage()
+-- local actions = references.currentset
+-- return not actions and 0 or actions.realpage or setreferencerealpage(actions)
+-- end
+--
+-- implement {
+-- name = "referencerealpage",
+-- actions = { referencerealpage, context },
+-- -- arguments = "string" -- hm, weird
+-- }
+--
+-- implement {
+-- name = "referencerealpage",
+-- actions = function()
+-- local actions = references.currentset
+-- context(not actions and 0 or actions.realpage or setreferencerealpage(actions))
+-- end
+-- }
+
+local function referencepos(key)
local actions = references.currentset
- return not actions and 0 or actions.realpage or setreferencerealpage(actions)
+ local i = actions[1].i -- brrr
+ local v = 0
+ if i then
+ local a = i.references
+ if a then
+ v = a[key] or 0
+ end
+ end
+ context("%p",v)
end
-implement {
- name = "referencerealpage",
- actions = { referencerealpage, context },
- arguments = "string"
-}
+implement { name = "referenceposx", actions = function() referencepos("x") end }
+implement { name = "referenceposy", actions = function() referencepos("y") end }
local plist, nofrealpages
diff --git a/tex/context/base/mkiv/strc-ref.mkvi b/tex/context/base/mkiv/strc-ref.mkvi
index 05abd4930..cfe8744e2 100644
--- a/tex/context/base/mkiv/strc-ref.mkvi
+++ b/tex/context/base/mkiv/strc-ref.mkvi
@@ -1062,6 +1062,21 @@
\def\referencerealpage
{\clf_referencerealpage}
+% \unexpanded\def\columnreference#1%
+% {\dontleavehmode
+% \hpack to \zeropoint{\hpos{\v!column:#1}{\kern\dimexpr\textwidth/\nofcolumns\relax}\hss}}
+%
+% \def\columnnumber#1%
+% {\numexpr\dimexpr\MPx{\v!column:#1}\relax/\dimexpr\MPw{\v!column:#1}\relax\relax}
+%
+% but nicer is:
+
+\def\referencecolumnnumber
+ {\numexpr
+ \dimexpr\clf_referenceposx-\cutspace\relax/\dimexpr\makeupwidth/\nofcolumns\relax
+ +\plusone
+ \relax}
+
\unexpanded\def\tracedpagestate
{{\blue\tttf(\ifcase\referencepagedetail unknown\or same\or previous\or next\or above\or below\else unknown\fi)}}