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/back-pdf.mkiv2
-rw-r--r--tex/context/base/mkiv/colo-imp-crayola.mkiv10
-rw-r--r--tex/context/base/mkiv/colo-imp-svg.mkiv164
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv8
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/core-dat.lua58
-rw-r--r--tex/context/base/mkiv/core-dat.mkiv2
-rw-r--r--tex/context/base/mkiv/font-shp.lua6
-rw-r--r--tex/context/base/mkiv/grph-inc.lua29
-rw-r--r--tex/context/base/mkiv/grph-inc.mkiv30
-rw-r--r--tex/context/base/mkiv/java-ini.mkiv2
-rw-r--r--tex/context/base/mkiv/lpdf-ano.lua33
-rw-r--r--tex/context/base/mkiv/lpdf-col.lua13
-rw-r--r--tex/context/base/mkiv/lpdf-epa.lua8
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua4
-rw-r--r--tex/context/base/mkiv/lpdf-mis.lua27
-rw-r--r--tex/context/base/mkiv/lpdf-nod.lua15
-rw-r--r--tex/context/base/mkiv/lpdf-pde.lua119
-rw-r--r--tex/context/base/mkiv/lpdf-u3d.lua8
-rw-r--r--tex/context/base/mkiv/lpdf-wid.lua13
-rw-r--r--tex/context/base/mkiv/luat-run.lua23
-rw-r--r--tex/context/base/mkiv/lxml-tex.lua7
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv13
-rw-r--r--tex/context/base/mkiv/meta-blb.lua8
-rw-r--r--tex/context/base/mkiv/meta-pdf.lua9
-rw-r--r--tex/context/base/mkiv/mlib-run.lua2
-rw-r--r--tex/context/base/mkiv/mult-ini.lua16
-rw-r--r--tex/context/base/mkiv/mult-low.lua2
-rw-r--r--tex/context/base/mkiv/pack-bar.mkiv2
-rw-r--r--tex/context/base/mkiv/pack-obj.mkiv11
-rw-r--r--tex/context/base/mkiv/page-box.mkvi7
-rw-r--r--tex/context/base/mkiv/page-ffl.mkiv39
-rw-r--r--tex/context/base/mkiv/page-inf.mkiv2
-rw-r--r--tex/context/base/mkiv/page-one.mkiv52
-rw-r--r--tex/context/base/mkiv/page-spr.mkiv10
-rw-r--r--tex/context/base/mkiv/scrn-bar.mkvi2
-rw-r--r--tex/context/base/mkiv/scrn-ini.mkvi2
-rw-r--r--tex/context/base/mkiv/scrn-wid.mkvi97
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26337 -> 26346 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin266916 -> 269465 bytes
-rw-r--r--tex/context/base/mkiv/strc-lst.mkvi2
-rw-r--r--tex/context/base/mkiv/strc-ref.lua3
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv6
-rw-r--r--tex/context/base/mkiv/type-set.mkiv2
-rw-r--r--tex/context/base/mkiv/util-str.lua17
-rw-r--r--tex/context/fonts/mkiv/type-imp-plex.mkiv149
-rw-r--r--tex/context/interface/mkiv/context-en.xml44
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin856254 -> 857468 bytes
-rw-r--r--tex/context/interface/mkiv/i-pagestate.xml41
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin61225 -> 61224 bytes
-rw-r--r--tex/context/modules/mkiv/m-asymptote.lua2
-rw-r--r--tex/context/modules/mkiv/m-asymptote.mkiv58
-rw-r--r--tex/context/modules/mkiv/m-scite.mkiv2
-rw-r--r--tex/context/modules/mkiv/s-fonts-charts.mkiv2
-rw-r--r--tex/context/modules/mkiv/s-references-identify.mkiv69
-rw-r--r--tex/context/modules/mkiv/x-setups-basics.mkiv6
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
59 files changed, 1001 insertions, 265 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 0e0cb8416..a606a45ff 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{2018.09.13 17:41}
+\newcontextversion{2018.09.21 19:52}
%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 842d06f88..6c18b8bac 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{2018.09.13 17:41}
+\edef\contextversion{2018.09.21 19:52}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/back-pdf.mkiv b/tex/context/base/mkiv/back-pdf.mkiv
index 07de652b6..365493fff 100644
--- a/tex/context/base/mkiv/back-pdf.mkiv
+++ b/tex/context/base/mkiv/back-pdf.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D The less ther ei shere, the better.
+%D The less there is here, the better.
\writestatus{loading}{ConTeXt Backend Macros / PDF}
diff --git a/tex/context/base/mkiv/colo-imp-crayola.mkiv b/tex/context/base/mkiv/colo-imp-crayola.mkiv
index dbae02d5a..ae955ec1c 100644
--- a/tex/context/base/mkiv/colo-imp-crayola.mkiv
+++ b/tex/context/base/mkiv/colo-imp-crayola.mkiv
@@ -1,9 +1,9 @@
%D \module
-%D [ file=colo-imp-crayola
-%D version=2016.03.21,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Crayola,
-%D author=Alan Braslau]
+%D [ file=colo-imp-crayola
+%D version=2016.03.21,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=Crayola,
+%D author=Alan Braslau]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA, See mreadme.pdf for
diff --git a/tex/context/base/mkiv/colo-imp-svg.mkiv b/tex/context/base/mkiv/colo-imp-svg.mkiv
new file mode 100644
index 000000000..f39adaa98
--- /dev/null
+++ b/tex/context/base/mkiv/colo-imp-svg.mkiv
@@ -0,0 +1,164 @@
+%D \module
+%D [ file=colo-imp-svg,
+%D version=2018.09.17,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=SVG]
+%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 This module was prepared by an user who wants to stay anonymous and is
+%D derived from \url {http://www.december.com/html/spec/colorsvghex.html}.
+
+\startprotectedcolors
+
+\definecolor [black] [h=000000]
+\definecolor [navy] [h=000080]
+\definecolor [darkblue] [h=00008B]
+\definecolor [mediumblue] [h=0000CD]
+\definecolor [blue] [h=0000FF]
+\definecolor [darkgreen] [h=006400]
+\definecolor [green] [h=008000]
+\definecolor [teal] [h=008080]
+\definecolor [darkcyan] [h=008B8B]
+\definecolor [deepskyblue] [h=00BFFF]
+\definecolor [darkturquoise] [h=00CED1]
+\definecolor [mediumspringgreen] [h=00FA9A]
+\definecolor [lime] [h=00FF00]
+\definecolor [springgreen] [h=00FF7F]
+\definecolor [cyan] [h=00FFFF]
+\definecolor [aqua] [h=00FFFF]
+\definecolor [midnightblue] [h=191970]
+\definecolor [dodgerblue] [h=1E90FF]
+\definecolor [lightseagreen] [h=20B2AA]
+\definecolor [forestgreen] [h=228B22]
+\definecolor [seagreen] [h=2E8B57]
+\definecolor [darkslategray] [h=2F4F4F]
+\definecolor [darkslategrey] [h=2F4F4F]
+\definecolor [limegreen] [h=32CD32]
+\definecolor [mediumseagreen] [h=3CB371]
+\definecolor [turquoise] [h=40E0D0]
+\definecolor [royalblue] [h=4169E1]
+\definecolor [steelblue] [h=4682B4]
+\definecolor [darkslateblue] [h=483D8B]
+\definecolor [mediumturquoise] [h=48D1CC]
+\definecolor [indigo] [h=4B0082]
+\definecolor [darkolivegreen] [h=556B2F]
+\definecolor [cadetblue] [h=5F9EA0]
+\definecolor [cornflowerblue] [h=6495ED]
+\definecolor [mediumaquamarine] [h=66CDAA]
+\definecolor [dimgrey] [h=696969]
+\definecolor [dimgray] [h=696969]
+\definecolor [slateblue] [h=6A5ACD]
+\definecolor [olivedrab] [h=6B8E23]
+\definecolor [slategrey] [h=708090]
+\definecolor [slategray] [h=708090]
+\definecolor [lightslategray] [h=778899]
+\definecolor [lightslategrey] [h=778899]
+\definecolor [mediumslateblue] [h=7B68EE]
+\definecolor [lawngreen] [h=7CFC00]
+\definecolor [chartreuse] [h=7FFF00]
+\definecolor [aquamarine] [h=7FFFD4]
+\definecolor [maroon] [h=800000]
+\definecolor [purple] [h=800080]
+\definecolor [olive] [h=808000]
+\definecolor [gray] [h=808080]
+\definecolor [grey] [h=808080]
+\definecolor [skyblue] [h=87CEEB]
+\definecolor [lightskyblue] [h=87CEFA]
+\definecolor [blueviolet] [h=8A2BE2]
+\definecolor [darkred] [h=8B0000]
+\definecolor [darkmagenta] [h=8B008B]
+\definecolor [saddlebrown] [h=8B4513]
+\definecolor [darkseagreen] [h=8FBC8F]
+\definecolor [lightgreen] [h=90EE90]
+\definecolor [mediumpurple] [h=9370DB]
+\definecolor [darkviolet] [h=9400D3]
+\definecolor [palegreen] [h=98FB98]
+\definecolor [darkorchid] [h=9932CC]
+\definecolor [yellowgreen] [h=9ACD32]
+\definecolor [sienna] [h=A0522D]
+\definecolor [brown] [h=A52A2A]
+\definecolor [darkgray] [h=A9A9A9]
+\definecolor [darkgrey] [h=A9A9A9]
+\definecolor [lightblue] [h=ADD8E6]
+\definecolor [greenyellow] [h=ADFF2F]
+\definecolor [paleturquoise] [h=AFEEEE]
+\definecolor [lightsteelblue] [h=B0C4DE]
+\definecolor [powderblue] [h=B0E0E6]
+\definecolor [firebrick] [h=B22222]
+\definecolor [darkgoldenrod] [h=B8860B]
+\definecolor [mediumorchid] [h=BA55D3]
+\definecolor [rosybrown] [h=BC8F8F]
+\definecolor [darkkhaki] [h=BDB76B]
+\definecolor [silver] [h=C0C0C0]
+\definecolor [mediumvioletred] [h=C71585]
+\definecolor [indianred] [h=CD5C5C]
+\definecolor [peru] [h=CD853F]
+\definecolor [chocolate] [h=D2691E]
+\definecolor [tan] [h=D2B48C]
+\definecolor [lightgray] [h=D3D3D3]
+\definecolor [lightgrey] [h=D3D3D3]
+\definecolor [thistle] [h=D8BFD8]
+\definecolor [orchid] [h=DA70D6]
+\definecolor [goldenrod] [h=DAA520]
+\definecolor [palevioletred] [h=DB7093]
+\definecolor [crimson] [h=DC143C]
+\definecolor [gainsboro] [h=DCDCDC]
+\definecolor [plum] [h=DDA0DD]
+\definecolor [burlywood] [h=DEB887]
+\definecolor [lightcyan] [h=E0FFFF]
+\definecolor [lavender] [h=E6E6FA]
+\definecolor [darksalmon] [h=E9967A]
+\definecolor [violet] [h=EE82EE]
+\definecolor [palegoldenrod] [h=EEE8AA]
+\definecolor [lightcoral] [h=F08080]
+\definecolor [khaki] [h=F0E68C]
+\definecolor [aliceblue] [h=F0F8FF]
+\definecolor [honeydew] [h=F0FFF0]
+\definecolor [azure] [h=F0FFFF]
+\definecolor [sandybrown] [h=F4A460]
+\definecolor [wheat] [h=F5DEB3]
+\definecolor [beige] [h=F5F5DC]
+\definecolor [whitesmoke] [h=F5F5F5]
+\definecolor [mintcream] [h=F5FFFA]
+\definecolor [ghostwhite] [h=F8F8FF]
+\definecolor [salmon] [h=FA8072]
+\definecolor [antiquewhite] [h=FAEBD7]
+\definecolor [linen] [h=FAF0E6]
+\definecolor [lightgoldenrodyellow] [h=FAFAD2]
+\definecolor [oldlace] [h=FDF5E6]
+\definecolor [red] [h=FF0000]
+\definecolor [fuchsia] [h=FF00FF]
+\definecolor [magenta] [h=FF00FF]
+\definecolor [deeppink] [h=FF1493]
+\definecolor [orangered] [h=FF4500]
+\definecolor [tomato] [h=FF6347]
+\definecolor [hotpink] [h=FF69B4]
+\definecolor [coral] [h=FF7F50]
+\definecolor [darkorange] [h=FF8C00]
+\definecolor [lightsalmon] [h=FFA07A]
+\definecolor [orange] [h=FFA500]
+\definecolor [lightpink] [h=FFB6C1]
+\definecolor [pink] [h=FFC0CB]
+\definecolor [gold] [h=FFD700]
+\definecolor [peachpuff] [h=FFDAB9]
+\definecolor [navajowhite] [h=FFDEAD]
+\definecolor [moccasin] [h=FFE4B5]
+\definecolor [bisque] [h=FFE4C4]
+\definecolor [mistyrose] [h=FFE4E1]
+\definecolor [blanchedalmond] [h=FFEBCD]
+\definecolor [papayawhip] [h=FFEFD5]
+\definecolor [lavenderblush] [h=FFF0F5]
+\definecolor [seashell] [h=FFF5EE]
+\definecolor [cornsilk] [h=FFF8DC]
+\definecolor [lemonchiffon] [h=FFFACD]
+\definecolor [floralwhite] [h=FFFAF0]
+\definecolor [snow] [h=FFFAFA]
+\definecolor [yellow] [h=FFFF00]
+\definecolor [lightyellow] [h=FFFFE0]
+\definecolor [ivory] [h=FFFFF0]
+\definecolor [white] [h=FFFFFF]
+
+\stopprotectedcolors
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 875315830..b764c4f9a 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.09.13 17:41}
+\newcontextversion{2018.09.21 19:52}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
@@ -22,12 +22,6 @@
% math-ini.mkiv
-\ifnum\texenginefunctionality<6753\else
- \mathrulethicknessmode\zerocount
-\fi
-
-% math-ini.mkiv
-
\ifdefined\t \else \unexpanded\def\t{\mathortext\text\mathtext} \fi
\ifdefined\w \else \unexpanded\def\w{\mathortext\word\mathword} \fi
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 11e74d56e..3bdca2bef 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.09.13 17:41}
+\edef\contextversion{2018.09.21 19:52}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/core-dat.lua b/tex/context/base/mkiv/core-dat.lua
index 5f9bc9d08..dbb14c36e 100644
--- a/tex/context/base/mkiv/core-dat.lua
+++ b/tex/context/base/mkiv/core-dat.lua
@@ -36,6 +36,7 @@ local v_yes = interfaces.variables.yes
local new_latelua = nodes.pool.latelua
local implement = interfaces.implement
+local getnamespace = interfaces.getnamespace
local collected = allocate()
local tobesaved = allocate()
@@ -243,8 +244,6 @@ local function setstate(settings)
return name, tag, data
end
-pagestates.setstate = setstate
-
local function extend(name,tag)
local realpage = texgetcount("realpageno")
if trace_pagestates then
@@ -253,9 +252,7 @@ local function extend(name,tag)
tobesaved[name][tag] = realpage
end
-pagestates.extend = extend
-
-function pagestates.realpage(name,tag,default)
+local function realpage(name,tag,default)
local t = collected[name]
if t then
t = t[tag] or t[tonumber(tag)]
@@ -270,32 +267,7 @@ function pagestates.realpage(name,tag,default)
return default
end
--- local function setpagestate(settings)
--- local name, tag = setstate(settings)
--- if type(tag) == "number" then
--- context(new_latelua(formatters["job.pagestates.extend(%q,%i)"](name,tag)))
--- else
--- context(new_latelua(formatters["job.pagestates.extend(%q,%q)"](name,tag)))
--- end
--- end
-
-local function setpagestate(settings)
- local name, tag = setstate(settings)
- -- context(new_latelua(function() extend(name,tag) end))
- ctx_latelua(function() extend(name,tag) end)
-end
-
-local function pagestaterealpage(name,tag)
- local t = collected[name]
- if t then
- t = t[tag] or t[tonumber(tag)]
- if t then
- context(t)
- end
- end
-end
-
-local function pagestaterealpageorder(name,tag)
+local function realpageorder(name,tag)
local t = collected[name]
if t then
local p = t[tag]
@@ -306,11 +278,25 @@ local function pagestaterealpageorder(name,tag)
n = n +1
end
end
- context(n)
- return
+ return n
end
end
- context(0)
+ return 0
+end
+
+pagestates.setstate = setstate
+pagestates.extend = extend
+pagestates.realpage = realpage
+pagestates.realpageorder = realpageorder
+
+function pagestates.countervalue(name)
+ return name and texgetcount(getnamespace("pagestatecounter") .. name) or 0
+end
+
+local function setpagestate(settings)
+ local name, tag = setstate(settings)
+ -- context(new_latelua(function() extend(name,tag) end))
+ ctx_latelua(function() extend(name,tag) end)
end
local function setpagestaterealpageno(name,tag)
@@ -333,7 +319,7 @@ implement {
implement {
name = "pagestaterealpage",
- actions = pagestaterealpage,
+ actions = { realpage, context },
arguments = "2 strings",
}
@@ -345,6 +331,6 @@ implement {
implement {
name = "pagestaterealpageorder",
- actions = pagestaterealpageorder,
+ actions = { realpageorder, context },
arguments = { "string", "integer" }
}
diff --git a/tex/context/base/mkiv/core-dat.mkiv b/tex/context/base/mkiv/core-dat.mkiv
index b159fccf8..9f4344b99 100644
--- a/tex/context/base/mkiv/core-dat.mkiv
+++ b/tex/context/base/mkiv/core-dat.mkiv
@@ -119,6 +119,6 @@
\def\autopagestaterealpage #1{\clf_pagestaterealpage {#1}{\number\autopagestatenumber{#1}}}
\def\setautopagestaterealpageno#1{\clf_setpagestaterealpageno{#1}{\number\autopagestatenumber{#1}}}
-\def\autopagestaterealpageorder#1{\clf_pagestaterealpageorder{#1}\autopagestatenumber{#1}\relax}
+\def\autopagestaterealpageorder#1{\clf_pagestaterealpageorder{#1}\numexpr\autopagestatenumber{#1}\relax}
\protect
diff --git a/tex/context/base/mkiv/font-shp.lua b/tex/context/base/mkiv/font-shp.lua
index 6e1caf57f..6c3112b25 100644
--- a/tex/context/base/mkiv/font-shp.lua
+++ b/tex/context/base/mkiv/font-shp.lua
@@ -292,9 +292,9 @@ otf.loadshapes = loadshapes
-- experimental code, for me only ... unsupported (todo: use %N)
-local f_c = string.formatters["%F %F %F %F %F %F c"]
-local f_l = string.formatters["%F %F l"]
-local f_m = string.formatters["%F %F m"]
+local f_c = formatters["%F %F %F %F %F %F c"]
+local f_l = formatters["%F %F l"]
+local f_m = formatters["%F %F m"]
local function segmentstopdf(segments,factor,bt,et)
local t = { }
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index e9d3170af..ff37e7b6d 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -2090,22 +2090,35 @@ local function pdf_checker(data)
--
pdfdoc.nofcopiedpages = 0
--
- local info = querypdf(pdfdoc,request.page)
- local bbox = info and info.boundingbox or { 0, 0, 0, 0 }
+ local info = querypdf(pdfdoc,request.page)
+ local bbox = info and info.boundingbox or { 0, 0, 0, 0 }
+ local height = bbox[4] - bbox[2]
+ local width = bbox[3] - bbox[1]
+ local rotation = info.rotation or 0
+ if rotation == 90 then
+ rotation, height, width = 3, width, height
+ elseif rotation == 180 then
+ rotation = 2
+ elseif rotation == 270 then
+ rotation, height, width = 1, width, height
+ elseif rotation == 1 or rotation == 3 then
+ height, width = width, height
+ else
+ rotation = 0
+ end
return {
filename = filename,
-- page = 1,
pages = pdfdoc.nofpages,
- width = bbox[3] - bbox[1],
- height = bbox[4] - bbox[2],
+ width = width,
+ height = height,
depth = 0,
colordepth = 0,
xres = 0,
yres = 0,
- xsize = 0,
- ysize = 0,
- rotation = 0,
- orientation = 0,
+ xsize = width,
+ ysize = height,
+ rotation = rotation,
}
end
end
diff --git a/tex/context/base/mkiv/grph-inc.mkiv b/tex/context/base/mkiv/grph-inc.mkiv
index 97a28d2c5..62ac39864 100644
--- a/tex/context/base/mkiv/grph-inc.mkiv
+++ b/tex/context/base/mkiv/grph-inc.mkiv
@@ -657,6 +657,36 @@
\egroup
\egroup}
+% \unexpanded\def\relocateexternalfigure
+% {\global\setbox\foundexternalfigure\vpack to \ht\foundexternalfigure\bgroup
+% %
+% % The \vss can (!) introduce 1 sp excess visible in xform which in itself
+% % is not that important but some don't like these cosmetic side effects, for
+% % instance we can get:
+% %
+% % vss : \vbox(845.1575+0.0)x597.23125, glue set 845.15747fil, direction TLT
+% % vskip : \vbox(845.1575+0.0)x597.23125, direction TLT
+% %
+% % or
+% %
+% % 1 0 0 1 0 0.00003 cm
+% % 1 0 0 1 0 0 cm
+% %
+% % This is a known property of using glue and can even depend on the architecture
+% % (float implementation). Anyway, let's for now use a skip. Of course this can
+% % shift the issue elsewhere, as vss is used a lot elsewhere.
+% %
+% % \vss
+% \vskip\ht\foundexternalfigure
+% %
+% \ht\foundexternalfigure\zeropoint
+% \dp\foundexternalfigure\zeropoint
+% \hpack to \wd\foundexternalfigure\bgroup
+% \box\foundexternalfigure
+% \hss
+% \egroup
+% \egroup}
+
\unexpanded\def\startfoundexternalfigure#1#2% ht wd
{\global\setbox\foundexternalfigure\vbox to #2\bgroup\vss\hbox to #1\bgroup}
diff --git a/tex/context/base/mkiv/java-ini.mkiv b/tex/context/base/mkiv/java-ini.mkiv
index 25b8ba600..e412b9d06 100644
--- a/tex/context/base/mkiv/java-ini.mkiv
+++ b/tex/context/base/mkiv/java-ini.mkiv
@@ -55,7 +55,7 @@
%D actually include the preamble needed.
%D
%D \starttyping
-%D \startJScode{uses} uses {later}
+%D \startJScode{uses} used {later}
%D uses = 6 ;
%D \stopJScode
%D \stoptyping
diff --git a/tex/context/base/mkiv/lpdf-ano.lua b/tex/context/base/mkiv/lpdf-ano.lua
index 3d7479d6a..857e53775 100644
--- a/tex/context/base/mkiv/lpdf-ano.lua
+++ b/tex/context/base/mkiv/lpdf-ano.lua
@@ -366,14 +366,25 @@ lpdf.registerdocumentfinalizer(pdfdestinationspecification,"collect destinations
local destinations = { }
-local f_xyz = formatters["<< /D [ %i 0 R /XYZ %0.3F %0.3F null ] >>"]
+local f_xyz = formatters["<< /D [ %i 0 R /XYZ %.6F %.6F null ] >>"]
local f_fit = formatters["<< /D [ %i 0 R /Fit ] >>"]
local f_fitb = formatters["<< /D [ %i 0 R /FitB ] >>"]
-local f_fith = formatters["<< /D [ %i 0 R /FitH %0.3F ] >>"]
-local f_fitv = formatters["<< /D [ %i 0 R /FitV %0.3F ] >>"]
-local f_fitbh = formatters["<< /D [ %i 0 R /FitBH %0.3F ] >>"]
-local f_fitbv = formatters["<< /D [ %i 0 R /FitBV %0.3F ] >>"]
-local f_fitr = formatters["<< /D [ %i 0 R /FitR %0.3F %0.3F %0.3F %0.3F ] >>"]
+local f_fith = formatters["<< /D [ %i 0 R /FitH %.6F ] >>"]
+local f_fitv = formatters["<< /D [ %i 0 R /FitV %.6F ] >>"]
+local f_fitbh = formatters["<< /D [ %i 0 R /FitBH %.6F ] >>"]
+local f_fitbv = formatters["<< /D [ %i 0 R /FitBV %.6F ] >>"]
+local f_fitr = formatters["<< /D [ %i 0 R /FitR %.6F %.6F %.6F %.6F ] >>"]
+
+directives.register("pdf.stripzeros",function()
+ f_xyz = formatters["<< /D [ %i 0 R /XYZ %.6N %.6N null ] >>"]
+ f_fit = formatters["<< /D [ %i 0 R /Fit ] >>"]
+ f_fitb = formatters["<< /D [ %i 0 R /FitB ] >>"]
+ f_fith = formatters["<< /D [ %i 0 R /FitH %.6N ] >>"]
+ f_fitv = formatters["<< /D [ %i 0 R /FitV %.6N ] >>"]
+ f_fitbh = formatters["<< /D [ %i 0 R /FitBH %.6N ] >>"]
+ f_fitbv = formatters["<< /D [ %i 0 R /FitBV %.6N ] >>"]
+ f_fitr = formatters["<< /D [ %i 0 R /FitR %.6N %.6N %.6N %.6N ] >>"]
+end)
local v_standard = variables.standard
local v_frame = variables.frame
@@ -742,9 +753,15 @@ local nofused = 0
local nofspecial = 0
local share = true
-local f_annot = formatters["<< /Type /Annot %s /Rect [ %0.3F %0.3F %0.3F %0.3F ] >>"]
+local f_annot = formatters["<< /Type /Annot %s /Rect [ %0.6F %0.6F %0.6F %0.6F ] >>"]
+
+directives.register("pdf.stripzeros",function()
+ f_annot = formatters["<< /Type /Annot %s /Rect [ %0.6N %0.6N %0.6N %0.6N ] >>"]
+end)
-directives.register("references.sharelinks", function(v) share = v end)
+directives.register("references.sharelinks", function(v)
+ share = v
+end)
setmetatableindex(hashed,function(t,k)
local v = pdfdelayedobject(k)
diff --git a/tex/context/base/mkiv/lpdf-col.lua b/tex/context/base/mkiv/lpdf-col.lua
index bb7e933aa..3a541f962 100644
--- a/tex/context/base/mkiv/lpdf-col.lua
+++ b/tex/context/base/mkiv/lpdf-col.lua
@@ -64,13 +64,20 @@ local f_cmyk = formatters["%.3F %.3F %.3F %.3F k %.3F %.3F %.3F %.3F K"]
local f_spot = formatters["/%s cs /%s CS %s SCN %s scn"]
local f_tr = formatters["Tr%s"]
local f_cm = formatters["q %.6F %.6F %.6F %.6F %.6F %.6F cm"]
-local f_effect = formatters["%s Tc %s w %s Tr"]
+local f_effect = formatters["%s Tc %s w %s Tr"] -- %.3F ?
local f_tr_gs = formatters["/Tr%s gs"]
local f_num_1 = tostring
local f_num_2 = formatters["%s %s"]
local f_num_3 = formatters["%s %s %s"]
local f_num_4 = formatters["%s %s %s %s"]
+directives.register("pdf.stripzeros",function()
+ f_gray = formatters["%.3N g %.3N G"]
+ f_rgb = formatters["%.3N %.3N %.3N rg %.3N %.3N %.3N RG"]
+ f_cmyk = formatters["%.3N %.3N %.3N %.3N k %.3N %.3N %.3N %.3N K"]
+ f_cm = formatters["q %.6N %.6N %.6N %.6N %.6N %.6N cm"]
+end)
+
local report_color = logs.reporter("colors","backend")
-- page groups (might move to lpdf-ini.lua)
@@ -717,6 +724,10 @@ do
local f_slant = formatters["q 1 0 %.6F 1 0 0 cm"]
+ directives.register("pdf.stripzeros",function()
+ f_slant = formatters["q 1 0 %.6N 1 0 0 cm"]
+ end)
+
-- local fillcolors = {
-- red = { "pdf", "origin", "1 0 0 rg" },
-- green = { "pdf", "origin", "0 1 0 rg" },
diff --git a/tex/context/base/mkiv/lpdf-epa.lua b/tex/context/base/mkiv/lpdf-epa.lua
index 1d0b9e8b2..9f1dc0611 100644
--- a/tex/context/base/mkiv/lpdf-epa.lua
+++ b/tex/context/base/mkiv/lpdf-epa.lua
@@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['lpdf-epa'] = {
-- Links can also have quadpoint
+-- embedded files ... not bound to a page
+
local type, tonumber, next = type, tonumber, next
local format, gsub, lower, find = string.format, string.gsub, string.lower, string.find
local formatters = string.formatters
@@ -908,8 +910,8 @@ function codeinjections.getbookmarks(filename)
end
end
end
- else
- -- maybe
+ -- elseif subtype then
+ -- report("unsupported bookmark action %a",subtype)
end
else
local destination = current.Dest
@@ -924,6 +926,8 @@ function codeinjections.getbookmarks(filename)
local pagedata = destination and destination[1]
if pagedata and pagedata.Type == "Page" then
entry.realpage = pagedata.number
+ -- else
+ -- report("unsupported bookmark destination (no page)")
end
end
end
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index c53d90848..f19245f06 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -457,8 +457,8 @@ do
local f_dictionary = formatters["<< % t >>"]
local f_key_array = formatters["/%s [ % t ]"]
local f_array = formatters["[ % t ]"]
- local f_key_number = formatters["/%s %N"]
- local f_tonumber = formatters["%N"]
+ local f_key_number = formatters["/%s %N"] -- always with max 9 digits and integer is possible
+ local f_tonumber = formatters["%N"] -- always with max 9 digits and integer is possible
tostring_d = function(t,contentonly,key)
if next(t) then
diff --git a/tex/context/base/mkiv/lpdf-mis.lua b/tex/context/base/mkiv/lpdf-mis.lua
index 679824345..b9112457a 100644
--- a/tex/context/base/mkiv/lpdf-mis.lua
+++ b/tex/context/base/mkiv/lpdf-mis.lua
@@ -81,6 +81,10 @@ local negative = register(pdfpageliteral("/GSnegative gs"))
local overprint = register(pdfpageliteral("/GSoverprint gs"))
local knockout = register(pdfpageliteral("/GSknockout gs"))
+local omitextraboxes = false
+
+directives.register("backend.omitextraboxes", function(v) omitextraboxes = v end)
+
local function initializenegative()
local a = pdfarray { 0, 1 }
local g = pdfconstant("ExtGState")
@@ -495,17 +499,22 @@ end
-- temp hack: the mediabox is not under our control and has a precision of 5 digits
local factor = number.dimenfactors.bp
-local f_value = formatters["%0.6F"]
+local f_value = formatters["%.6F"]
+
+directives.register("pdf.stripzeros",function()
+ local f_value = formatters["%.6N"]
+end)
local function boxvalue(n) -- we could share them
return pdfverbose(f_value(factor * n))
end
local function pagespecification()
+ local pht = texget("pageheight")
local llx = leftoffset
- local lly = texget("pageheight") + topoffset - height
+ local lly = pht + topoffset - height
local urx = width - leftoffset
- local ury = texget("pageheight") - topoffset
+ local ury = pht - topoffset
-- boxes can be cached
local function extrabox(WhatBox,offset,always)
if offset ~= 0 or always then
@@ -517,10 +526,14 @@ local function pagespecification()
})
end
end
- extrabox("CropBox",cropoffset,true) -- mandate for rendering
- extrabox("TrimBox",trimoffset,true) -- mandate for pdf/x
- extrabox("BleedBox",bleedoffset) -- optional
- -- extrabox("ArtBox",artoffset) -- optional .. unclear what this is meant to do
+ if omitextraboxes then
+ -- only useful for testing / comparing
+ else
+ extrabox("CropBox",cropoffset,true) -- mandate for rendering
+ extrabox("TrimBox",trimoffset,true) -- mandate for pdf/x
+ extrabox("BleedBox",bleedoffset) -- optional
+ -- extrabox("ArtBox",artoffset) -- optional .. unclear what this is meant to do
+ end
end
lpdf.registerpagefinalizer(pagespecification,"page specification")
diff --git a/tex/context/base/mkiv/lpdf-nod.lua b/tex/context/base/mkiv/lpdf-nod.lua
index ec71571d2..2f9282a10 100644
--- a/tex/context/base/mkiv/lpdf-nod.lua
+++ b/tex/context/base/mkiv/lpdf-nod.lua
@@ -63,6 +63,15 @@ function nodepool.pdfrestore()
return copy_node(pdfrestore)
end
+local s_matrix_0 = "1 0 0 1"
+local f_matrix_2 = formatters["%.6F 0 0 %.6F"]
+local f_matrix_4 = formatters["%.6F %.6F %.6F %.6F"]
+
+directives.register("pdf.stripzeros",function()
+ f_matrix_2 = formatters["%.6N 0 0 %.6N"]
+ f_matrix_4 = formatters["%.6N %.6N %.6N %.6N"]
+end)
+
function nodepool.pdfsetmatrix(rx,sx,sy,ry,tx,ty) -- todo: tx ty
local t = copy_node(pdfsetmatrix)
if type(rx) == "string" then
@@ -86,12 +95,12 @@ function nodepool.pdfsetmatrix(rx,sx,sy,ry,tx,ty) -- todo: tx ty
end
if sx == 0 and sy == 0 then
if rx == 1 and ry == 1 then
- setdata(t,"1 0 0 1")
+ setdata(t,s_matrix_0)
else
- setdata(t,formatters["%0.6F 0 0 %0.6F"](rx,ry))
+ setdata(t,f_matrix_2(rx,ry))
end
else
- setdata(t,formatters["%0.6F %0.6F %0.6F %0.6F"](rx,sx,sy,ry))
+ setdata(t,f_matrix_4(rx,sx,sy,ry))
end
end
return t
diff --git a/tex/context/base/mkiv/lpdf-pde.lua b/tex/context/base/mkiv/lpdf-pde.lua
index cecb1447f..819143a3b 100644
--- a/tex/context/base/mkiv/lpdf-pde.lua
+++ b/tex/context/base/mkiv/lpdf-pde.lua
@@ -7,6 +7,10 @@ if not modules then modules = { } end modules ['lpdf-epd'] = {
history = "this one replaces the poppler/pdfe binding",
}
+-- \enabledirectives[graphics.pdf.uselua]
+-- \enabledirectives[graphics.pdf.recompress]
+-- \enabledirectives[graphics.pdf.stripmarked]
+
-- maximum integer : +2^32
-- maximum real : +2^15
-- minimum real : 1/(2^16)
@@ -79,6 +83,8 @@ local report_epdf = logs.reporter("epdf")
local allocate = utilities.storage.allocate
+local bpfactor = number.dimenfactors.bp
+
local objectcodes = {
[0] = "none",
"null",
@@ -434,6 +440,7 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword)
end
if getstatus(__data__) < 0 then
report_epdf("the document is encrypted, provide proper passwords",getstatus(__data__))
+ __data__ = false
end
if __data__ then
document = {
@@ -500,27 +507,66 @@ lpdf_epdf.expanded = expanded
-- we could resolve the text stream in one pass if we directly handle the
-- font but why should we complicate things
-local hexdigit = R("09","AF")
-local numchar = ( P("\\") * ( (R("09")^3/tonumber) + C(1) ) ) + C(1)
-local number = lpegpatterns.number / tonumber
local spaces = lpegpatterns.whitespace^1
local optspaces = lpegpatterns.whitespace^0
-local keyword = P("/") * C(R("AZ","az","09")^1)
-local operator = C((R("AZ","az")+P("'")+P('"'))^1)
+local numchar = P("\\")/"" * (R("09")^3/function(s) return char(tonumber(s,8)) end)
+ + P("\\") * P(1)
+local key = P("/") * C(R("AZ","az","09","__")^1)
+local number = Ct(Cc("number") * (lpegpatterns.number/tonumber))
+local keyword = Ct(Cc("name") * key)
+local operator = C((R("AZ","az")+P("*")+P("'")+P('"'))^1)
local grammar = P { "start",
- start = (keyword + number + V("dictionary") + V("unicode") + V("string") + V("unicode")+ V("array") + spaces)^1,
- -- keyvalue = (keyword * spaces * V("start") + spaces)^1,
- keyvalue = optspaces * Cf(Ct("") * Cg(keyword * optspaces * V("start") * optspaces)^1,rawset),
- array = P("[") * Ct(V("start")^1) * P("]"),
- dictionary = P("<<") * V("keyvalue") * P(">>"),
- unicode = P("<") * Ct(Cc("hex") * C((1-P(">"))^1)) * P(">"),
- string = P("(") * Ct(Cc("dec") * C((V("string")+numchar)^1)) * P(")"), -- untested
+ start = (keyword + number + V("dictionary") + V("array") + V("hexstring") + V("decstring") + spaces)^1,
+ keyvalue = key * optspaces * V("start"),
+ array = Ct(Cc("array") * P("[") * Ct(V("start")^1) * P("]")),
+ dictionary = Ct(Cc("dict") * P("<<") * Ct(V("keyvalue")^1) * P(">>")),
+ hexstring = Ct(Cc("hex") * P("<") * Cs(( 1-P(">"))^1) * P(">")),
+ decstring = Ct(Cc("dec") * P("(") * Cs((numchar+1-(P")"))^1) * P(")")), -- untested
}
local operation = Ct(grammar^1 * operator)
local parser = Ct((operation + P(1))^1)
+-- todo: speed this one up
+
+local numchar = P("\\") * (R("09")^3 + P(1))
+local number = lpegpatterns.number
+local keyword = P("/") * R("AZ","az","09","__")^1
+local operator = (R("AZ","az")+P("*")+P("'")+P('"'))^1
+
+local skipstart = P("BDC") + P("BMC") + P("DP") + P("MP")
+local skipstop = P("EMC")
+local skipkeep = P("/ActualText")
+
+local grammar = P { "skip",
+ start = keyword + number + V("dictionary") + V("array") + V("hexstring") + V("decstring") + spaces,
+ keyvalue = optspaces * (keyword * optspaces * V("start") * optspaces)^1,
+ xeyvalue = optspaces * ((keyword - skipkeep) * optspaces * V("start") * optspaces)^1,
+ array = P("[") * V("start")^0 * P("]"),
+ dictionary = P("<<") * V("keyvalue")^0 * P(">>"),
+ xictionary = P("<<") * V("xeyvalue")^0 * P(">>"),
+ hexstring = P("<") * ( 1-P(">"))^0 * P(">"),
+ decstring = P("(") * (numchar+1-(P")"))^0 * P(")"),
+ skip = (optspaces * ( keyword * optspaces * V("xictionary") * optspaces * skipstart + skipstop) / "")
+ + V("start")
+ + operator
+}
+
+local stripper = Cs((grammar + P(1))^1)
+
+function lpdf_epdf.parsecontent(str)
+ return lpegmatch(parser,str)
+end
+
+function lpdf_epdf.stripcontent(str)
+ if find(str,"EMC") then
+ return lpegmatch(stripper,str)
+ else
+ return str
+ end
+end
+
-- beginbfrange : <start> <stop> <firstcode>
-- <start> <stop> [ <firstsequence> <firstsequence> <firstsequence> ]
-- beginbfchar : <code> <newcodes>
@@ -742,8 +788,8 @@ if img then do
-- This can be made a bit faster (just get raw data and pass it) but I will
-- do that later. In the end the benefit is probably neglectable.
- local recompress = true
local recompress = false
+ local stripmarked = false
local copydictionary = nil
local copyarray = nil
@@ -765,10 +811,21 @@ if img then do
local newimage = img.new
+ directives.register("graphics.pdf.recompress", function(v) recompress = v end)
+ directives.register("graphics.pdf.stripmarked", function(v) stripmarked = v end)
+
local function scaledbbox(b)
return { b[1]*factor, b[2]*factor, b[3]*factor, b[4]*factor }
end
+ local codecs = {
+ ASCIIHexDecode = true,
+ ASCII85Decode = true,
+ RunLengthDecode = true,
+ FlateDecode = true,
+ LZWDecode = true,
+ }
+
local function deepcopyobject(xref,copied,value)
-- no need for tables, just nested loop with obj
local objnum = xref[value]
@@ -789,11 +846,12 @@ if img then do
pdfflushobject(usednum,tostring(d))
elseif kind == stream_code then
local d = copydictionary(xref,copied,entry)
- if recompress then
+ local filter = d.Filter
+ if filter and codecs[filter] and recompress then
-- recompress
d.Filter = nil
d.Length = nil
- d.DecodeParms = nil -- not relevant
+ d.DecodeParms = nil -- relates to filter
d.DL = nil -- needed?
local s = entry() -- get uncompressed stream
pdfflushstreamobject(s,d,true,usednum) -- compress stream
@@ -952,6 +1010,7 @@ if img then do
bleedbox = page.BleedBox or cropbox,
trimbox = page.TrimBox or cropbox,
artbox = page.ArtBox or cropbox,
+ rotation = page.Rotate or 0,
}
end
end
@@ -987,7 +1046,14 @@ if img then do
-- we always recompress because image object streams can not be
-- influenced (yet)
if ctype == stream_code then
- if recompress then
+ if stripmarked then
+ content = contents() -- uncompressed
+ local stripped = lpdf_epdf.stripcontent(content)
+ if stripped ~= content then
+ -- report("%i bytes stripped on page %i",#content-#stripped,pagenumber or 1)
+ content = stripped
+ end
+ elseif recompress then
content = contents() -- uncompressed
else
local Filter = copyobject(xref,copied,contents,"Filter")
@@ -1010,11 +1076,24 @@ if img then do
end
-- still not nice: we double wrap now
plugins = nil
+ local rotation = pageinfo.rotation
+ local boundingbox = pageinfo.boundingbox
+ local transform = nil
+ if rotation == 90 then
+ transform = 3
+ elseif rotation == 180 then
+ transform = 2
+ elseif rotation == 270 then
+ transform = 1
+ elseif rotation > 1 and rotation < 4 then
+ transform = rotation
+ end
return newimage {
- bbox = pageinfo.boundingbox,
- nolength = nolength,
- stream = content, -- todo: no compress, pass directly also length, filter etc
- attr = xobject(),
+ bbox = boundingbox,
+ transform = transform,
+ nolength = nolength,
+ stream = content, -- todo: no compress, pass directly also length, filter etc
+ attr = xobject(),
}
end
end
diff --git a/tex/context/base/mkiv/lpdf-u3d.lua b/tex/context/base/mkiv/lpdf-u3d.lua
index dfd4c1b06..2a45a1eb5 100644
--- a/tex/context/base/mkiv/lpdf-u3d.lua
+++ b/tex/context/base/mkiv/lpdf-u3d.lua
@@ -347,6 +347,12 @@ end
local stored_js, stored_3d, stored_pr, streams = { }, { }, { }, { }
+local f_image = formatters["q /GS gs %.6F 0 0 %.6F 0 0 cm /IM Do Q"]
+
+directives.register("pdf.stripzeros",function()
+ f_image = formatters["q /GS gs %.6N 0 0 %.6N 0 0 cm /IM Do Q"]
+end)
+
local function insert3d(spec) -- width, height, factor, display, controls, label, foundname
local width, height, factor = spec.width, spec.height, spec.factor or number.dimenfactors.bp
@@ -461,7 +467,7 @@ local function insert3d(spec) -- width, height, factor, display, controls, label
},
ProcSet = pdfarray { pdfconstant("PDF"), pdfconstant("ImageC") },
}
- local pwd = pdfflushstreamobject(formatters["q /GS gs %.6F 0 0 %.6F 0 0 cm /IM Do Q"](factor*width,factor*height),pw)
+ local pwd = pdfflushstreamobject(f_image(factor*width,factor*height),pw)
annot.AP = pdfdictionary {
N = pdfreference(pwd)
}
diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua
index 11cd80623..5793fc723 100644
--- a/tex/context/base/mkiv/lpdf-wid.lua
+++ b/tex/context/base/mkiv/lpdf-wid.lua
@@ -29,7 +29,7 @@ local gmatch, gsub, find, lower = string.gmatch, string.gsub, string.find, strin
local stripstring = string.strip
local settings_to_array = utilities.parsers.settings_to_array
local settings_to_hash = utilities.parsers.settings_to_hash
-local sortedhash = table.sortedhash
+local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
local report_media = logs.reporter("backend","media")
local report_attachment = logs.reporter("backend","attachment")
@@ -141,6 +141,10 @@ local attachment_symbols = {
attachment_symbols.PushPin = attachment_symbols.Pushpin
attachment_symbols.Default = attachment_symbols.Pushpin
+function lpdf.attachmentsymbols()
+ return sortedkeys(comment_symbols)
+end
+
local comment_symbols = {
Comment = pdfconstant("Comment"),
Help = pdfconstant("Help"),
@@ -154,6 +158,10 @@ local comment_symbols = {
comment_symbols.NewParagraph = Newparagraph
comment_symbols.Default = Note
+function lpdf.commentsymbols()
+ return sortedkeys(comment_symbols)
+end
+
local function analyzesymbol(symbol,collection)
if not symbol or symbol == "" then
return collection and collection.Default, nil
@@ -419,7 +427,8 @@ function codeinjections.attachmentid(filename) -- not used in context
return filestreams[filename]
end
-local nofcomments, usepopupcomments = 0, false
+local nofcomments = 0
+local usepopupcomments = false
local defaultattributes = {
["xmlns"] = "http://www.w3.org/1999/xhtml",
diff --git a/tex/context/base/mkiv/luat-run.lua b/tex/context/base/mkiv/luat-run.lua
index 3856575a9..4172201c2 100644
--- a/tex/context/base/mkiv/luat-run.lua
+++ b/tex/context/base/mkiv/luat-run.lua
@@ -115,6 +115,27 @@ local function wrapup_synctex()
synctex.wrapup()
end
+-- For Taco ...
+
+local sequencers = utilities.sequencers
+local appendgroup = sequencers.appendgroup
+local appendaction = sequencers.appendaction
+local wrapupactions = sequencers.new { }
+
+appendgroup(wrapupactions,"system")
+appendgroup(wrapupactions,"user")
+
+local function wrapup_run()
+ local runner = wrapupactions.runner
+ if runner then
+ runner()
+ end
+end
+
+function luatex.wrapup(action)
+ appendaction(wrapupactions,"user",action)
+end
+
-- this can be done later
callbacks.register('start_run', start_run, "actions performed at the beginning of a run")
@@ -135,7 +156,7 @@ callbacks.register('process_output_buffer', false, "actions perf
callbacks.register("pre_dump", pre_dump_actions, "lua related finalizers called before we dump the format") -- comes after \everydump
callbacks.register("finish_synctex", wrapup_synctex, "rename temporary synctex file")
-callbacks.register('wrapup_run', false, "actions performed after closing files")
+callbacks.register('wrapup_run', wrapup_run, "actions performed after closing files")
-- temp hack for testing:
diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua
index 0e8f2541c..adef0f0ce 100644
--- a/tex/context/base/mkiv/lxml-tex.lua
+++ b/tex/context/base/mkiv/lxml-tex.lua
@@ -2461,7 +2461,7 @@ end
-- parameters
-function lxml.setatt(id,name,value)
+local function setatt(id,name,value)
local e = getid(id)
if e then
local a = e.at
@@ -2473,7 +2473,7 @@ function lxml.setatt(id,name,value)
end
end
-function lxml.setpar(id,name,value)
+local function setpar(id,name,value)
local e = getid(id)
if e then
local p = e.pa
@@ -2485,6 +2485,9 @@ function lxml.setpar(id,name,value)
end
end
+lxml.setatt = setatt
+lxml.setpar = setpar
+
function lxml.setattribute(id,pattern,name,value)
local collected = xmlapplylpath(getid(id),pattern)
if collected then
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index 94d26fce7..ce0b37f4a 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -2481,13 +2481,12 @@
% I need to decide:
%
-%mathscriptboxmode \zerocount % no kerning
-%mathscriptboxmode \plusone % lists
-\mathscriptboxmode \plustwo % lists and boxes
-\mathscriptcharmode\plusone % lists and boxes
-%mathscriptboxmode \plusthree % lists and boxes with \boundary=1 (also for testing and demo)
-
-\mathrulethicknessmode\plusone
+%mathscriptboxmode \zerocount % no kerning
+%mathscriptboxmode \plusone % lists
+\mathscriptboxmode \plustwo % lists and boxes
+\mathscriptcharmode \plusone % lists and boxes
+%mathscriptboxmode \plusthree % lists and boxes with \boundary=1 (also for testing and demo)
+\mathrulethicknessmode\plusone % adaptive
\unexpanded\def\mathtext {\mathortext{\math_text_choice_font\relax}\hbox}
\unexpanded\def\mathword {\mathortext{\math_text_choice_word\relax}\hbox}
diff --git a/tex/context/base/mkiv/meta-blb.lua b/tex/context/base/mkiv/meta-blb.lua
index 76e9e3362..23d069d1e 100644
--- a/tex/context/base/mkiv/meta-blb.lua
+++ b/tex/context/base/mkiv/meta-blb.lua
@@ -13,6 +13,7 @@ local tonumber = tonumber
local setmetatableindex = table.setmetatableindex
local insert, remove = table.insert, table.remove
+local formatters = string.formatters
local topoints = number.topoints
local mpprint = mp.print
@@ -139,10 +140,15 @@ function mp.mf_blob_dimensions(category,i)
end
end
-local f_f = string.formatters["%F"]
local sxsy = metapost.sxsy
local cm = metapost.cm
+local f_f = formatters["%.6F"]
+
+directives.register("pdf.stripzeros",function()
+ f_f = formatters["%.6N"]
+end)
+
local function injectblob(object,blob)
local sx, rx, ry, sy, tx, ty = cm(object)
local wd, ht, dp = blob_raw_dimensions(blob)
diff --git a/tex/context/base/mkiv/meta-pdf.lua b/tex/context/base/mkiv/meta-pdf.lua
index 4a185cebd..3060508b4 100644
--- a/tex/context/base/mkiv/meta-pdf.lua
+++ b/tex/context/base/mkiv/meta-pdf.lua
@@ -42,8 +42,13 @@ local mptopdf = metapost.mptopdf
mptopdf.nofconverted = 0
-local f_translate = formatters["1 0 0 0 1 %F %F cm"] -- no %s due to 1e-035 issues
-local f_concat = formatters["%F %F %F %F %F %F cm"] -- no %s due to 1e-035 issues
+local f_translate = formatters["1 0 0 0 1 %.6F %.6F cm"]
+local f_concat = formatters["%.6F %.6F %.6F %.6F %.6F %.6F cm"]
+
+directives.register("pdf.stripzeros",function()
+ f_translate = formatters["1 0 0 0 1 %.6N %.6N cm"]
+ f_concat = formatters["%.6N %.6N %.6N %.6N %.6N %.6N cm"]
+end)
local m_path, m_stack, m_texts, m_version, m_date, m_shortcuts = { }, { }, { }, 0, 0, false
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index d032d291c..649d57c61 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -308,7 +308,7 @@ local function prepareddata(data,collapse)
end
end
-metapost.use_one_pass = true -- Some day I will priune the code (still testing).
+metapost.use_one_pass = true -- Some day I will prune the code (still testing).
metapost.defaultformat = "metafun"
metapost.defaultinstance = "metafun"
diff --git a/tex/context/base/mkiv/mult-ini.lua b/tex/context/base/mkiv/mult-ini.lua
index 3f320bf7f..0c8581281 100644
--- a/tex/context/base/mkiv/mult-ini.lua
+++ b/tex/context/base/mkiv/mult-ini.lua
@@ -105,6 +105,22 @@ function interfaces.getnamespace(n)
return usednamespaces[n] .. ">"
end
+if documentdata then
+
+ local prefix, getmacro
+
+ function documentdata.variable(name)
+ if not prefix then
+ prefix = usednamespaces.variables .. ">document:"
+ end
+ if not getmacro then
+ getmacro = tokens.getters.macro
+ end
+ return getmacro(prefix..name)
+ end
+
+end
+
local function resolve(t,k)
local v = logs.reporter(k)
t[k] = v
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 1dd9b149a..9eaaa1850 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -182,6 +182,8 @@ return {
"sixthargumentfalse", "sixthargumenttrue",
"seventhargumentfalse", "seventhargumenttrue",
--
+ "vkern", "hkern",
+ --
"doglobal", "dodoglobal", "redoglobal", "resetglobal",
--
"donothing", "dontcomplain", "forgetall",
diff --git a/tex/context/base/mkiv/pack-bar.mkiv b/tex/context/base/mkiv/pack-bar.mkiv
index c4b3fca62..b67d6f14b 100644
--- a/tex/context/base/mkiv/pack-bar.mkiv
+++ b/tex/context/base/mkiv/pack-bar.mkiv
@@ -75,7 +75,7 @@
{\hpack to \hsize
{\setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
- \leaders\vrule\hskip\zeropoint\s!plus \numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
+ \leaders\vrule\hskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
\vrule\s!width\zeropoint\s!height\positionbarparameter\c!height\s!depth\positionbarparameter\c!depth
\hskip\zeropoint\s!plus \positionbarparameter\c!max\s!fill
\hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}}
diff --git a/tex/context/base/mkiv/pack-obj.mkiv b/tex/context/base/mkiv/pack-obj.mkiv
index aeb5cb4f4..605dfdb02 100644
--- a/tex/context/base/mkiv/pack-obj.mkiv
+++ b/tex/context/base/mkiv/pack-obj.mkiv
@@ -65,14 +65,8 @@
\newconstant\c_pack_objects_offset_mode % 0=tex 1=box
-\unexpanded\def\pack_objects_temp_check % this will go away
- {\ifnum\texenginefunctionality<6401\relax
- \c_pack_objects_offset_mode\zerocount
- \fi}
-
\unexpanded\def\pack_objects_set_yes#1#2%
- {\pack_objects_temp_check % this will go away
- \ifcase\c_pack_objects_offset_mode
+ {\ifcase\c_pack_objects_offset_mode
\ifzeropt\objectoff
\pack_objects_package_nop\nextbox
\else
@@ -86,8 +80,7 @@
\endgroup}
\unexpanded\def\pack_objects_set_nop#1#2%
- {\pack_objects_temp_check % this will go away
- \ifcase\c_pack_objects_offset_mode
+ {\ifcase\c_pack_objects_offset_mode
\ifzeropt\objectoff
\pack_objects_package_nop\nextbox
\else
diff --git a/tex/context/base/mkiv/page-box.mkvi b/tex/context/base/mkiv/page-box.mkvi
index 083a94390..6da75b781 100644
--- a/tex/context/base/mkiv/page-box.mkvi
+++ b/tex/context/base/mkiv/page-box.mkvi
@@ -15,7 +15,7 @@
\unprotect
-%D The often two step approach (_indeed) saves skippign tokens
+%D The often two step approach (_indeed) saves skipping tokens
%D which is nicer for tracing.
%D Centering the paper area on the print area is determined
@@ -252,10 +252,7 @@
{\setbox#1\vpack to \paperheight
{\hsize\paperwidth
\vskip\topspace
- \doifbothsides
- {\hskip\backspace}
- {\hskip\backspace}
- {\hskip\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
+ \hskip\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
\box#1}%
\dp#1\zeropoint}
diff --git a/tex/context/base/mkiv/page-ffl.mkiv b/tex/context/base/mkiv/page-ffl.mkiv
index 5536371a7..e94bffa64 100644
--- a/tex/context/base/mkiv/page-ffl.mkiv
+++ b/tex/context/base/mkiv/page-ffl.mkiv
@@ -84,26 +84,29 @@
\def\strc_floats_facing_flush
{\ifnum\c_strc_floats_flushed<\c_strc_floats_saved
- \global\advance\c_strc_floats_flushed\plusone
- \floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
- \forgetall
- \ifconditional\c_page_one_top_of_insert
- \ifconditional\c_page_one_correct_top_insert
- \topskipcorrection % [xx] new: see icare topbleed
- \kern-\lineskip
- \par
- \prevdepth\maxdimen
- \fi
+ \strc_floats_facing_flush_indeed % less tracing
+ \fi}
+
+\def\strc_floats_facing_flush_indeed
+ {\global\advance\c_strc_floats_flushed\plusone
+ \floatingpenalty\zerocount
+ \insert\namedinsertionnumber\s!topfloat\bgroup
+ \forgetall
+ \ifconditional\c_page_one_top_of_insert
+ \ifconditional\c_page_one_correct_top_insert
+ \topskipcorrection % [xx] new: see icare topbleed
+ \kern-\lineskip
+ \par
+ \prevdepth\maxdimen
\fi
- \directboxfromcache{\currentfacingfloat}{\number\c_strc_floats_flushed}%
- \vskip\s_page_one_between_top_insert
- \egroup
- \ifnum\c_strc_floats_saved=\c_strc_floats_flushed
- \global\c_strc_floats_saved \zerocount
- \global\c_strc_floats_flushed\zerocount
- \resetboxesincache{\currentfacingfloat}%
\fi
+ \directboxfromcache{\currentfacingfloat}{\number\c_strc_floats_flushed}%
+ \vskip\s_page_one_between_top_insert
+ \egroup
+ \ifnum\c_strc_floats_saved=\c_strc_floats_flushed
+ \global\c_strc_floats_saved \zerocount
+ \global\c_strc_floats_flushed\zerocount
+ \resetboxesincache{\currentfacingfloat}%
\fi}
\unexpanded\def\strc_floats_facing_setup
diff --git a/tex/context/base/mkiv/page-inf.mkiv b/tex/context/base/mkiv/page-inf.mkiv
index 2064f9f25..d6a7635f9 100644
--- a/tex/context/base/mkiv/page-inf.mkiv
+++ b/tex/context/base/mkiv/page-inf.mkiv
@@ -122,4 +122,6 @@
\setupversion % resets
[\v!final]
+\let\page_info_add_to_box\gobbleoneargument
+
\protect \endinput
diff --git a/tex/context/base/mkiv/page-one.mkiv b/tex/context/base/mkiv/page-one.mkiv
index 27b5ae022..bfd0a2838 100644
--- a/tex/context/base/mkiv/page-one.mkiv
+++ b/tex/context/base/mkiv/page-one.mkiv
@@ -313,38 +313,44 @@
\unexpanded\def\page_one_command_flush_top_insertions
{\ifvoid\namedinsertionnumber\s!topfloat\else
- \ifgridsnapping
- \box\namedinsertionnumber\s!topfloat
- \vskip-\topskip
- \vskip\strutheight % [xx] new: see icare topbleed
- \else
- \ifcase\c_page_floats_insertions_topskip_mode
- % 0: default, do nothing
- \or
- % 1: no topskip (crossed fingers)
- \vskip-\topskip
- \vskip\strutheight
- \fi
- \unvbox\namedinsertionnumber\s!topfloat
- \fi
+ \page_one_command_flush_top_insertions_indeed % less tracing
\fi
\global\d_page_floats_inserted_top\zeropoint}
+\def\page_one_command_flush_top_insertions_indeed
+ {\ifgridsnapping
+ \box\namedinsertionnumber\s!topfloat
+ \vskip-\topskip
+ \vskip\strutheight % [xx] new: see icare topbleed
+ \else
+ \ifcase\c_page_floats_insertions_topskip_mode
+ % 0: default, do nothing
+ \or
+ % 1: no topskip (crossed fingers)
+ \vskip-\topskip
+ \vskip\strutheight
+ \fi
+ \unvbox\namedinsertionnumber\s!topfloat
+ \fi}
+
\unexpanded\def\page_one_command_flush_bottom_insertions
{\ifvoid\namedinsertionnumber\s!bottomfloat\else
- \ifgridsnapping
- % \floatparameter\c!bottombefore
- \snaptogrid\hbox{\box\namedinsertionnumber\s!bottomfloat}%
- % \floatparameter\c!bottomafter
- \else
- \floatparameter\c!bottombefore
- \unvbox\namedinsertionnumber\s!bottomfloat
- \floatparameter\c!bottomafter
- \fi
+ \page_one_command_flush_bottom_insertions_indeed
\fi
\global\d_page_floats_inserted_bottom\zeropoint
\global\setfalse\c_page_floats_not_permitted}
+\def\page_one_command_flush_bottom_insertions_indeed
+ {\ifgridsnapping
+ % \floatparameter\c!bottombefore
+ \snaptogrid\hbox{\box\namedinsertionnumber\s!bottomfloat}%
+ % \floatparameter\c!bottomafter
+ \else
+ \floatparameter\c!bottombefore
+ \unvbox\namedinsertionnumber\s!bottomfloat
+ \floatparameter\c!bottomafter
+ \fi}
+
\unexpanded\def\page_one_command_flush_floats
{\global\settrue\c_page_floats_flushing
\ifconditional\c_page_floats_some_waiting
diff --git a/tex/context/base/mkiv/page-spr.mkiv b/tex/context/base/mkiv/page-spr.mkiv
index dc1e013d5..f57b804b3 100644
--- a/tex/context/base/mkiv/page-spr.mkiv
+++ b/tex/context/base/mkiv/page-spr.mkiv
@@ -40,9 +40,15 @@
\normalsettextpagecontent_normal{#1}%
\fi}
+% \def\normalsettextpagecontent_normal#1%
+% {\setbox#1\hbox to \makeupwidth
+% {\hss\box#1\hss}} % never change the \hss's
+
\def\normalsettextpagecontent_normal#1%
- {\setbox#1\hbox to \makeupwidth
- {\hss\box#1\hss}} % never change the \hss's
+ {\ifdim\wd#1=\makeupwidth\else
+ \setbox#1\hbox to \makeupwidth
+ {\hss\box#1\hss}% never change the \hss's
+ \fi}
\def\normalsettextpagecontent_spread#1%
{\setbox#1\hbox to \makeupwidth
diff --git a/tex/context/base/mkiv/scrn-bar.mkvi b/tex/context/base/mkiv/scrn-bar.mkvi
index 7634398f8..0c320cd03 100644
--- a/tex/context/base/mkiv/scrn-bar.mkvi
+++ b/tex/context/base/mkiv/scrn-bar.mkvi
@@ -138,7 +138,7 @@
\setbox2\hbox{\inheritedinteractionbarframed{\symbol[\interactionparameter\c!symbolset][\v!previouspage]}}%
\scratchheight\ht2 % needed because we default to nothing
\letinteractionbarparameter\c!strut\v!no
- \letinteractionparameter\c!width\zeropoint
+ % \letinteractionparameter\c!width\zeropoint
\scratchcounterone\zerocount % new, was 1
\processallactionsinset
[#list]
diff --git a/tex/context/base/mkiv/scrn-ini.mkvi b/tex/context/base/mkiv/scrn-ini.mkvi
index e1be43f37..557ceb563 100644
--- a/tex/context/base/mkiv/scrn-ini.mkvi
+++ b/tex/context/base/mkiv/scrn-ini.mkvi
@@ -61,7 +61,7 @@
\to \everyjob
% it makes no sense to create an environment as we will seldom have structured
-% interactionso a general start-stop will do
+% interactions so a general start-stop will do
%
% \appendtoks
% \setuevalue \currentinteraction {\scrn_interaction_direct{\currentinteraction}}%
diff --git a/tex/context/base/mkiv/scrn-wid.mkvi b/tex/context/base/mkiv/scrn-wid.mkvi
index c74125c72..d1571ca65 100644
--- a/tex/context/base/mkiv/scrn-wid.mkvi
+++ b/tex/context/base/mkiv/scrn-wid.mkvi
@@ -212,11 +212,10 @@
name {\attachmentparameter\c!name}%
buffer {\attachmentparameter\c!buffer}%
\relax
- \setbox\b_scrn_attachment_link\hbox{\scrn_attachment_place}%
\wd\b_scrn_attachment_link\currentattachmentwidth
\ht\b_scrn_attachment_link\currentattachmentheight
\dp\b_scrn_attachment_link\currentattachmentdepth
- \box\b_scrn_attachment_link}
+ \expandnamespaceparameter\??attachmentlocation\attachmentparameter\c!location\s!unknown}
\setvalue{\??attachmentmethod\v!hidden}%
{\clf_insertattachment
@@ -231,29 +230,48 @@
buffer {\attachmentparameter\c!buffer}%
\relax}
-\def\scrn_attachment_place
- {\executeifdefined
- {\??attachmentlocation\attachmentparameter\c!location}\hbox
- {\box\b_scrn_attachment_link}}
-
-\setvalue{\??attachmentlocation\v!inmargin }{\inmargin }
-\setvalue{\??attachmentlocation\v!leftedge }{\inleftedge }
-\setvalue{\??attachmentlocation\v!rightedge }{\inrightedge }
-\setvalue{\??attachmentlocation\v!leftmargin }{\inleftmargin }
-\setvalue{\??attachmentlocation\v!rightmargin}{\inrightmargin}
-\setvalue{\??attachmentlocation\v!high }{\high}
-\setvalue{\??attachmentlocation\v!none }{\scrn_attachment_collect}
-%setvalue{\??attachmentlocation\v!text }{\gobblenextargument} % gobbles the box
-
-\def\scrn_attachment_collect#content%
+\unexpanded\def\scrn_attachment_flush_traced
+ {\hpack\bgroup
+ \blackrule % can be a fast one
+ [ \c!color=trace:r,
+ \c!width=\wd\b_scrn_attachment_link,
+ \c!height=\ht\b_scrn_attachment_link,
+ \c!depth=\dp\b_scrn_attachment_link]%
+ \kern-\wd\b_scrn_attachment_link
+ \box\b_scrn_attachment_link
+ \egroup}
+
+\unexpanded\def\scrn_attachment_flush_normal
+ {\box\b_scrn_attachment_link}
+
+\installtextracker
+ {attachments.anchors}
+ {\let\scrn_attachment_flush\scrn_attachment_flush_traced}
+ {\let\scrn_attachment_flush\scrn_attachment_flush_normal}
+
+\let\scrn_attachment_flush\scrn_attachment_flush_normal
+
+\setvalue{\??attachmentlocation\v!inmargin }{\inmargin {\scrn_attachment_flush}}
+\setvalue{\??attachmentlocation\v!leftedge }{\inleftedge {\scrn_attachment_flush}}
+\setvalue{\??attachmentlocation\v!rightedge }{\inrightedge {\scrn_attachment_flush}}
+\setvalue{\??attachmentlocation\v!leftmargin }{\inleftmargin {\scrn_attachment_flush}}
+\setvalue{\??attachmentlocation\v!rightmargin}{\inrightmargin{\scrn_attachment_flush}}
+\setvalue{\??attachmentlocation\v!high }{\high {\scrn_attachment_flush}}
+
+\setvalue{\??attachmentlocation\v!none}%
{\global\setbox\b_scrn_attachment_collect\hbox\bgroup
\ifvoid\b_scrn_attachment_collect\else
\box\b_scrn_attachment_collect
\hskip\attachmentparameter\c!distance\relax
\fi
- #content%
+ \scrn_attachment_flush
\egroup}
+\setvalue{\??attachmentlocation\s!unknown}%
+ {\ifvoid\b_scrn_attachment_collect\else
+ \box\b_scrn_attachment_collect
+ \fi}
+
\unexpanded\def\placeattachments
{\ifvoid\b_scrn_attachment_collect\else
\box\b_scrn_attachment_collect
@@ -317,7 +335,7 @@
%
% test
%
-% \startcomment[symbol=Balloon]
+% \startcomment[symbol=Help]
% Do we want this kind of rubish?
% \stopcomment
%
@@ -360,6 +378,9 @@
%
% test
+%D The implementation is mostly the same as for attachments but sharing code
+%D will not make it cleaner.
+
\installcorenamespace{comment}
\installcorenamespace{commentlocation}
@@ -489,17 +510,37 @@
\dp\b_scrn_comment_link\currentcommentdepth
\expandnamespaceparameter\??commentlocation\commentparameter\c!location\s!unknown}
-\setvalue{\??commentmethods\v!hidden}%
- {}
+\letvalue{\??commentmethods\v!hidden}\donothing
+
+\unexpanded\def\scrn_comment_flush_traced
+ {\hpack\bgroup
+ \blackrule % can be a fast one
+ [ \c!color=trace:y,
+ \c!width=\wd\b_scrn_comment_link,
+ \c!height=\ht\b_scrn_comment_link,
+ \c!depth=\dp\b_scrn_comment_link]%
+ \kern-\wd\b_scrn_comment_link
+ \box\b_scrn_comment_link
+ \egroup}
+
+\unexpanded\def\scrn_comment_flush_normal
+ {\box\b_scrn_comment_link}
+
+\installtextracker
+ {comments.anchors}
+ {\let\scrn_comment_flush\scrn_comment_flush_traced}
+ {\let\scrn_comment_flush\scrn_comment_flush_normal}
+
+\let\scrn_comment_flush\scrn_comment_flush_normal
% todo: dedicated margin classes
-\setvalue{\??commentlocation\v!inmargin }{\inmargin {\box\b_scrn_comment_link}}
-\setvalue{\??commentlocation\v!leftedge }{\inleftedge {\box\b_scrn_comment_link}}
-\setvalue{\??commentlocation\v!rightedge }{\inrightedge {\box\b_scrn_comment_link}}
-\setvalue{\??commentlocation\v!leftmargin }{\inleftmargin {\box\b_scrn_comment_link}}
-\setvalue{\??commentlocation\v!rightmargin}{\inrightmargin{\box\b_scrn_comment_link}}
-\setvalue{\??commentlocation\v!high }{\high {\box\b_scrn_comment_link}}
+\setvalue{\??commentlocation\v!inmargin }{\inmargin {\scrn_comment_flush}}
+\setvalue{\??commentlocation\v!leftedge }{\inleftedge {\scrn_comment_flush}}
+\setvalue{\??commentlocation\v!rightedge }{\inrightedge {\scrn_comment_flush}}
+\setvalue{\??commentlocation\v!leftmargin }{\inleftmargin {\scrn_comment_flush}}
+\setvalue{\??commentlocation\v!rightmargin}{\inrightmargin{\scrn_comment_flush}}
+\setvalue{\??commentlocation\v!high }{\high {\scrn_comment_flush}}
\setvalue{\??commentlocation\v!none}%
{\global\setbox\b_scrn_comment_collect\hbox\bgroup
@@ -507,7 +548,7 @@
\box\b_scrn_comment_collect
\hskip\commentparameter\c!distance\relax
\fi
- \box\b_scrn_comment_link
+ \scrn_comment_flush
\egroup}
\setvalue{\??commentlocation\s!unknown}%
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index f414d857d..c407fddcb 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 f96272c5a..14b339771 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-lst.mkvi b/tex/context/base/mkiv/strc-lst.mkvi
index dd4c40ea4..7bc859b67 100644
--- a/tex/context/base/mkiv/strc-lst.mkvi
+++ b/tex/context/base/mkiv/strc-lst.mkvi
@@ -872,7 +872,7 @@
\appendtoks
\dontcomplain
- \letinteractionparameter\c!width\zeropoint % a weird one
+ % \letinteractionparameter\c!width\zeropoint % a weird one
\to \t_lists_every_renderingsetup
\appendtoks
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index 3874573e7..0acfab7f7 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -1826,8 +1826,7 @@ local nofidentified = 0
local function identify(prefix,reference)
if not reference then
- prefix = ""
- reference = prefix
+ prefix, reference = "", prefix
end
local set = resolve(prefix,reference)
local bug = false
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index 2a2e891dc..953f86360 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -1008,6 +1008,12 @@
\lineskip = 1pt
\lineskiplimit = 0pt
+%D Sometimes kerns make more sense than glue but we need to be in the
+%D right mode:
+
+\normalprotected\def\vkern{\ifhmode\par \fi\kern}
+\normalprotected\def\hkern{\ifvmode\dontleavehmode\fi\kern}
+
%D Again a few kind-of-extensions the core. These come from plain \TEX\ but
%D are probably not used in \CONTEXT.
diff --git a/tex/context/base/mkiv/type-set.mkiv b/tex/context/base/mkiv/type-set.mkiv
index 1763de687..c6b0c8841 100644
--- a/tex/context/base/mkiv/type-set.mkiv
+++ b/tex/context/base/mkiv/type-set.mkiv
@@ -132,4 +132,6 @@
\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv]
+\definefilesynonym [type-imp-ibmplex.mkiv] [type-imp-plex.mkiv]
+
\protect \endinput
diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua
index 48c265659..f090bce55 100644
--- a/tex/context/base/mkiv/util-str.lua
+++ b/tex/context/base/mkiv/util-str.lua
@@ -1022,6 +1022,22 @@ end
--
+-- local strip
+--
+-- local format_Z = function(f)
+-- n = n + 1
+-- if not f or f == "" then
+-- f = ".9"
+-- end
+-- return format("(((a%s %% 1 == 0) and format('%%i',a%s)) or (strip and lpegmatch(stripzero,format('%%%sf',a%s))) or format('%%%sf',a%s))",n,n,f,n,f,n)
+-- end
+--
+-- function strings.stripformatterzeros()
+-- strip = true
+-- end
+
+--
+
local format_rest = function(s)
return format("%q",s) -- catches " and \n and such
end
@@ -1155,6 +1171,7 @@ local builder = Cs { "start",
["M"] = (prefix_any * P("M")) / format_M, -- %M => xxx,xxx,xxx.xx (optional prefix instead of ,)
--
["z"] = (prefix_any * P("z")) / format_z, -- %z => skip n arguments
+ -- ["Z"] = (prefix_any * P("Z")) / format_Z, -- %Z => optionally strip zeros
--
["a"] = (prefix_any * P("a")) / format_a, -- %a => '...' (forces tostring)
["A"] = (prefix_any * P("A")) / format_A, -- %A => "..." (forces tostring)
diff --git a/tex/context/fonts/mkiv/type-imp-plex.mkiv b/tex/context/fonts/mkiv/type-imp-plex.mkiv
index 32e5cb41f..99b099474 100644
--- a/tex/context/fonts/mkiv/type-imp-plex.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-plex.mkiv
@@ -3,7 +3,7 @@
%D version=2018.09.11,
%D title=\CONTEXT\ Typescript Macros,
%D subtitle=Plex fonts,
-%D author=Hans Hagen,
+%D author={Hans Hagen & Taco Hoekwater},
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
@@ -21,24 +21,31 @@
\loadtypescriptfile[bookman]
-
\starttypescriptcollection[plex]
- \definetypescriptprefix [n:plexserif] [IBMPlexSerif]
- \definetypescriptprefix [n:plexsans] [IBMPlexSans]
- \definetypescriptprefix [n:plexmono] [IBMPlexMono]
+ \definetypescriptprefix [n:plexserif] [IBMPlexSerif]
+ \definetypescriptprefix [n:plexsans] [IBMPlexSans]
+ \definetypescriptprefix [n:plexmono] [IBMPlexMono]
+
+ \definetypescriptprefix [n:plexserifnarrow] [IBMPlexSerif]
+ \definetypescriptprefix [n:plexsansnarrow] [IBMPlexSansCondensed]
+ \definetypescriptprefix [n:plexmonnarrow] [IBMPlexMono]
- \definetypescriptprefix [f:plexserif] [\s!default]
- \definetypescriptprefix [f:plexsans] [\s!default]
- \definetypescriptprefix [f:plexmono] [\s!none]
+ \definetypescriptprefix [f:plexserif] [\s!default]
+ \definetypescriptprefix [f:plexsans] [\s!default]
+ \definetypescriptprefix [f:plexmono] [\s!none]
+
+ \definetypescriptprefix [f:plexserifnarrow] [\s!default]
+ \definetypescriptprefix [f:plexsansnarrow] [\s!default]
+ \definetypescriptprefix [f:plexmononarrow] [\s!none]
% [THIN|light|TEXT||medium|semibold|bold|extra]
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-thin,plex-hairline] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
@@ -47,8 +54,8 @@
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-light] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
@@ -57,8 +64,8 @@
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-text] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
@@ -67,8 +74,8 @@
\starttypescript [\s!sans,\s!serif,\s!mono] [plex] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
@@ -77,8 +84,8 @@
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-medium] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
@@ -87,12 +94,126 @@
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-semibold,plex-dark,plex-black] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-extra] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-extra] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extraitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
\starttypescript[plex,plex-thin,plex-hairline,plex-light,plex-text,plex-medium,plex-semibold,plex-dark,plex-black]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [bookman] [\s!default] [\s!rscale=1.03]
+ \stoptypescript
+
+ % Here's Taco's variant as used in the ConTeXt Group Journal.
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-thin,ibmplexnarrow-thin] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-extralight,ibmplexnarrow-extralight] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-light,ibmplexnarrow-light] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex,ibmplexnarrow-light] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ % For now, as some day plex will have cjk, hebrew, devanagari and arabic. The abstraction is not needed but
+ % this way we can add more id needed without much code.
+
+ \definetypescriptprefix [tf:plexsans] [SansHebrewFallback]
+ \definetypescriptprefix [bf:plexsans] [SansHebrewFallbackBold]
+
+ \definetypescriptprefix [n:plexsans-hebrew] [IBMPlexSansHebrew]
+
+ \definefontfallback [SansHebrewFallback] [SansHebrew] [0x0590-0x05ff] [check=yes,force=no]
+ \definefontfallback [SansHebrewFallbackBold] [SansHebrewBold] [0x0590-0x05ff] [check=yes,force=no]
+
+ \starttypescript [\s!sans] [ibmplex-thin] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-extralight]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-medium]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplex-extralight] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-thin]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-text]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplex-light] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-light]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-light]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-semibold]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplex] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold]
+ [\s!features=\typescriptprefix{f:plex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-regular]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-bold]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ % The main definition, inspired by discussion at the 2018 ConTeXt meeting after a talk by Taco. Here
+ % we default to sans serif. Taco: take your choice of math!
+
+ \starttypescript[ibmplex,ibmplex-thin,ibmplex-extralight,ibmplex-light]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [bookman] [\s!default] [\s!rscale=1.03]
+ \stoptypescript
+
+ \starttypescript[ibmplexnarrow,ibmplexnarrow-thin,ibmplexnarrow-extralight,ibmplexnarrow-light]
\definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
\definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default]
diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml
index 953061e4f..a0c7c4138 100644
--- a/tex/context/interface/mkiv/context-en.xml
+++ b/tex/context/interface/mkiv/context-en.xml
@@ -27358,6 +27358,18 @@
</cd:command>
</cd:interface>
<cd:interface file="i-pagestate.xml">
+ <cd:command file="spac-pag.mkiv" level="system" name="signalrightpage"/>
+ <cd:command file="spac-pag.mkiv" level="system" name="doifelserightpage">
+ <cd:arguments>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:true"/>
+ </cd:keywords>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:false"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ <cd:command file="spac-pag.mkiv" level="system" name="rightpageorder"/>
<cd:command file="core-dat.mkiv" level="system" name="definepagestate">
<cd:arguments>
<cd:keywords>
@@ -27417,6 +27429,38 @@
</cd:keywords>
</cd:arguments>
</cd:command>
+ <cd:command file="core-dat.mkiv" level="system" name="pagestaterealpageorder">
+ <cd:arguments>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ <cd:constant type="cd:number"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ <cd:command file="core-dat.mkiv" level="system" name="autopagestaterealpage">
+ <cd:arguments>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ <cd:command file="core-dat.mkiv" level="system" name="setautopagestaterealpageno">
+ <cd:arguments>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ <cd:command file="core-dat.mkiv" level="system" name="autopagestaterealpageorder">
+ <cd:arguments>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
</cd:interface>
<cd:interface file="i-pagemarks.xml">
<cd:command file="page-ini.mkiv" level="style" name="markpage">
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index d78642a78..4fd1e2ad7 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-pagestate.xml b/tex/context/interface/mkiv/i-pagestate.xml
index 941068399..e705ba7e7 100644
--- a/tex/context/interface/mkiv/i-pagestate.xml
+++ b/tex/context/interface/mkiv/i-pagestate.xml
@@ -4,6 +4,17 @@
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">
+ <cd:command name="signalrightpage" level="system" file="spac-pag.mkiv"/>
+
+ <cd:command name="doifelserightpage" level="system" file="spac-pag.mkiv">
+ <cd:arguments>
+ <cd:resolve name="argument-true"/>
+ <cd:resolve name="argument-false"/>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="rightpageorder" level="system" file="spac-pag.mkiv"/>
+
<cd:command name="definepagestate" level="system" file="core-dat.mkiv">
<cd:arguments>
<cd:resolve name="keyword-name"/>
@@ -56,4 +67,32 @@
</cd:arguments>
</cd:command>
-</cd:interface> \ No newline at end of file
+ <cd:command name="pagestaterealpageorder" level="system" file="core-dat.mkiv">
+ <cd:arguments>
+ <cd:resolve name="argument-name"/>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:name"/>
+ <cd:constant type="cd:number"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="autopagestaterealpage" level="system" file="core-dat.mkiv">
+ <cd:arguments>
+ <cd:resolve name="argument-name"/>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="setautopagestaterealpageno" level="system" file="core-dat.mkiv">
+ <cd:arguments>
+ <cd:resolve name="argument-name"/>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="autopagestaterealpageorder" level="system" file="core-dat.mkiv">
+ <cd:arguments>
+ <cd:resolve name="argument-name"/>
+ </cd:arguments>
+ </cd:command>
+
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index fc5776c35..7cc223ff7 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-asymptote.lua b/tex/context/modules/mkiv/m-asymptote.lua
index de8d032c8..39a0d987b 100644
--- a/tex/context/modules/mkiv/m-asymptote.lua
+++ b/tex/context/modules/mkiv/m-asymptote.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['m-asymptote'] = {
version = 1.001,
- comment = "companion to m-pstricks.mkiv",
+ comment = "companion to m-asymptote.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
diff --git a/tex/context/modules/mkiv/m-asymptote.mkiv b/tex/context/modules/mkiv/m-asymptote.mkiv
index c236ceee5..9cd4037fb 100644
--- a/tex/context/modules/mkiv/m-asymptote.mkiv
+++ b/tex/context/modules/mkiv/m-asymptote.mkiv
@@ -76,51 +76,51 @@
\starttext
\startasymptote[demo-1]
-settings.prc=true;
+settings.prc = true ;
-import graph3;
-import palette;
+import graph3 ;
+import palette ;
-size(6cm,6cm);
-size3(5cm,0);
+size(6cm,6cm) ;
+size3(5cm,0) ;
-currentprojection=orthographic(3,-6,12);
-currentlight=light(8,10,2);
+currentprojection = orthographic(3,-6,12) ;
+currentlight = light(8,10,2) ;
-real g(pair z) {return 1-z.x^2-z.y^2;}
-real f(pair z) {return -2z.x+2;}
+real g(pair z) { return 1-z.x^2-z.y^2 ; }
+real f(pair z) { return -2z.x+2 ; }
-real x(real t) {return t;}
-real y(real t) {return 0;}
-real z(real t) {return 1-t^2;}
-real a(real t) {return 1;}
-real b(real t) {return t;}
-real c(real t) {return -t^2;}
+real x(real t) { return t ; }
+real y(real t) { return 0 ; }
+real z(real t) { return 1-t^2 ; }
+real a(real t) { return 1 ; }
+real b(real t) { return t ; }
+real c(real t) { return -t^2 ; }
-path3 p=graph(x,y,z,-2,2,operator ..);
-path3 o=graph(a,b,c,-2,2,operator ..);
+path3 p=graph(x,y,z,-2,2,operator ..) ;
+path3 o=graph(a,b,c,-2,2,operator ..) ;
-surface r=surface(f,(0,-1),(2,1),nx=3,Spline);
-surface s=surface(g,(-2,-2),(2,2),nx=5,Spline);
+surface r = surface(f, (0,-1), (2,1), nx = 3, Spline) ;
+surface s = surface(g, (-2,-2), (2,2), nx = 5, Spline) ;
-path3 q=(-2,-2,-7)--(2,-2,-7)--(2,2,-7)--(-2,2,-7)--cycle;
+path3 q = (-2,-2,-7) -- (2,-2,-7) -- (2,2,-7) -- (-2,2,-7) -- cycle ;
-draw(q);
+draw(q) ;
-draw(p,blue+thick(),Arrow3);
-draw(o,blue+thick(),Arrow3);
+draw(p, blue+thick(), Arrow3) ;
+draw(o, blue+thick(), Arrow3) ;
-draw(s,lightgray+opacity(0.8),nolight,meshpen=black+thick());
-draw(r,lightgray+opacity(0.8),nolight,meshpen=black+thick());
+draw(s, lightgray + opacity(0.8), nolight, meshpen = black + thick()) ;
+draw(r, lightgray + opacity(0.8), nolight, meshpen = black + thick()) ;
-draw((1,0,0)--(2,0,-2),black,Arrow3);
-draw((1,0,0)--(1,1,0),black,Arrow3);
+draw((1,0,0) -- (2,0,-2), black, Arrow3) ;
+draw((1,0,0) -- (1,1,0), black, Arrow3) ;
\stopasymptote
\startasymptote[demo-2]
-size(6cm,6cm);
+size(6cm,6cm) ;
-fill((1cm,2cm)--(3cm,3cm)--(4cm,0cm)--cycle);
+fill((1cm,2cm) -- (3cm,3cm) -- (4cm,0cm) -- cycle);
\stopasymptote
% see end of grph-inc.mkiv for some more options:
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv
index 0c258a860..eaac6ecae 100644
--- a/tex/context/modules/mkiv/m-scite.mkiv
+++ b/tex/context/modules/mkiv/m-scite.mkiv
@@ -289,6 +289,7 @@ visualizers.register("cld", visualizer)
visualizers.register("tex", visualizer)
visualizers.register("lua", visualizer)
visualizers.register("mps", visualizer)
+visualizers.register("pdf", visualizer)
visualizers.register("xml", visualizer)
visualizers.register("bibtex",visualizer)
visualizers.register("btx", visualizer)
@@ -306,6 +307,7 @@ visualizers.register("json", visualizer)
\definetyping[BTX] [option=bibtex]
\definetyping[MPS] [option=mps]
\definetyping[MP] [option=mps]
+\definetyping[PDF] [option=pdf]
\definetyping[CPP] [option=web]
\definetyping[WEB] [option=web]
\definetyping[TXT] [option=txt]
diff --git a/tex/context/modules/mkiv/s-fonts-charts.mkiv b/tex/context/modules/mkiv/s-fonts-charts.mkiv
index e94b52a2e..50cd589e4 100644
--- a/tex/context/modules/mkiv/s-fonts-charts.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-charts.mkiv
@@ -15,7 +15,7 @@
%
% title : show unicode blocks
%
-% comment : show charts of a given fgont
+% comment : show charts of a given font
%
% end info
diff --git a/tex/context/modules/mkiv/s-references-identify.mkiv b/tex/context/modules/mkiv/s-references-identify.mkiv
new file mode 100644
index 000000000..85187be9d
--- /dev/null
+++ b/tex/context/modules/mkiv/s-references-identify.mkiv
@@ -0,0 +1,69 @@
+%D \module
+%D [ file=s-references-identity,
+%D version=2018.09.15,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Analyze References,
+%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.
+
+% begin info
+%
+% title : analyze reference
+%
+% comment : show the building blocks of a reference (list)
+%
+% end info
+
+\startmodule[references-identify]
+
+\startluacode
+
+moduledata.references = moduledata.references or { }
+
+local context = context
+local NC, NR = context.NC, context.NR
+local bold = context.bold
+local text = context
+
+function moduledata.references.show(str)
+ local t = structures.references.identify(str)
+ context.starttabulate { "|T|T|T|" }
+ for i=1,#t do
+ if i == 1 then
+ context.FL()
+ else
+ context.ML()
+ end
+ local ti = t[i]
+ NC() bold(i) NC() bold("reference") NC() bold(ti.reference) NC() NR()
+ NC() NC() text("kind") NC() text(ti.kind) NC() NR()
+ NC() NC() text("operation") NC() text(ti.operation) NC() NR()
+ NC() NC() text("arguments") NC() text(ti.arguments) NC() NR()
+ NC() NC() text("special") NC() text(ti.special) NC() NR()
+ end
+ context.LL()
+ context.stoptabulate()
+end
+
+\stopluacode
+
+\installmodulecommandluasingle \showreference {moduledata.references.show}
+
+\stopmodule
+
+\continueifinputfile{s-references-identify.mkiv}
+
+\usemodule[art-01]
+
+\starttext
+
+ \showreference[page(123),StartMovie{mymovie}]
+ \showreference[JS(Forget_Changes),CloseDocument]
+ \showreference[manual::contents]
+
+\stoptext
diff --git a/tex/context/modules/mkiv/x-setups-basics.mkiv b/tex/context/modules/mkiv/x-setups-basics.mkiv
index be96466b8..422877bc2 100644
--- a/tex/context/modules/mkiv/x-setups-basics.mkiv
+++ b/tex/context/modules/mkiv/x-setups-basics.mkiv
@@ -517,7 +517,8 @@
\fi}
\def\cmd_show_setup_nop#1% this will trigger 'used'
- {\registersort[texcommand][#1]%
+ {\begingroup
+ \registersort[texcommand][#1]%
\ifconditional\c_cmd_show_setup
\writestatus{setup}{#1 / \rawsynonymname{texcommand}{#1}}%
\fi
@@ -534,7 +535,8 @@
\let\m_cmd_instance\empty
\fi
\stopelement
- \stopelement}
+ \stopelement
+ \endgroup}
\unexpanded\def\placesetup {\placelistofsorts[texcommand][\c!criterium=\v!used]}
\unexpanded\def\placeallsetups{\placelistofsorts[texcommand][\c!criterium=\v!all ]}
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 2e4e2fd03..9cc067cb3 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 : 09/13/18 17:41:02
+-- merge date : 09/21/18 19:52:37
do -- begin closure to overcome local limits and interference