summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-05-11 10:07:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-05-11 10:07:00 +0200
commite888c1ec949100dee585a5206d76b49cbee91ac4 (patch)
tree117431b77b6439e14826f08975df6972f1a94e23
parent98b29c780ec554009fc3942f64fbab5e150b8e66 (diff)
downloadcontext-e888c1ec949100dee585a5206d76b49cbee91ac4.tar.gz
beta 2012.05.11 10:07
-rw-r--r--metapost/context/base/mp-abck.mpiv15
-rw-r--r--metapost/context/base/mp-apos.mpiv61
-rw-r--r--scripts/context/lua/mtxrun.lua39
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua39
-rwxr-xr-xscripts/context/stubs/unix/mtxrun39
-rw-r--r--tex/context/base/anch-bar.mkiv8
-rw-r--r--tex/context/base/anch-bck.mkvi4
-rw-r--r--tex/context/base/anch-pgr.mkiv2
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4071 -> 4075 bytes
-rw-r--r--tex/context/base/context-version.pngbin105651 -> 104928 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/grph-inc.lua14
-rw-r--r--tex/context/base/l-os.lua39
-rw-r--r--tex/context/base/s-inf-03.mkiv15
-rw-r--r--tex/context/base/spac-grd.mkiv4
-rw-r--r--tex/context/base/spac-ver.lua2
-rw-r--r--tex/context/base/spac-ver.mkiv112
-rw-r--r--tex/context/base/status-files.pdfbin24304 -> 24324 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin173832 -> 178829 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
23 files changed, 342 insertions, 61 deletions
diff --git a/metapost/context/base/mp-abck.mpiv b/metapost/context/base/mp-abck.mpiv
index 3d5afb903..977bebcfd 100644
--- a/metapost/context/base/mp-abck.mpiv
+++ b/metapost/context/base/mp-abck.mpiv
@@ -178,6 +178,8 @@ def show_multi_kind =
endfor ;
enddef ;
+def multi_side_draw_options = enddef ;
+
def draw_multi_side =
begingroup ; save p ; picture p ;
for i=1 upto nofmultipars :
@@ -191,6 +193,19 @@ def draw_multi_side =
endgroup ;
enddef ;
+def draw_multi_side_path text t =
+ begingroup ; save p ; picture p ;
+ for i=1 upto nofmultipars :
+ p := image ( draw leftboundary multipars[i]
+ shifted (-boxlineoffset,0)
+ withpen pensquare scaled boxlinewidth boxlineoptions t ;
+ ) ;
+ setbounds p to multipars[i] ;
+ draw p ;
+ endfor ;
+ endgroup ;
+enddef ;
+
% some extras
path posboxes[],
diff --git a/metapost/context/base/mp-apos.mpiv b/metapost/context/base/mp-apos.mpiv
index 072c958f3..5f394e468 100644
--- a/metapost/context/base/mp-apos.mpiv
+++ b/metapost/context/base/mp-apos.mpiv
@@ -66,26 +66,53 @@ enddef ;
% anch-bar:
-def anch_sidebars_draw(expr p_b_self, p_e_self, y_b_self, y_e_self, h_b_self, d_e_self, distance, linewidth, linecolor) =
- StartPage ;
- path p ; p :=
+% def anch_sidebars_draw(expr p_b_self, p_e_self, y_b_self, y_e_self, h_b_self, d_e_self, distance, linewidth, linecolor) =
+% StartPage ;
+% path p ; p :=
+% if p_b_self=p_e_self :
+% (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) --
+% (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ;
+% elseif RealPageNumber=p_b_self :
+% (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) --
+% (llcorner Field[Text][Text]) ;
+% elseif RealPageNumber=p_e_self :
+% (ulcorner Field[Text][Text]) --
+% (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ;
+% else :
+% (ulcorner Field[Text][Text]) --
+% (llcorner Field[Text][Text]) ;
+% fi ;
+% p := p shifted (-llcorner Field[Text][Text]-(distance,0)) ;
+% interim linecap := butt ;
+% draw p
+% withpen pencircle scaled linewidth
+% withcolor linecolor ;
+% StopPage ;
+% enddef ;
+
+def anch_sidebars_draw (expr p_b_self, p_e_self, y_b_self, y_e_self, h_b_self, d_e_self,
+ x, y, w, h, alternative, distance, linewidth, linecolor) =
+ begingroup ;
+ if alternative = 1 :
+ % nothing
+ else :
+ interim linecap := butt ;
+ fi ;
+ draw
if p_b_self=p_e_self :
- (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) --
- (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ;
+ (-distance,y_b_self+h_b_self-y) -- (-distance,y_e_self-d_e_self-y)
elseif RealPageNumber=p_b_self :
- (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) --
- (llcorner Field[Text][Text]) ;
+ (-distance,y_b_self+h_b_self-y) -- (-distance,0) ;
elseif RealPageNumber=p_e_self :
- (ulcorner Field[Text][Text]) --
- (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ;
+ (-distance,h) -- (-distance,y_e_self-d_e_self-y)
+ else :
+ (-distance,h) -- (-distance,0)
+ fi
+ if alternative = 1 :
+ dashed (withdots scaled (linewidth/2))
else :
- (ulcorner Field[Text][Text]) --
- (llcorner Field[Text][Text]) ;
- fi ;
- p := p shifted (-llcorner Field[Text][Text]-(distance,0)) ;
- interim linecap := butt ;
- draw p
withpen pencircle scaled linewidth
- withcolor linecolor ;
- StopPage ;
+ fi
+ withcolor linecolor ;
+ endgroup ;
enddef ;
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 41adb5d43..69722cc55 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -2286,7 +2286,7 @@ if not modules then modules = { } end modules ['l-os'] = {
-- maybe build io.flush in os.execute
local os = os
-local find, format, gsub, upper = string.find, string.format, string.gsub, string.upper
+local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
local random, ceil = math.random, math.ceil
local rawget, rawset, type, getmetatable, setmetatable, tonumber = rawget, rawset, type, getmetatable, setmetatable, tonumber
@@ -2392,9 +2392,9 @@ os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
os.name = os.name or (os.type == "windows" and "mswin" ) or "linux"
if os.type == "windows" then
- os.libsuffix, os.binsuffix = 'dll', 'exe'
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'dll', 'exe', { 'exe', 'cmd', 'bat' }
else
- os.libsuffix, os.binsuffix = 'so', ''
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
function os.launch(str)
@@ -2625,6 +2625,39 @@ function os.timezone(delta)
end
end
+local memory = { }
+
+local function which(filename)
+ local fullname = memory[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
+ end
+ end
+ if not fullname then
+ fullname = false
+ end
+ memory[filename] = fullname
+ end
+ return fullname
+end
+
+os.which = which
+os.where = which
+
+-- print(os.which("inkscape.exe"))
+-- print(os.which("inkscape"))
+-- print(os.which("gs.exe"))
+-- print(os.which("ps2pdf"))
+
end -- of closure
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 41adb5d43..69722cc55 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -2286,7 +2286,7 @@ if not modules then modules = { } end modules ['l-os'] = {
-- maybe build io.flush in os.execute
local os = os
-local find, format, gsub, upper = string.find, string.format, string.gsub, string.upper
+local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
local random, ceil = math.random, math.ceil
local rawget, rawset, type, getmetatable, setmetatable, tonumber = rawget, rawset, type, getmetatable, setmetatable, tonumber
@@ -2392,9 +2392,9 @@ os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
os.name = os.name or (os.type == "windows" and "mswin" ) or "linux"
if os.type == "windows" then
- os.libsuffix, os.binsuffix = 'dll', 'exe'
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'dll', 'exe', { 'exe', 'cmd', 'bat' }
else
- os.libsuffix, os.binsuffix = 'so', ''
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
function os.launch(str)
@@ -2625,6 +2625,39 @@ function os.timezone(delta)
end
end
+local memory = { }
+
+local function which(filename)
+ local fullname = memory[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
+ end
+ end
+ if not fullname then
+ fullname = false
+ end
+ memory[filename] = fullname
+ end
+ return fullname
+end
+
+os.which = which
+os.where = which
+
+-- print(os.which("inkscape.exe"))
+-- print(os.which("inkscape"))
+-- print(os.which("gs.exe"))
+-- print(os.which("ps2pdf"))
+
end -- of closure
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 41adb5d43..69722cc55 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -2286,7 +2286,7 @@ if not modules then modules = { } end modules ['l-os'] = {
-- maybe build io.flush in os.execute
local os = os
-local find, format, gsub, upper = string.find, string.format, string.gsub, string.upper
+local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
local random, ceil = math.random, math.ceil
local rawget, rawset, type, getmetatable, setmetatable, tonumber = rawget, rawset, type, getmetatable, setmetatable, tonumber
@@ -2392,9 +2392,9 @@ os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
os.name = os.name or (os.type == "windows" and "mswin" ) or "linux"
if os.type == "windows" then
- os.libsuffix, os.binsuffix = 'dll', 'exe'
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'dll', 'exe', { 'exe', 'cmd', 'bat' }
else
- os.libsuffix, os.binsuffix = 'so', ''
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
function os.launch(str)
@@ -2625,6 +2625,39 @@ function os.timezone(delta)
end
end
+local memory = { }
+
+local function which(filename)
+ local fullname = memory[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
+ end
+ end
+ if not fullname then
+ fullname = false
+ end
+ memory[filename] = fullname
+ end
+ return fullname
+end
+
+os.which = which
+os.where = which
+
+-- print(os.which("inkscape.exe"))
+-- print(os.which("inkscape"))
+-- print(os.which("gs.exe"))
+-- print(os.which("ps2pdf"))
+
end -- of closure
diff --git a/tex/context/base/anch-bar.mkiv b/tex/context/base/anch-bar.mkiv
index 87f21facd..1dac46b56 100644
--- a/tex/context/base/anch-bar.mkiv
+++ b/tex/context/base/anch-bar.mkiv
@@ -69,6 +69,7 @@
\setupsidebar
[\c!rulethickness=2pt,
\c!rulecolor=red,
+ \c!alternative=0,
\c!distance=.5\bodyfontsize]
\let\setupsidebars\setupsidebar
@@ -90,6 +91,7 @@
{self=sidebar:\the\c_anch_sidebars_n,
linewidth=\sidebarparameter\c!rulethickness,
linecolor=\sidebarparameter\c!rulecolor,
+ alternative=\sidebarparameter\c!alternative,
distance=\the\c_anch_sidebars_distance}}%
\stoppositionoverlay
\bpos{sidebar:\the\c_anch_sidebars_n}}
@@ -103,11 +105,12 @@
%D one lua call).
\startMPpositionmethod{mpos:sidebar}
- \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance}%
+ \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance,alternative}%
if unknown context_apos : input mp-apos.mpiv ; fi ;
anch_sidebars_draw (
\MPp\MPbself,\MPp\MPeself,\MPy\MPbself,\MPy\MPeself,\MPh\MPbself,\MPd\MPeself,
- \MPvar{distance},\MPvar{linewidth},\MPvar{linecolor}
+ \MPx{\textanchor},\MPy{\textanchor},\MPw{\textanchor},\MPh{\textanchor},
+ \MPvar{alternative},\MPvar{distance},\MPvar{linewidth},\MPvar{linecolor}
) ;
\stopMPpositiongraphic
\MPpositiongraphic{mpos:sidebar}{}%
@@ -138,6 +141,7 @@
[\v!margin]
[\c!rulecolor=\s!black,
\c!rulethickness=\@@karulethickness,
+ \c!alternative=0,
\c!distance=\dimexpr\leftmargindistance-\@@karulethickness/2\relax]
\definecomplexorsimple\startmarginrule
diff --git a/tex/context/base/anch-bck.mkvi b/tex/context/base/anch-bck.mkvi
index 759b6ada5..8ec056468 100644
--- a/tex/context/base/anch-bck.mkvi
+++ b/tex/context/base/anch-bck.mkvi
@@ -417,6 +417,10 @@
draw_multi_side
\stopuseMPgraphic
+\startuseMPgraphic{mpos:region:sideline:dashed}
+ draw_multi_side_path dashed evenly ;
+\stopuseMPgraphic
+
%D As an example we define a grid background:
\definetextbackground
diff --git a/tex/context/base/anch-pgr.mkiv b/tex/context/base/anch-pgr.mkiv
index 8caa09c69..a417d26e3 100644
--- a/tex/context/base/anch-pgr.mkiv
+++ b/tex/context/base/anch-pgr.mkiv
@@ -488,6 +488,8 @@
\let\dohandleMPpositiongraphicrange\docleanMPpositiongraphicrange
\to \everycleanpositionaction
+\let\dohandleMPpositiongraphicrange\gobblefourarguments
+
% Helpers:
\def\MPgetposboxes #1#2{\ctxcommand{fetchposboxes("#1","#2",\the\realpageno)}}
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index ec14cb9e4..ff5a95a5a 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.05.10 17:00}
+\newcontextversion{2012.05.11 10:07}
%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/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index a3be92aa7..b8d2b7dad 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.05.10 17:00}
+\newcontextversion{2012.05.11 10:07}
%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/context-version.pdf b/tex/context/base/context-version.pdf
index 7d4b45c8e..6be315f83 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index cf930e8f9..07aa52736 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index a6011b7e7..e3eb44226 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.05.10 17:00}
+\edef\contextversion{2012.05.11 10:07}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 9f595171e..240bb76cc 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -23,7 +23,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.05.10 17:00}
+\edef\contextversion{2012.05.11 10:07}
%D For those who want to use this:
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index 7377682a9..15aff8925 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -1081,12 +1081,16 @@ local function makeoptions(options)
return (to == "table" and concat(options," ")) or (to == "string" and options) or ""
end
-local function runprogram(...)
- local command = format(...)
- if trace_conversion or trace_programs then
- report_inclusion("running %s",command)
+local function runprogram(template,binary,...)
+ local command = format(template,binary,...)
+ if os.which(binary) then
+ if trace_conversion or trace_programs then
+ report_inclusion("running: %s",command)
+ end
+ os.spawn(command)
+ else
+ report_inclusion("program '%s' is not installed, not running: %s",binary,command)
end
- os.spawn(command)
end
-- -- -- eps -- -- --
diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua
index 911506239..f9bd46e51 100644
--- a/tex/context/base/l-os.lua
+++ b/tex/context/base/l-os.lua
@@ -25,7 +25,7 @@ if not modules then modules = { } end modules ['l-os'] = {
-- maybe build io.flush in os.execute
local os = os
-local find, format, gsub, upper = string.find, string.format, string.gsub, string.upper
+local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
local random, ceil = math.random, math.ceil
local rawget, rawset, type, getmetatable, setmetatable, tonumber = rawget, rawset, type, getmetatable, setmetatable, tonumber
@@ -131,9 +131,9 @@ os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
os.name = os.name or (os.type == "windows" and "mswin" ) or "linux"
if os.type == "windows" then
- os.libsuffix, os.binsuffix = 'dll', 'exe'
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'dll', 'exe', { 'exe', 'cmd', 'bat' }
else
- os.libsuffix, os.binsuffix = 'so', ''
+ os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
function os.launch(str)
@@ -368,3 +368,36 @@ function os.timezone(delta)
return 1
end
end
+
+local memory = { }
+
+local function which(filename)
+ local fullname = memory[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
+ end
+ end
+ if not fullname then
+ fullname = false
+ end
+ memory[filename] = fullname
+ end
+ return fullname
+end
+
+os.which = which
+os.where = which
+
+-- print(os.which("inkscape.exe"))
+-- print(os.which("inkscape"))
+-- print(os.which("gs.exe"))
+-- print(os.which("ps2pdf"))
diff --git a/tex/context/base/s-inf-03.mkiv b/tex/context/base/s-inf-03.mkiv
index c9cfd54a1..1ff4cd0d0 100644
--- a/tex/context/base/s-inf-03.mkiv
+++ b/tex/context/base/s-inf-03.mkiv
@@ -1,6 +1,6 @@
% \nopdfcompression
-% \enablemode[ipad]
+\enablemode[ipad]
\doifmodeelse {ipad} {
@@ -10,13 +10,19 @@
\definefont
[TitlePageFont]
- [MonoBold at 20pt]
+ [MonoBold at 18pt]
+
+ \setupbodyfont
+ [tt,10pt]
} {
\definefont
[TitlePageFont]
- [MonoBold at 26pt]
+ [MonoBold at 24pt]
+
+ \setupbodyfont
+ [tt]
}
@@ -41,9 +47,6 @@
[xtitle]
[color=darkgreen]
-\setupbodyfont
- [tt]
-
\setupfootertexts
[\llap{\goto{\hbox to 5cm{\hss previous}}[previouspage]}%
\quad\pagenumber\quad
diff --git a/tex/context/base/spac-grd.mkiv b/tex/context/base/spac-grd.mkiv
index af9babe15..487521f6c 100644
--- a/tex/context/base/spac-grd.mkiv
+++ b/tex/context/base/spac-grd.mkiv
@@ -114,8 +114,8 @@
\ifdim\d_spac_lines_correction_before<\zeropoint\d_spac_lines_correction_before\zeropoint\fi
\ifdim\d_spac_lines_correction_after <\zeropoint\d_spac_lines_correction_after \zeropoint\fi}
-\unexpanded\def\dotopbaselinecorrection{\kern\d_spac_lines_correction_before}
-\unexpanded\def\dobotbaselinecorrection{\kern\d_spac_lines_correction_after }
+%unexpanded\def\dotopbaselinecorrection{\kern\d_spac_lines_correction_before}
+%unexpanded\def\dobotbaselinecorrection{\kern\d_spac_lines_correction_after }
% experiment, todo: proper mkiv mechanism
%
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index 55ba5e7b8..66698a49e 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -269,6 +269,8 @@ local function floored(n)
end
end
+-- check variables.none etc
+
local function snap_hlist(where,current,method,height,depth) -- method.strut is default
local list = current.list
--~ print(table.serialize(method))
diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv
index c7d097ccb..23229b650 100644
--- a/tex/context/base/spac-ver.mkiv
+++ b/tex/context/base/spac-ver.mkiv
@@ -467,30 +467,118 @@
\let\v_spac_lines_around_action_set\relax
\let\m_spac_lines_around \empty
+% \setvalue{\??linesaround\v!blank }{\blank}
+% \letvalue{\??linesaround\empty }\relax
+% \setvalue{\??linesaround\s!unknown}{\blank[\m_spac_lines_around]}
+%
+% \unexpanded\def\startlinecorrection
+% {\bgroup
+% \dodoubleempty\spac_lines_start_correction}
+%
+% \def\spac_lines_start_correction[#1][#2]% #2 gobbles spaces
+% {\edef\m_spac_lines_around{#1}%
+% \expandafter\let\expandafter\spac_lines_action_around\csname\??linesaround
+% \ifcsname\??linesaround\m_spac_lines_around\endcsname\m_spac_lines_around\else\s!unknown\fi
+% \endcsname
+% \spac_lines_action_around
+% \startbaselinecorrection
+% \offbaselinecorrection
+% \ignorespaces}
+%
+% \unexpanded\def\stoplinecorrection
+% {\stopbaselinecorrection
+% \spac_lines_action_around
+% \egroup}
+
\setvalue{\??linesaround\v!blank }{\blank}
-\setvalue{\??linesaround\v!local }{\setlocalhsize}
\letvalue{\??linesaround\empty }\relax
\setvalue{\??linesaround\s!unknown}{\blank[\m_spac_lines_around]}
+\def\spac_lines_action_around % we used to let this one but it's cleaner this way
+ {\csname\??linesaround % i.e. do it twice
+ \ifcsname\??linesaround\m_spac_lines_around\endcsname\m_spac_lines_around\else\s!unknown\fi
+ \endcsname}
+
\unexpanded\def\startlinecorrection
- {\bgroup
- \dodoubleempty\spac_lines_start_correction}
+ {\endgraf
+ \bgroup
+ \dosingleempty\spac_lines_start_correction}
+
+\unexpanded\def\startlocallinecorrection
+ {\endgraf
+ \bgroup
+ \setlocalhsize
+ \hsize\localhsize
+ \dosingleempty\spac_lines_start_correction}
+
+\def\spac_lines_start_correction
+ {\ifvmode
+ \expandafter\spac_lines_start_correction_yes
+ \else
+ \expandafter\spac_lines_start_correction_nop
+ \fi}
+
+\def\spac_lines_start_correction_nop[#1]%
+ {\vbox\bgroup
+ \ignorespaces
+ \let\spac_lines_stop_correction\spac_lines_stop_correction_nop}
-\def\spac_lines_start_correction[#1][#2]% #2 gobbles spaces
+\def\spac_lines_stop_correction_nop
+ {\removeunwantedspaces
+ \egroup}
+
+\newdimen\d_spac_prevdepth
+
+\def\spac_lines_start_correction_yes[#1]%
{\edef\m_spac_lines_around{#1}%
- \expandafter\let\expandafter\spac_lines_action_around\csname\??linesaround
- \ifcsname\??linesaround\m_spac_lines_around\endcsname\m_spac_lines_around\else\s!unknown\fi
- \endcsname
\spac_lines_action_around
- \startbaselinecorrection
- \offbaselinecorrection
- \ignorespaces}
+ \d_spac_prevdepth\prevdepth
+ \spac_lines_initialize_corrections
+ \offbaselinecorrection % ???
+ \setbox\scratchbox\vbox\bgroup
+ \ignorespaces
+ \let\spac_lines_stop_correction\spac_lines_stop_correction_yes}
-\unexpanded\def\stoplinecorrection
- {\stopbaselinecorrection
+\unexpanded\def\spac_lines_stop_correction_yes
+ {\removeunwantedspaces
+ \egroup
+ \ifgridsnapping
+ \blank[\v!white]%
+ \snaptogrid\hbox{\box\scratchbox}%
+ \else
+ \ifdim\d_spac_prevdepth<\maxdimen
+ \unless\ifdim\d_spac_prevdepth<\zeropoint
+ \ifdim\d_spac_prevdepth<\strutdp \relax
+ \pushlastnode
+ \ifdim\d_spac_prevdepth>\zeropoint
+ \kern-\d_spac_prevdepth
+ \fi
+ \kern\strutdp
+ \prevdepth\strutdp
+ \poplastnode
+ \fi
+ \fi
+ \fi
+ \ifdim\pagegoal<\maxdimen
+ \blank[\v!white,\the\d_spac_lines_correction_before]% \blank[\v!white]\dotopbaselinecorrection
+ \fi
+ \nointerlineskip % new
+ \dontleavehmode
+ \box\scratchbox
+ \endgraf
+ \blank[\the\d_spac_lines_correction_after]% \dobotbaselinecorrection
+ % \allowbreak % new, otherwise problems when many in a row
+ \prevdepth\strutdp
+ \fi
\spac_lines_action_around
\egroup}
+\unexpanded\def\stoplinecorrection{\spac_lines_stop_correction}
+
+\let\stoplocallinecorrection\stoplinecorrection
+
+% todo:
+
\unexpanded\def\correctwhitespace
{\dowithnextboxcs\correctwhitespacefinish\vbox}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 4ee6cbf9d..8a5cb9254 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 05e586174..98ec8c263 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 64c8a69ec..e3ea8182e 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 : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 05/10/12 17:00:26
+-- merge date : 05/11/12 10:07:59
do -- begin closure to overcome local limits and interference