summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context/data/scite/context/lexers/data/scite-context-data-metafun.lua4
-rw-r--r--context/data/scite/context/scite-context-data-metafun.properties47
-rw-r--r--metapost/context/base/mp-mlib.mpiv42
-rw-r--r--metapost/context/base/mp-tool.mpiv28
-rw-r--r--tex/context/base/buff-ini.mkiv2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4204 -> 4208 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-mps.lua95
-rw-r--r--tex/context/base/mlib-pps.lua9
-rw-r--r--tex/context/base/mult-fun.lua8
-rw-r--r--tex/context/base/node-aux.lua6
-rw-r--r--tex/context/base/page-set.mkiv42
-rw-r--r--tex/context/base/status-files.pdfbin24374 -> 24384 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin254528 -> 254535 bytes
-rw-r--r--tex/context/base/x-asciimath.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
17 files changed, 196 insertions, 95 deletions
diff --git a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
index 1662eeebf..d033d3e9b 100644
--- a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
+++ b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
@@ -1,4 +1,4 @@
return {
- ["commands"]={ "transparency", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "area" },
- ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "metapostversion", "maxdimensions" },
+ ["commands"]={ "transparency", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "area", "addbackground" },
+ ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "metapostversion", "maxdimensions", "drawoptionsfactor" },
} \ No newline at end of file
diff --git a/context/data/scite/context/scite-context-data-metafun.properties b/context/data/scite/context/scite-context-data-metafun.properties
index 11d237013..15c700ba6 100644
--- a/context/data/scite/context/scite-context-data-metafun.properties
+++ b/context/data/scite/context/scite-context-data-metafun.properties
@@ -26,29 +26,30 @@ withshadevector withshadecenter withshadestep withshadefraction cmyk \
spotcolor multitonecolor namedcolor drawfill undrawfill \
inverted uncolored softened grayed greyed \
onlayer along graphictext loadfigure externalfigure \
-figure register outlinetext withmask bitmapimage \
-colordecimals ddecimal dddecimal ddddecimal textext \
-thetextext rawtextext textextoffset verbatim thelabel \
-label autoalign transparent withtransparency property \
-properties withproperties asgroup infont space \
-crlf dquote percent SPACE CRLF \
-DQUOTE PERCENT grayscale greyscale withgray \
-withgrey colorpart readfile clearxy unitvector \
-center epsed anchored originpath infinite \
-break xstretched ystretched snapped pathconnectors \
-function constructedfunction constructedpath constructedpairs straightfunction \
-straightpath straightpairs curvedfunction curvedpath curvedpairs \
-evenly oddly condition pushcurrentpicture popcurrentpicture \
-arrowpath tensecircle roundedsquare colortype whitecolor \
-blackcolor basiccolors normalfill normaldraw visualizepaths \
+figure register outlinetext checkedbounds checkbounds \
+strut rule withmask bitmapimage colordecimals \
+ddecimal dddecimal ddddecimal textext thetextext \
+rawtextext textextoffset verbatim thelabel label \
+autoalign transparent withtransparency property properties \
+withproperties asgroup infont space crlf \
+dquote percent SPACE CRLF DQUOTE \
+PERCENT grayscale greyscale withgray withgrey \
+colorpart readfile clearxy unitvector center \
+epsed anchored originpath infinite break \
+xstretched ystretched snapped pathconnectors function \
+constructedfunction constructedpath constructedpairs straightfunction straightpath \
+straightpairs curvedfunction curvedpath curvedpairs evenly \
+oddly condition pushcurrentpicture popcurrentpicture arrowpath \
+tensecircle roundedsquare colortype whitecolor blackcolor \
+basiccolors normalfill normaldraw visualizepaths detailpaths \
naturalizepaths drawboundary drawwholepath drawpathonly visualizeddraw \
-visualizedfill draworigin drawboundingbox drawpath drawpoint \
-drawpoints drawcontrolpoints drawcontrollines drawpointlabels drawlineoptions \
-drawpointoptions drawcontroloptions drawlabeloptions draworiginoptions drawboundoptions \
-drawpathoptions resetdrawoptions undashed decorated redecorated \
-undecorated passvariable passarrayvariable tostring format \
-formatted startpassingvariable stoppassingvariable eofill eoclip \
-nofill area
+visualizedfill detaileddraw draworigin drawboundingbox drawpath \
+drawpoint drawpoints drawcontrolpoints drawcontrollines drawpointlabels \
+drawlineoptions drawpointoptions drawcontroloptions drawlabeloptions draworiginoptions \
+drawboundoptions drawpathoptions resetdrawoptions undashed decorated \
+redecorated undecorated passvariable passarrayvariable tostring \
+format formatted startpassingvariable stoppassingvariable eofill \
+eoclip nofill area addbackground
keywordclass.metafun.internals=\
nocolormodel greycolormodel graycolormodel rgbcolormodel \
@@ -56,5 +57,5 @@ cmykcolormodel shadefactor textextoffset normaltransparent multiplytransparent \
screentransparent overlaytransparent softlighttransparent hardlighttransparent colordodgetransparent \
colorburntransparent darkentransparent lightentransparent differencetransparent exclusiontransparent \
huetransparent saturationtransparent colortransparent luminositytransparent metapostversion \
-maxdimensions
+maxdimensions drawoptionsfactor
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index decdda15b..96c984e37 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -346,7 +346,7 @@ vardef plain_thelabel@#(expr p,z) =
enddef;
def plain_label = % takes two arguments, contrary to textext that takes one
- draw plain_thelabel
+ normaldraw plain_thelabel
enddef ;
let mfun_label = label ;
@@ -362,6 +362,12 @@ def usemetafunlabels =
let thelabel = mfun_thelabel ;
enddef ;
+vardef dotlabel@#(expr s,z) text t_ =
+ label@#(s,z) t_ ;
+ interim linecap := rounded ;
+ normaldraw z withpen pencircle scaled dotlabeldiam t_ ;
+enddef ;
+
plain_compatibility_data := plain_compatibility_data & "save label, thelabel ;" & "useplainlabels ;" ;
% next comes own own:
@@ -394,7 +400,7 @@ vardef thelabel@#(expr p,z) =
enddef;
def label = % takes two arguments, contrary to textext that takes one
- draw thelabel
+ normaldraw thelabel
enddef ;
vardef anchored@#(expr p, z) = % beware: no "+ mfun_laboff@#" here (never!)
@@ -907,10 +913,10 @@ def mfun_do_outline_options_r = enddef ;
vardef outlinetext@# (expr t) text rest =
save kind ; string kind ; kind := str @# ;
currentoutlinetext := currentoutlinetext + 1 ;
- image ( draw image (
+ image ( normaldraw image (
if mfun_trial_run :
% lua.mp.report("set outline text",currentoutlinetext);
- draw unitsquare
+ normaldraw unitsquare
withprescript "ot_stage=trial"
withprescript "ot_index=" & decimal currentoutlinetext
withprescript "ot_kind=" & kind
@@ -935,6 +941,34 @@ vardef outlinetext@# (expr t) text rest =
) mfun_do_outline_options_r ; )
enddef ;
+% A few helpers:
+
+numeric mfun_c_b_llx, mfun_c_b_h, mfun_c_b_w, mfun_c_b_l ;
+
+vardef checkedbounds(expr llx,lly,urx,ury) =
+ mfun_c_b_llx := min(xpart llcorner currentpicture,llx) ;
+ mfun_c_b_urx := max(xpart urcorner currentpicture,urx) ;
+ mfun_c_b_lly := min(ypart llcorner currentpicture,lly) ;
+ mfun_c_b_ury := max(ypart urcorner currentpicture,ury) ;
+ (mfun_c_b_llx,mfun_c_b_lly) --
+ (mfun_c_b_urx,mfun_c_b_lly) --
+ (mfun_c_b_urx,mfun_c_b_ury) --
+ (mfun_c_b_llx,mfun_c_b_ury) -- cycle
+enddef ;
+
+vardef checkbounds(expr llx,lly,urx,ury) =
+ setbounds currentpicture to checkedbounds(llx,lly,urx,ury) ;
+enddef ;
+
+vardef strut(expr ht,dp) =
+ setbounds currentpicture to checkedbounds(0,0,ht,dp) ;
+enddef ;
+
+vardef rule(expr wd,ht,dp) =
+ image (fill (0,-dp)--(wd,-dp)--(wd,ht)--(0,ht)--cycle)
+enddef ;
+
+
% Housekeeping
extra_beginfig := extra_beginfig & "currentgraphictext := 0 ; " ;
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index 341a0a41a..13104f17e 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -1077,13 +1077,13 @@ def drawpathoptions (text t) = def _pth_opt_ = t enddef ; enddef ;
numeric drawoptionsfactor ; drawoptionsfactor := pt ;
def resetdrawoptions =
- drawlineoptions (withpen pencircle scaled 1drawoptionsfactor withcolor .5white) ;
- drawpointoptions (withpen pencircle scaled 4drawoptionsfactor withcolor black) ;
- drawcontroloptions(withpen pencircle scaled 2.5drawoptionsfactor withcolor black) ;
+ drawlineoptions (withpen pencircle scaled 1.0 drawoptionsfactor withcolor .5white) ;
+ drawpointoptions (withpen pencircle scaled 4.0 drawoptionsfactor withcolor black) ;
+ drawcontroloptions(withpen pencircle scaled 2.5 drawoptionsfactor withcolor black) ;
drawlabeloptions () ;
- draworiginoptions (withpen pencircle scaled 1drawoptionsfactor withcolor .5white) ;
+ draworiginoptions (withpen pencircle scaled 1.0 drawoptionsfactor withcolor .5white) ;
drawboundoptions (dashed evenly _ori_opt_) ;
- drawpathoptions (withpen pencircle scaled 5drawoptionsfactor withcolor .8white) ;
+ drawpathoptions (withpen pencircle scaled 5.0 drawoptionsfactor withcolor .8white) ;
enddef ;
resetdrawoptions ;
@@ -1285,11 +1285,29 @@ def do_visualizedfill text t =
drawpointlabels _c_ ;
enddef ;
+def detaileddraw expr c =
+ if picture c : normaldraw c else : path _c_ ; _c_ := c ; do_detaileddraw fi
+enddef ;
+
+def do_detaileddraw text t =
+ drawpath _c_ t ;
+ drawcontrollines _c_ ;
+ drawcontrolpoints _c_ ;
+ drawpoints _c_ ;
+ % % for labels we need an third run (as the second will mark the numbers); i could preroll them
+ % % but then the hash needs to handle that as well (as now we keep numbering)
+ % drawpointlabels _c_ ;
+enddef ;
+
def visualizepaths =
let fill = visualizedfill ;
let draw = visualizeddraw ;
enddef ;
+def detailpaths =
+ let draw = detaileddraw ;
+enddef ;
+
def naturalizepaths =
let fill = normalfill ;
let draw = normaldraw ;
diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv
index cd6b7bfe5..0d3d8b792 100644
--- a/tex/context/base/buff-ini.mkiv
+++ b/tex/context/base/buff-ini.mkiv
@@ -170,7 +170,7 @@
\unexpanded\def\buff_get[#1]% [name]
{\namedbufferparameter\empty\c!before
-% \doifelsenothing{#1}
+ \doifelsenothing{#1}
{\buff_get_stored_indeed\empty}
{\processcommalist[#1]\buff_get_stored_indeed}%
\namedbufferparameter\empty\c!after}
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index c211c1c4d..3218ee57e 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{2015.07.12 23:30}
+\newcontextversion{2015.07.14 10:37}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 63e8b04f3..d2aec8d30 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.mkiv b/tex/context/base/context.mkiv
index 34b39aa35..aed7f884c 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2015.07.12 23:30}
+\edef\contextversion{2015.07.14 10:37}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/font-mps.lua b/tex/context/base/font-mps.lua
index 0cb07bbb8..478f29813 100644
--- a/tex/context/base/font-mps.lua
+++ b/tex/context/base/font-mps.lua
@@ -17,9 +17,11 @@ local formatters = string.formatters
-- CP1 = QP0 + 2/3 *(QP1-QP0)
-- CP2 = QP2 + 2/3 *(QP1-QP2)
-fonts = fonts or { }
-local metapost = fonts.metapost or { }
-fonts.metapost = metapost
+fonts = fonts or { }
+local metapost = fonts.metapost or { }
+fonts.metapost = metapost
+
+local trace_skips = false trackers.register("metapost.outlines.skips",function(v) trace_skips = v end)
local f_moveto = formatters["(%.4F,%.4F)"]
local f_lineto = formatters["--(%.4F,%.4F)"]
@@ -246,8 +248,11 @@ local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
+local rule_code = nodecodes.rule
local penalty_code = nodecodes.penalty
+local find_tail = nodes.tail
+
----- metapost = fonts.glyphs.metapost
local characters = fonts.hashes.characters
@@ -278,7 +283,8 @@ function metapost.output(kind,font,char,advance,shift)
local advance = advance or 0
local paths = topaths(glyf,factor)
local code = f_code(kind,#paths,advance,shift,paths)
- return code, glyf.width * factor
+ -- return code, glyf.width * factor
+ return code, character.width * fc
end
end
end
@@ -288,54 +294,78 @@ end
-- shifted hboxes
+local signal = -0x3FFFFFFF - 1
+
function fonts.metapost.boxtomp(n,kind)
local result = { }
- local advance = 0
+ local advance = 0 -- in bp
local distance = 0
+ local llx, lly, urx, ury = 0, 0, 0, 0
+
local boxtomp
- local function horizontal(current,shift,glue_sign,glue_set,glue_order)
+ local function horizontal(current,shift,glue_sign,glue_set,glue_order,ht,dp)
+ shift = shift or 0
while current do
local id = current.id
if id == glyph_code then
- local code, width = metapost.output(kind,current.font,current.char,advance,-(shift or 0)* fc)
+ local code, width = metapost.output(kind,current.font,current.char,advance,-shift*fc)
result[#result+1] = code
advance = advance + width
elseif id == disc_code then
local replace = current.replace
if replace then
- horizontal(replace,shift,glue_sign,glue_set,glue_order)
+ horizontal(replace,shift,glue_sign,glue_set,glue_order,ht,dp)
end
elseif id == kern_code then
- advance = advance + current.kern * fc
+ local kern = current.kern * fc
+ if trace_skips then -- todo: shift
+ result[#result+1] = formatters["draw rule(%3F,%3F,%3F) shifted (%3F,%3F) withcolor .5white;"](kern,0.8*ht*fc,0.8*dp*fc,advance,-shift*fc)
+ end
+ advance = advance + kern
elseif id == glue_code then
local spec = current.spec
local width = spec.width
if glue_sign == 1 then
if spec.stretch_order == glue_order then
- advance = advance + (width + spec.stretch * glue_set) * fc
+ width = (width + spec.stretch * glue_set) * fc
else
- advance = advance + width * fc
+ width = width * fc
end
elseif glue_sign == 2 then
if spec.shrink_order == glue_order then
- advance = advance + (width - spec.shrink * glue_set) * fc
+ width = (width - spec.shrink * glue_set) * fc
else
- advance = advance + width * fc
+ width = width * fc
end
else
- advance = advance + width * fc
+ width = width * fc
+ end
+ if trace_skips then -- todo: shift
+ result[#result+1] = formatters["draw rule(%3F,%3F,%3F) shifted (%3F,%3F) withcolor .5white;"](width,0.1*ht*fc,0.1*dp*fc,advance,-shift*fc)
end
+ advance = advance + width
elseif id == hlist_code then
local a = advance
- boxtomp(current,(shift or 0)+current.shift,current.glue_sign,current.glue_set,current.glue_order)
+ boxtomp(current,shift+current.shift,current.glue_sign,current.glue_set,current.glue_order)
advance = a + current.width * fc
elseif id == vlist_code then
- boxtomp(current) -- ,distance + (shift or 0),current.glue_set*current.glue_sign)
+ boxtomp(current) -- ,distance + shift,current.glue_set*current.glue_sign)
elseif id == rule_code then
- -- todo
+ local wd = current.width
+ local ht = current.height
+ local dp = current.depth
+ if not (ht == signal or dp == signal or wd == signal) then
+ ht = ht - shift
+ dp = dp - shift
+ if wd == 0 then
+ result[#result+1] = formatters["strut(%3F,%3F);"](ht*fc,-dp*fc)
+ else
+ result[#result+1] = formatters["draw rule(%3F,%3F,%3F);"](wd*fc,ht*fc,-dp*fc)
+ end
+ end
else
-- print("horizontal >>>",nodecodes[id])
end
@@ -344,22 +374,24 @@ function fonts.metapost.boxtomp(n,kind)
end
local function vertical(current,shift)
+ shift = shift or 0
+ current = find_tail(current) -- otherwise bad bbox
while current do
local id = current.id
if id == hlist_code then
- distance = distance + current.height
- boxtomp(current,distance + (shift or 0),current.glue_set*current.glue_sign)
- distance = distance + current.depth
+ distance = distance - current.depth
+ boxtomp(current,distance + shift,current.glue_set*current.glue_sign)
+ distance = distance - current.height
elseif id == vlist_code then
print("vertical >>>",nodecodes[id])
elseif id == kern_code then
- distance = distance + current.kern
+ distance = distance - current.kern
advance = 0
elseif id == glue_code then
- distance = distance + current.spec.width
+ distance = distance - current.spec.width
advance = 0
end
- current = current.next
+ current = current.prev
end
end
@@ -367,21 +399,24 @@ function fonts.metapost.boxtomp(n,kind)
local current = list.list
if current then
if list.id == hlist_code then
- horizontal(current,shift,list.glue_sign,list.glue_set,list.glue_order)
+ horizontal(current,shift,list.glue_sign,list.glue_set,list.glue_order,list.height,list.depth)
else
vertical(current,shift)
end
-result[#result+1] = formatters["setbounds currentpicture to %s;"] ( metapost.boundingbox (
- { boundingbox = { 0, -list.depth, list.width, list.height } },
- fc
-) )
end
end
- -- todo: honor struts / ht dp
-
local box = tex.box[n]
+
boxtomp(box,box.shift,box.glue_sign,box.glue_set,box.glue_order)
+
+ local wd = box.width
+ local ht = box.height
+ local dp = box.depth
+ local sh = box.shift
+
+ result[#result+1] = formatters["checkbounds(%3F,%3F,%3F,%3F);"](0,-dp*fc,wd*fc,ht*fc)
+
return concat(result)
end
diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua
index 0b31bd6bf..759149073 100644
--- a/tex/context/base/mlib-pps.lua
+++ b/tex/context/base/mlib-pps.lua
@@ -280,6 +280,9 @@ end
local function settext(box,slot)
if top then
+ -- if trace_textexts then
+ -- report_textexts("getting text %s from box %s",slot,box)
+ -- end
top.textexts[slot] = copy_list(texgetbox(box))
texsetbox(box,nil)
-- this can become
@@ -292,9 +295,9 @@ end
local function gettext(box,slot)
if top then
texsetbox(box,copy_list(top.textexts[slot]))
- if trace_textexts then
- report_textexts("putting text %s in box %s",slot,box)
- end
+ -- if trace_textexts then
+ -- report_textexts("putting text %s in box %s",slot,box)
+ -- end
-- top.textexts[slot] = nil -- no, pictures can be placed several times
else
-- weird error
diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua
index 1b750d73c..6be8e83db 100644
--- a/tex/context/base/mult-fun.lua
+++ b/tex/context/base/mult-fun.lua
@@ -13,6 +13,7 @@ return {
-- "angleoffset", anglelength", anglemethod",
"metapostversion",
"maxdimensions",
+ "drawoptionsfactor",
},
commands = {
"transparency",
@@ -51,6 +52,7 @@ return {
"onlayer",
"along",
"graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", -- "lua",
+ "checkedbounds", "checkbounds", "strut", "rule",
"withmask", "bitmapimage",
"colordecimals", "ddecimal", "dddecimal", "ddddecimal",
"textext", "thetextext", "rawtextext", "textextoffset",
@@ -106,9 +108,9 @@ return {
"colortype", "whitecolor", "blackcolor", "basiccolors",
--
-- "swappointlabels",
- "normalfill", "normaldraw", "visualizepaths", "naturalizepaths",
+ "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths",
"drawboundary", "drawwholepath", "drawpathonly",
- "visualizeddraw", "visualizedfill",
+ "visualizeddraw", "visualizedfill", "detaileddraw",
"draworigin", "drawboundingbox",
"drawpath",
"drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines",
@@ -125,5 +127,7 @@ return {
--
"eofill", "eoclip", "nofill",
"area",
+ --
+ "addbackground",
},
}
diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua
index 12da8ea8a..f9b300d1e 100644
--- a/tex/context/base/node-aux.lua
+++ b/tex/context/base/node-aux.lua
@@ -89,8 +89,10 @@ local function takebox(id)
if box then
local copy = copy_node(box)
local list = getlist(box)
- setfield(copy,"list",list)
- setfield(box,"list",nil)
+ if list then
+ setfield(copy,"list",list)
+ setfield(box,"list",nil)
+ end
texsetbox(id,nil)
return copy
end
diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv
index a5afb92e9..105fedb3e 100644
--- a/tex/context/base/page-set.mkiv
+++ b/tex/context/base/page-set.mkiv
@@ -694,7 +694,7 @@
\installcolumnbreakmethod \s!columnset \v!page
{\page_otr_fill_and_eject_page}
-
+
\newtoks\OTRSETeverystartofcolumn
\newbox\OTRSETsavedfootnotes
@@ -857,7 +857,7 @@
\fi}
\let\OTRSETcheckfreelines\donothing
-
+
\def\OTRSETfillgapsbetweencells#1#2% col
{\ifnum\columngaplimit>\zerocount
\donefalse
@@ -885,7 +885,7 @@
\appendtoks
\OTRSETfillgapsbetweencells\mofcolumns\plusone
\to \OTRSETeverystartofcolumn
-
+
\newif\ifspancolumnslots \spancolumnslotstrue
\newif\ifcheckcolumnspan \checkcolumnspantrue
@@ -963,7 +963,7 @@
\columnlastcell\savedcolumnlastcell
\OTRSETsavebox{#1}%
\fi}
-
+
\newdimen\totalcolumnspace
\def\columnspacetopoffset{0}
@@ -1298,7 +1298,7 @@
\ifnum#1<3\vss\fi
\egroup
\fi}
-
+
\unexpanded\def\page_set_command_check_if_float_fits
{\global\ifconditional\c_page_floats_not_permitted\setfalse\c_page_floats_room\else\settrue\c_page_floats_room\fi}
@@ -1334,6 +1334,13 @@
\ifdim\floatwidth>\zeropoint
\!!doneatrue
\page_floats_flush\s!text\plusone
+%
+% a quick hack ... will be redone
+%
+\ifdim\wd\floatbox<\floatwidth \ifhbox\floatbox
+ \global\setbox\floatbox\hbox{\unhbox\floatbox}%
+\fi \fi
+%
\dp\floatbox\zeropoint
\OTRSETstoreincolumnslot{TBLR}\floatbox
\if!!donea
@@ -1349,9 +1356,8 @@
\exitloop
\fi}
\egroup}
-
-\newif\ifcentergridcells \centergridcellstrue
+\newif\ifcentergridcells \centergridcellstrue
\newif\ifcentergridcellonly \centergridcellonlyfalse
\newif\ifautocentergridcellonly \autocentergridcellonlytrue
@@ -1420,7 +1426,7 @@
\fi
\fi}}%
\fi}
-
+
\def\OTRSETinitializecolumns% once per page
{\columnspreadtrue % todo
\ifcolumnspread
@@ -1442,7 +1448,7 @@
\OTRSETassignwidths
\global\mofcolumns\plusone
\page_set_cell_erase_grid}
-
+
% this is a first step in upgrading
\installcorenamespace{columnset}
@@ -1558,7 +1564,7 @@
\v!last=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}},
\s!default=>\OTRSETdummycolumn,
\s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]}
-
+
% to be documented and tested, not yet that robust
% \def\OTRSETgotocell#1#2%
@@ -1600,7 +1606,7 @@
{\endgraf
\doOTRSETgotoCOLUMN{#1}%
\doOTRSETgotoROW {#2}}
-
+
\def\OTRSETdummycolumn
{\verticalstrut
\vskip-\struttotal
@@ -2032,7 +2038,7 @@
\@EA\uppercasestring\floatmethod\to\floatmethod
\OTRSETstoreincolumnslot\floatmethod\floatbox
\page_floats_report_total}
-
+
% kind of new, looks much like OTRONE, but not entirely
\newconditional\c_page_set_top_of_insert
@@ -2046,10 +2052,8 @@
\ifnum\rootfloatparameter\c!nbottom=\zerocount
\ifnum\rootfloatparameter\c!nlines>\zerocount
\ifdim\totaltopinserted>\zeropoint\relax
- \dimen0\lineheight
- \dimen0=\rootfloatparameter\c!nlines\dimen0
- \advance\dimen0 \totaltopinserted\relax
- \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight
+ \scratchdimen\dimexpr\rootfloatparameter\c!nlines\lineheight+\totaltopinserted\relax
+ \ifdim\scratchdimen>\textheight % \vsize %%%%%%%%% \textheight
\showmessage\m!floatblocks8{\rootfloatparameter\c!nlines}%
\page_otr_fill_and_eject_page % was triple: vfilll
\fi
@@ -2080,7 +2084,7 @@
\blank[\rootfloatparameter\c!spaceafter]}%
\global\advance\d_page_floats_inserted_top \ht\scratchbox\relax
\ifdim\d_page_floats_inserted_top>\vsize % was \textheight\relax
- \OTRSETresavebox\floatbox
+ \OTRSETresavebox\scratchbox
\noffloatinserts\c_page_floats_n_of_top\relax
\global\advance\d_page_floats_inserted_top -\ht\scratchbox
\let\OTRSETdodosettopinserts\relax % to be tested
@@ -2167,7 +2171,7 @@
% \box\columnbotbox\mofcolumns}
\fi
\global\d_page_floats_inserted_bottom\zeropoint\relax} % goes away
-
+
% set ipv text
% left right 1 2 3 +1 +2 +3
@@ -2441,7 +2445,7 @@
\else
\d_strc_float_temp_width
\fi}
-
+
\unexpanded\def\definecolumnsetspan
{\dodoubleempty\dodefinecolumnsetspan}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 458af0624..71aec6f9b 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 9d961bd91..a200aa55e 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/x-asciimath.mkiv b/tex/context/base/x-asciimath.mkiv
index a1254a445..d3a629c81 100644
--- a/tex/context/base/x-asciimath.mkiv
+++ b/tex/context/base/x-asciimath.mkiv
@@ -157,7 +157,7 @@
}}%
\to \everysetupasciimath
-\newtoks\everyascimath
+\newtoks\everyasciimath
% \appendtoks
% \ignorediscretionaries
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 1fe4ebf40..5bd8eecf3 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 : 07/12/15 23:30:14
+-- merge date : 07/14/15 10:37:12
do -- begin closure to overcome local limits and interference