summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-05-05 20:33:15 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-05-05 20:33:15 +0200
commit52c91dd191d7bd30d41aaf259480ee862160a251 (patch)
tree7cdc9225b4d764377857bad57acdccd2d5178f85
parent6addefa380c1008fbc164890e8e95dd855a361c5 (diff)
downloadcontext-52c91dd191d7bd30d41aaf259480ee862160a251.tar.gz
2021-05-05 19:24:00
-rw-r--r--context/data/scite/context/lexers/data/scite-context-data-metafun.lua2
-rw-r--r--context/data/scite/context/scite-context-data-metafun.properties2
-rw-r--r--context/data/textadept/context/data/scite-context-data-metafun.lua2
-rw-r--r--context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json2
-rw-r--r--doc/context/sources/general/manuals/metafun/metafun-effects.tex8
-rw-r--r--metapost/context/base/mpxl/mp-abck.mpxl58
-rw-r--r--metapost/context/base/mpxl/mp-apos.mpxl159
-rw-r--r--metapost/context/base/mpxl/mp-asnc.mpxl2
-rw-r--r--metapost/context/base/mpxl/mp-lmtx.mpxl14
-rw-r--r--scripts/context/lua/mtx-install.lua6
-rw-r--r--scripts/context/lua/mtx-update.lua6
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-fr.mkii1
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/meta-grd.mkiv22
-rw-r--r--tex/context/base/mkiv/mult-aux.mkiv4
-rw-r--r--tex/context/base/mkiv/mult-fun.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23968 -> 23956 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin225146 -> 225363 bytes
-rw-r--r--tex/context/base/mkxl/anch-bar.mkxl27
-rw-r--r--tex/context/base/mkxl/anch-bck.mklx60
-rw-r--r--tex/context/base/mkxl/anch-pgr.lmt15
-rw-r--r--tex/context/base/mkxl/anch-pgr.mkxl17
-rw-r--r--tex/context/base/mkxl/colo-ini.mkxl7
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/cont-run.lmt31
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/font-mpf.lmt52
-rw-r--r--tex/context/base/mkxl/font-pre.mkxl2
-rw-r--r--tex/context/base/mkxl/libs-imp-zstd.lmt48
-rw-r--r--tex/context/base/mkxl/lpdf-emb.lmt18
-rw-r--r--tex/context/base/mkxl/meta-grd.mkxl40
-rw-r--r--tex/context/base/mkxl/meta-ini.lmt125
-rw-r--r--tex/context/base/mkxl/meta-ini.mkxl246
-rw-r--r--tex/context/base/mkxl/meta-pdf.mkxl2
-rw-r--r--tex/context/base/mkxl/meta-pdh.mkxl2
-rw-r--r--tex/context/base/mkxl/mlib-ctx.mkxl1
-rw-r--r--tex/context/base/mkxl/mlib-int.lmt218
-rw-r--r--tex/context/base/mkxl/mlib-lmp.lmt42
-rw-r--r--tex/context/base/mkxl/mlib-lua.lmt12
-rw-r--r--tex/context/base/mkxl/mlib-mat.lmt130
-rw-r--r--tex/context/base/mkxl/mlib-mpf.lmt70
-rw-r--r--tex/context/base/mkxl/mlib-pos.lmt59
-rw-r--r--tex/context/base/mkxl/mlib-pps.lmt8
-rw-r--r--tex/context/base/mkxl/mlib-scn.lmt115
-rw-r--r--tex/context/base/mkxl/mlib-snc.lmt43
-rw-r--r--tex/context/base/mkxl/mult-aux.mkxl73
-rw-r--r--tex/context/base/mkxl/pack-obj.lmt51
-rw-r--r--tex/context/base/mkxl/pack-obj.mkxl54
-rw-r--r--tex/context/base/mkxl/page-one.mkxl2
-rw-r--r--tex/context/base/mkxl/syst-ini.mkxl2
-rw-r--r--tex/context/interface/mkii/keys-fr.xml1
-rw-r--r--tex/context/modules/mkiv/m-steps.mkvi8
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
56 files changed, 1045 insertions, 840 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 a6b89c073..7e65fea98 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"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "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", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "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", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "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", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvar", "withtolerance" },
+ ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "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", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "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", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "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", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvard", "mpvarn", "mpvars", "mpvar", "withtolerance" },
["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "pushparameters", "popparameters", "definecolor" },
} \ 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 dde76c2f6..ab55d9302 100644
--- a/context/data/scite/context/scite-context-data-metafun.properties
+++ b/context/data/scite/context/scite-context-data-metafun.properties
@@ -80,7 +80,7 @@ report lua lualist mp MP \
luacall mirrored mirroredabout scriptindex newscriptindex \
newcolor newrgbcolor newcmykcolor newnumeric newboolean \
newtransform newpath newpicture newstring newpair \
-mpvar withtolerance
+mpvard mpvarn mpvars mpvar withtolerance
keywordclass.metafun.internals=\
nocolormodel greycolormodel graycolormodel rgbcolormodel \
diff --git a/context/data/textadept/context/data/scite-context-data-metafun.lua b/context/data/textadept/context/data/scite-context-data-metafun.lua
index a6b89c073..7e65fea98 100644
--- a/context/data/textadept/context/data/scite-context-data-metafun.lua
+++ b/context/data/textadept/context/data/scite-context-data-metafun.lua
@@ -1,4 +1,4 @@
return {
- ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "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", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "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", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "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", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvar", "withtolerance" },
+ ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "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", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "withpattern", "withpatternscale", "withpatternfloat", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "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", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "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", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvard", "mpvarn", "mpvars", "mpvar", "withtolerance" },
["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "pushparameters", "popparameters", "definecolor" },
} \ No newline at end of file
diff --git a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json
index a729a57ba..210a7aad5 100644
--- a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json
+++ b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json
@@ -60,7 +60,7 @@
"name" : "context.extra"
},
"helper" : {
- "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withtolerance|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecentertwo|withshadecenterone|withshadecenter|withshade|withproperties|withpatternscale|withpatternfloat|withpattern|withopacity|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|validtexbox|utfsub|utfnum|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|thefmttext|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shownshadedirection|shownshadecenter|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setglobaltoks|setglobalmacro|setglobaldimen|setglobalcount|setdimen|setcount|scriptindex|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|rawmadetext|rawfmttext|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|onetimetextext|onetimefmttext|oddly|nothing|notcached|normalfill|normaldraw|nofill|nodraw|newtransform|newstring|newscriptindex|newrgbcolor|newpicture|newpath|newpair|newnumeric|newhash|newcolor|newcmykcolor|newboolean|naturalizepaths|namedcolor|multitonecolor|mpvar|mp|mirroredabout|mirrored|lualist|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fmttext|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|dofill|dodraw|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])",
+ "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withtolerance|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecentertwo|withshadecenterone|withshadecenter|withshade|withproperties|withpatternscale|withpatternfloat|withpattern|withopacity|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|validtexbox|utfsub|utfnum|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|thefmttext|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shownshadedirection|shownshadecenter|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setglobaltoks|setglobalmacro|setglobaldimen|setglobalcount|setdimen|setcount|scriptindex|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|rawmadetext|rawfmttext|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|onetimetextext|onetimefmttext|oddly|nothing|notcached|normalfill|normaldraw|nofill|nodraw|newtransform|newstring|newscriptindex|newrgbcolor|newpicture|newpath|newpair|newnumeric|newhash|newcolor|newcmykcolor|newboolean|naturalizepaths|namedcolor|multitonecolor|mpvars|mpvarn|mpvard|mpvar|mp|mirroredabout|mirrored|lualist|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fmttext|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|dofill|dodraw|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])",
"name" : "context.command.metafun.helper.mps"
},
"identifier" : {
diff --git a/doc/context/sources/general/manuals/metafun/metafun-effects.tex b/doc/context/sources/general/manuals/metafun/metafun-effects.tex
index 6c020acda..16fb4ef6a 100644
--- a/doc/context/sources/general/manuals/metafun/metafun-effects.tex
+++ b/doc/context/sources/general/manuals/metafun/metafun-effects.tex
@@ -1237,7 +1237,7 @@ definition.
\startbuffer
\startMPclip{head clip}
- w := \width ; h := \height ;
+ w := OverlayWidth ; h := OverlayHeight ;
clip currentpicture to
((0,h)--(w,h){down}..{left}(0,0)--cycle) ;
\stopMPclip
@@ -1305,7 +1305,7 @@ We can call up such a buffer as if it were an external figure. \in {Figure}
\startbuffer[a]
\startMPclip{text clip}
clip currentpicture to fullcircle shifted (.5,.5)
- xscaled \width yscaled \height ;
+ xscaled OverlayWidth yscaled OverlayHeight ;
\stopMPclip
\stopbuffer
@@ -1373,7 +1373,7 @@ in a similar way, using the predefined path \type {diamond}:
\starttyping
\startMPclip{diamond}
clip currentpicture to unitdiamond
- xscaled \width yscaled \height ;
+ xscaled OverlayWidth yscaled OverlayHeight ;
\stopMPclip
\stoptyping
@@ -1384,7 +1384,7 @@ with \CONTEXT.
\starttyping
\startMPclip{negellipse}
clip currentpicture to (unitcircle peepholed unitsquare)
- xscaled \width yscaled \height ;
+ xscaled OverlayWidth yscaled OverlayHeight ;
\stopMPclip
\stoptyping
diff --git a/metapost/context/base/mpxl/mp-abck.mpxl b/metapost/context/base/mpxl/mp-abck.mpxl
index d0bf0a0f8..730aed21d 100644
--- a/metapost/context/base/mpxl/mp-abck.mpxl
+++ b/metapost/context/base/mpxl/mp-abck.mpxl
@@ -31,26 +31,44 @@ numeric par_strut_height,
nofmultipars := 0 ;
par_strut_height := 0 ;
par_strut_depth := 0 ;
-par_line_height := 0 ;
-
-def boxgridoptions = withcolor .8red enddef ;
-def boxlineoptions = withcolor .8blue enddef ;
-def boxfilloptions = withcolor .8white enddef ;
-
-numeric boxgridtype ; boxgridtype := 0 ;
-numeric boxlinetype ; boxlinetype := 1 ;
-numeric boxfilltype ; boxfilltype := 1 ;
-numeric boxdashtype ; boxdashtype := 0 ;
-pair boxgriddirection ; boxgriddirection := up ;
-numeric boxgridwidth ; boxgridwidth := 1pt ;
-numeric boxlinewidth ; boxlinewidth := 1pt ;
-numeric boxlineradius ; boxlineradius := 0 ;
-numeric boxlineoffset ; boxlineoffset := 0 ;
-numeric boxfilloffset ; boxfilloffset := 0 ;
-numeric boxgriddistance ; boxgriddistance := .5cm ;
-numeric boxgridshift ; boxgridshift := 0 ;
-
-mutable multipars, multiregs, multibox, multikind, multilocs, nofmultipars ;
+% par_line_height := 0 ;
+
+pair boxgriddirection ; boxgriddirection := up ; % to be interfaced
+numeric boxgriddistance ; boxgriddistance := .5cm ; % to be interfaced
+
+def boxgridtype = (runscript mfid_mpvarn "gridtype" ) enddef ;
+def boxgridwidth = (runscript mfid_mpvard "gridwidth" ) enddef ;
+def boxgridshift = (runscript mfid_mpvard "gridshift" ) enddef ;
+def boxgridcolor = (runscript mfid_mpvars "gridcolor" ) enddef ;
+
+def boxlinetype = (runscript mfid_mpvarn "linetype" ) enddef ;
+def boxlinewidth = (runscript mfid_mpvard "linewidth" ) enddef ;
+def boxlineradius = (runscript mfid_mpvard "lineradius") enddef ;
+def boxlineoffset = (runscript mfid_mpvard "lineoffset") enddef ;
+def boxlinecolor = (runscript mfid_mpvars "linecolor" ) enddef ;
+
+def boxfilltype = (runscript mfid_mpvarn "filltype" ) enddef ;
+def boxfilloffset = (runscript mfid_mpvard "filloffset") enddef ;
+def boxfillcolor = (runscript mfid_mpvars "fillcolor" ) enddef ;
+
+def boxdashtype = (runscript mfid_mpvarn "dashtype" ) enddef ;
+
+def boxalternative = (runscript mfid_mpvarn "alternative" ) enddef;
+def boxdistance = (runscript mfid_mpvard "distance" ) enddef;
+def boxtopoffset = (runscript mfid_mpvard "topoffset" ) enddef;
+def boxbottomoffset = (runscript mfid_mpvard "bottomoffset") enddef;
+
+def boxgridoptions = withcolor boxgridcolor enddef ;
+def boxlineoptions = withcolor boxlinecolor enddef ;
+def boxfilloptions = withcolor boxfillcolor enddef ;
+
+mutable
+ multipars, multiregs, multibox, multikind, multilocs, nofmultipars,
+ boxgridtype, boxgridwidth, boxgridshift, boxgridcolor,
+ boxlinetype, boxlinewidth, boxlineradius, boxlineoffset, boxlinecolor,
+ boxfilltype, boxfilloffset, boxfillcolor, boxdashtype,
+ boxalternative, boxdistance, boxtopoffset, boxbottomoffset,
+ boxgridoptions, boxlineoptions, boxfilloptions ;
vardef abck_draw_path(expr p) =
if (length p > 2) and (bbwidth(p) > 1) and (bbheight(p) > 1) :
diff --git a/metapost/context/base/mpxl/mp-apos.mpxl b/metapost/context/base/mpxl/mp-apos.mpxl
index e3746540f..65d3e86fb 100644
--- a/metapost/context/base/mpxl/mp-apos.mpxl
+++ b/metapost/context/base/mpxl/mp-apos.mpxl
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D Massimiliano Farinella added jiggles (zigzags) to the sidebars.
+
if known metafun_loaded_apos : endinput ; fi ;
newinternal boolean metafun_loaded_apos ; metafun_loaded_apos := true ; immutable metafun_loaded_apos ;
@@ -68,38 +70,104 @@ enddef ;
% anch-bar:
-def anch_sidebars_draw (expr firstpage, lastpage, yfirst, ylast, height, depth,
- x, y, w, h, alternative, distance, linewidth, linecolor, topoffset, bottomoffset) =
+% When Massimiliano Farinella (aka mf) added the patterns with jiggles the interface got
+% upgraded to lmtx too. So this one is different from the mkiv version! Messed up a little
+% by me to fit in the rest.
+
+vardef anch_sidebars_pattern(expr a, b, pattern, patternlength, patternheight, linewidth) =
+ image (
+ save p, q, s ; pair p, s ; path q ;
+ s := ( (b - a) / arclength (a -- b) ) * patternlength ;
+ q := pattern xscaled patternlength yscaled patternheight rotated (angle(s)) ;
+ p := a ;
+ forever :
+ draw
+ q shifted p
+ withpen pencircle scaled linewidth ;
+ p := p + s ;
+ exitif arclength (a -- p) > arclength (a -- b) ;
+ endfor ;
+ clip currentpicture to
+ (xpart llcorner currentpicture, ypart b) --
+ (xpart lrcorner currentpicture, ypart b) --
+ (xpart urcorner currentpicture, ypart a) --
+ (xpart ulcorner currentpicture, ypart a) -- cycle ;
+ )
+enddef ;
+
+% (performance wise) we can fetch distance and alternative once
+
+def anch_sidebars_draw(expr b_self, e_self, t_anchor) = % even these three can become variables
% beware, we anchor at (x,y)
begingroup ;
- if alternative = 1 :
- interim linecap := rounded ;
- else :
- interim linecap := butt ;
- fi ;
- save a, b ; pair a, b ;
- if firstpage = lastpage :
- a := (-distance,yfirst+height-y) ;
- b := (-distance,ylast-depth-y) ;
- elseif RealPageNumber = firstpage :
- a := (-distance,yfirst+height-y) ;
- b := (-distance,0) ;
- elseif RealPageNumber = lastpage :
- a := (-distance,h) ;
- b := (-distance,ylast-depth-y) ;
- else :
- a := (-distance,h) ;
- b := (-distance,0) ;
- fi ;
- a := (xpart a, min(ypart a + topoffset, h)) ;
- b := (xpart b, max(ypart b - bottomoffset,0)) ;
- draw
- a -- b
- if alternative = 1 :
- dashed (withdots scaled (linewidth/2))
- fi
- withpen pencircle scaled linewidth
- withcolor linecolor ;
+ interim linecap := if boxalternative = 1 : rounded else : butt fi ;
+ save a, b, lw, by ; pair a, b ; numeric lw, by ;
+ by := getposy(getposregion(b_self)) - getposy(t_anchor) ; % for mf to do: all of them
+ if getpospage(b_self) = getpospage(e_self) :
+ a := (-boxdistance,getposy(b_self) + getposheight(b_self) - getposy(t_anchor)) ;
+ b := (-boxdistance,getposy(e_self) - getposdepth (e_self) - getposy(t_anchor)) ;
+ elseif RealPageNumber = getpospage(b_self) :
+ a := (-boxdistance,getposy(b_self) + getposheight(b_self) - getposy(t_anchor)) ;
+ b := (-boxdistance,by) ;
+ elseif RealPageNumber = getpospage(e_self) :
+ a := (-boxdistance,getposheight(t_anchor)) ;
+ b := (-boxdistance,getposy(e_self) - getposdepth (e_self) - getposy(t_anchor)) ;
+ else :
+ a := (-boxdistance,getposheight(t_anchor)) ;
+ b := (-boxdistance,0) ;
+ fi ;
+ if a == b :
+ message("side bar pattern ignored: a == b") ;
+ else :
+ a := (xpart a, min(ypart a + boxtopoffset,getposheight(t_anchor))) ;
+ b := (xpart b, max(ypart b - boxbottomoffset,0)) ;
+ % DoubleSided should come from an option of \setupsidebar
+ save DoubleSided ; boolean DoubleSided ; DoubleSided := true ;
+ if OnOddPage and DoubleSided :
+ a := (xpart a + HSize + 2 * boxdistance,ypart a) ;
+ b := (xpart b + HSize + 2 * boxdistance,ypart b) ;
+ fi ;
+ lw := boxlinewidth ;
+ draw
+ if boxalternative = 2 :
+ anch_sidebars_pattern(a, b,
+ ((0,0)--(0.25,-0.5)--(0.75,0.5)--(1,0)) scaled lw,
+ 2lw, 2lw, lw
+ )
+ elseif boxalternative = 3 :
+ anch_sidebars_pattern(a, b,
+ ((0,0)--(0.25,-0.5)--(0.75,0.5)--(1,0)) scaled lw,
+ 4lw, 1.5lw, lw
+ )
+ elseif boxalternative = 4 :
+ anch_sidebars_pattern(a, b,
+ (((0,0) .. controls (0,0.5) and (0.5,0.5) .. (0.5,0)) -- ((0.5,0) .. controls (0.5,-0.5) and (1,-0.5) .. (1,0))) scaled lw,
+ 6lw, 4lw, lw
+ )
+ elseif boxalternative = 5 :
+ anch_sidebars_pattern(a, b,
+ ((0,0) .. controls (0,1) and (1,1) .. (1,0)) scaled lw,
+ 4lw, 2lw, lw
+ )
+ elseif boxalternative = 6 :
+ anch_sidebars_pattern(a, b,
+ ((0,0.5) .. (1,-0.5)) scaled lw,
+ 4lw, 2lw, lw
+ )
+ elseif boxalternative = 7 :
+ anch_sidebars_pattern(a, b,
+ ((0,-0.5) .. (1,0.5)) scaled lw,
+ 22lw, 5lw, lw
+ )
+ else :
+ (a -- b)
+ if boxalternative = 1 :
+ dashed (withdots scaled (lw/2))
+ fi
+ withpen pencircle scaled lw
+ fi
+ withcolor boxlinecolor ;
+ fi ;
endgroup ;
enddef ;
@@ -110,3 +178,34 @@ newscriptindex mfid_getmultipars ; mfid_getmultipars := scriptindex "getmultipar
def getposboxes (expr tags, anchor) = runscript mfid_getposboxes tags anchor ; enddef ;
def getmultipars(expr tags, anchor) = runscript mfid_getmultipars tags anchor ; enddef ;
+
+newscriptindex mfid_getpospage ; mfid_getpospage := scriptindex "getpospage" ; vardef getpospage (expr n) = runscript mfid_getpospage n enddef ;
+newscriptindex mfid_getposparagraph ; mfid_getposparagraph := scriptindex "getposparagraph" ; vardef getposparagraph (expr n) = runscript mfid_getposparagraph n enddef ;
+newscriptindex mfid_getposcolumn ; mfid_getposcolumn := scriptindex "getposcolumn" ; vardef getposcolumn (expr n) = runscript mfid_getposcolumn n enddef ;
+newscriptindex mfid_getposregion ; mfid_getposregion := scriptindex "getposregion" ; vardef getposregion (expr n) = runscript mfid_getposregion n enddef ;
+
+newscriptindex mfid_getposx ; mfid_getposx := scriptindex "getposx" ; vardef getposx (expr n) = runscript mfid_getposx n enddef ;
+newscriptindex mfid_getposy ; mfid_getposy := scriptindex "getposy" ; vardef getposy (expr n) = runscript mfid_getposy n enddef ;
+newscriptindex mfid_getposwidth ; mfid_getposwidth := scriptindex "getposwidth" ; vardef getposwidth (expr n) = runscript mfid_getposwidth n enddef ;
+newscriptindex mfid_getposheight ; mfid_getposheight := scriptindex "getposheight" ; vardef getposheight (expr n) = runscript mfid_getposheight n enddef ;
+newscriptindex mfid_getposdepth ; mfid_getposdepth := scriptindex "getposdepth" ; vardef getposdepth (expr n) = runscript mfid_getposdepth n enddef ;
+
+newscriptindex mfid_getposleftskip ; mfid_getposleftskip := scriptindex "getposleftskip" ; vardef getposleftskip (expr n) = runscript mfid_getposleftskip n enddef ;
+newscriptindex mfid_getposrightskip ; mfid_getposrightskip := scriptindex "getposrightskip" ; vardef getposrightskip (expr n) = runscript mfid_getposrightskip n enddef ;
+newscriptindex mfid_getposhsize ; mfid_getposhsize := scriptindex "getposhsize" ; vardef getposhsize (expr n) = runscript mfid_getposhsize n enddef ;
+newscriptindex mfid_getposparindent ; mfid_getposparindent := scriptindex "getposparindent" ; vardef getposparindent (expr n) = runscript mfid_getposparindent n enddef ;
+newscriptindex mfid_getposhangindent ; mfid_getposhangindent := scriptindex "getposhangindent" ; vardef getposhangindent(expr n) = runscript mfid_getposhangindent n enddef ;
+newscriptindex mfid_getposhangafter ; mfid_getposhangafter := scriptindex "getposhangafter" ; vardef getposhangafter (expr n) = runscript mfid_getposhangafter n enddef ;
+
+newscriptindex mfid_getposxy ; mfid_getposxy := scriptindex "getposxy" ; vardef getposxy (expr n) = runscript mfid_getposxy n enddef ;
+newscriptindex mfid_getposupperleft ; mfid_getposupperleft := scriptindex "getposupperleft" ; vardef getposupperleft (expr n) = runscript mfid_getposupperleft n enddef ;
+newscriptindex mfid_getposlowerleft ; mfid_getposlowerleft := scriptindex "getposlowerleft" ; vardef getposlowerleft (expr n) = runscript mfid_getposlowerleft n enddef ;
+newscriptindex mfid_getposupperright ; mfid_getposupperright := scriptindex "getposupperright" ; vardef getposupperright(expr n) = runscript mfid_getposupperright n enddef ;
+newscriptindex mfid_getposlowerright ; mfid_getposlowerright := scriptindex "getposlowerright" ; vardef getposlowerright(expr n) = runscript mfid_getposlowerright n enddef ;
+
+permanent
+ getposboxes, getmultipars,
+ getpospage, getposparagraph, getposcolumn, getposregion,
+ getposx, getposy, getposwidth, getposheight, getposdepth,
+ getposleftskip, getposrightskip, getposhsize, getposparindent, getposhangindent, getposhangafter,
+ getposxy, getposupperleft, getposlowerleft, getposupperright, getposlowerright ;
diff --git a/metapost/context/base/mpxl/mp-asnc.mpxl b/metapost/context/base/mpxl/mp-asnc.mpxl
index 0e5d3491b..367a99d81 100644
--- a/metapost/context/base/mpxl/mp-asnc.mpxl
+++ b/metapost/context/base/mpxl/mp-asnc.mpxl
@@ -60,6 +60,8 @@ presetparameters "synchronizer" [
def lmt_synchronizer = applyparameters "synchronizer" "lmt_do_synchronizer" enddef ;
+% boxdx boxdy ...
+
vardef lmt_do_synchronizer =
pushparameters "synchronizer" ;
begingroup ;
diff --git a/metapost/context/base/mpxl/mp-lmtx.mpxl b/metapost/context/base/mpxl/mp-lmtx.mpxl
index 7399fa711..204986df3 100644
--- a/metapost/context/base/mpxl/mp-lmtx.mpxl
+++ b/metapost/context/base/mpxl/mp-lmtx.mpxl
@@ -2361,11 +2361,19 @@ permanent scrutenized ;
%
% permanent mpv_numeric, mpv_dimension, mpv_string ;
-newscriptindex mfid_mpvar ; mfid_mpvar := scriptindex "mpvar" ;
+% newscriptindex mfid_mpvar ; mfid_mpvar := scriptindex "mpvar" ;
+%
+% def mpvar = runscript mfid_mpvar enddef ;
+
+% d(imension) n(umber) s(tring) b(oolean) <heuristic>
-def mpvar = runscript mfid_mpvar enddef ;
+newscriptindex mfid_mpvard ; mfid_mpvard := scriptindex "mpvard" ; def mpvard = runscript mfid_mpvard enddef ; % dimension
+newscriptindex mfid_mpvarn ; mfid_mpvarn := scriptindex "mpvarn" ; def mpvarn = runscript mfid_mpvarn enddef ; % numeric
+newscriptindex mfid_mpvars ; mfid_mpvars := scriptindex "mpvars" ; def mpvars = runscript mfid_mpvars enddef ; % string
+newscriptindex mfid_mpvarb ; mfid_mpvarb := scriptindex "mpvarb" ; def mpvarb = runscript mfid_mpvarb enddef ; % string
+newscriptindex mfid_mpvar ; mfid_mpvar := scriptindex "mpvar" ; def mpvar = runscript mfid_mpvar enddef ; % automatic
-permanent mpvar ;
+permanent mpvard, mpvarn, mpvars, mpvarb, mpvar ;
% for old times sake (metafun manual)
diff --git a/scripts/context/lua/mtx-install.lua b/scripts/context/lua/mtx-install.lua
index 5536bea1e..08befc322 100644
--- a/scripts/context/lua/mtx-install.lua
+++ b/scripts/context/lua/mtx-install.lua
@@ -93,9 +93,9 @@ local platforms = {
--
["linux-armhf"] = "linux-armhf",
--
- ["openbsd"] = "openbsd6.8",
- ["openbsd-i386"] = "openbsd6.8",
- ["openbsd-amd64"] = "openbsd6.8-amd64",
+ ["openbsd"] = "openbsd6.9",
+ ["openbsd-i386"] = "openbsd6.9",
+ ["openbsd-amd64"] = "openbsd6.9-amd64",
--
["freebsd"] = "freebsd",
["freebsd-i386"] = "freebsd",
diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua
index f360c996b..0f56fed62 100644
--- a/scripts/context/lua/mtx-update.lua
+++ b/scripts/context/lua/mtx-update.lua
@@ -178,9 +178,9 @@ update.platforms = {
--
["linux-armhf"] = "linux-armhf",
--
- ["openbsd"] = "openbsd6.8",
- ["openbsd-i386"] = "openbsd6.8",
- ["openbsd-amd64"] = "openbsd6.8-amd64",
+ ["openbsd"] = "openbsd6.9",
+ ["openbsd-i386"] = "openbsd6.9",
+ ["openbsd-amd64"] = "openbsd6.9-amd64",
--
["freebsd"] = "freebsd",
["freebsd-i386"] = "freebsd",
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 2086790a3..148bec8d9 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2021.04.29 23:04}
+\newcontextversion{2021.05.05 19:22}
%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 8a7a89fdc..6d7654636 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.04.29 23:04}
+\edef\contextversion{2021.05.05 19:22}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii
index ef2da9e49..409add42f 100644
--- a/tex/context/base/mkii/mult-fr.mkii
+++ b/tex/context/base/mkii/mult-fr.mkii
@@ -761,6 +761,7 @@
\setinterfaceconstant{coupling}{couplage}
\setinterfaceconstant{couplingway}{faconcouplage}
\setinterfaceconstant{criterium}{critere}
+\setinterfaceconstant{crop}{recadre}
\setinterfaceconstant{cropoffset}{decalagerecadre}
\setinterfaceconstant{crossreference}{renvoi}
\setinterfaceconstant{cssfile}{fichiercss}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 18ec52a17..f8620d2dc 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.04.29 23:04}
+\newcontextversion{2021.05.05 19:22}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 06ea3e597..c5d091ace 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.04.29 23:04}
+\edef\contextversion{2021.05.05 19:22}
%D Kind of special:
diff --git a/tex/context/base/mkiv/meta-grd.mkiv b/tex/context/base/mkiv/meta-grd.mkiv
index 15a4471e7..0296c68a6 100644
--- a/tex/context/base/mkiv/meta-grd.mkiv
+++ b/tex/context/base/mkiv/meta-grd.mkiv
@@ -140,20 +140,20 @@
save sc, dx, dy, wd, ht, ox, oy, ax, ay ;
- sc = \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
- dx = \MPdpar\directdummyparameter\c!dx*sc ;
- dy = \MPdpar\directdummyparameter\c!dy*sc ;
- wd = \directdummyparameter\c!nx*dx ;
- ht = \directdummyparameter\c!ny*dy ;
- ox = \MPdpar\directdummyparameter\c!xoffset\relax ;
- oy = \MPdpar\directdummyparameter\c!yoffset\relax ;
+ sc := \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
+ dx := \MPdpar\directdummyparameter\c!dx*sc ;
+ dy := \MPdpar\directdummyparameter\c!dy*sc ;
+ wd := \directdummyparameter\c!nx*dx ;
+ ht := \directdummyparameter\c!ny*dy ;
+ ox := \MPdpar\directdummyparameter\c!xoffset\relax ;
+ oy := \MPdpar\directdummyparameter\c!yoffset\relax ;
if "\directdummyparameter\c!align" = "\v!middle" :
- ax = \MPdpar\directdummyparameter\c!dx/2
- ay = \MPdpar\directdummyparameter\c!dy/2
+ ax := \MPdpar\directdummyparameter\c!dx/2 ;
+ ay := \MPdpar\directdummyparameter\c!dy/2 ;
else :
- ax = 0 ;
- ay = 0 ;
+ ax := 0 ;
+ ay := 0 ;
fi ;
draw image (
diff --git a/tex/context/base/mkiv/mult-aux.mkiv b/tex/context/base/mkiv/mult-aux.mkiv
index d7921bcc2..5992ed39f 100644
--- a/tex/context/base/mkiv/mult-aux.mkiv
+++ b/tex/context/base/mkiv/mult-aux.mkiv
@@ -656,11 +656,11 @@
\installparametersethandler {#1}{#2}%
\installrootparameterhandler{#1}{#2}}
-\protected\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installbasicautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}}
-\protected\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installstylisticautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 2bb101ae7..9fc125bcd 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -204,7 +204,7 @@ return {
"newcolor", "newrgbcolor", "newcmykcolor",
"newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair",
--
- "mpvar",
+ "mpvard", "mpvarn", "mpvars", "mpvar",
--
"withtolerance",
--
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 88bc8d7fb..f9c75ae72 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 e02a4f376..a56c1254f 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkxl/anch-bar.mkxl b/tex/context/base/mkxl/anch-bar.mkxl
index 252f41239..71cc7f163 100644
--- a/tex/context/base/mkxl/anch-bar.mkxl
+++ b/tex/context/base/mkxl/anch-bar.mkxl
@@ -17,8 +17,8 @@
%D This can be done better now ...
-%D We will implement a sidebar mechanism using the functionality from
-%D \type {core-pos}.
+%D We will implement a sidebar mechanism using the functionality from \type
+%D {core-pos}.
%D
%D \starttyping
%D \definesidebar[whow][rulecolor=green,distance=0pt]
@@ -109,16 +109,14 @@
\else
\advance\d_anch_sidebars_distance\scratchdistance\relax
\fi
- \else
- \ifnum\m_level=\plusone
- \ifzeropt\scratchdimen
- \advance\d_anch_sidebars_distance\scratchdistance\relax
- \else
- \d_anch_sidebars_distance\scratchdimen
- \fi
+ \orelse\ifnum\m_level=\plusone
+ \ifzeropt\scratchdimen
+ \advance\d_anch_sidebars_distance\scratchdistance\relax
\else
- \d_anch_sidebars_distance\dimexpr\scratchdimen+\numexpr\m_level-\plusone\relax\dimexpr\scratchdistance\relax\relax
+ \d_anch_sidebars_distance\scratchdimen
\fi
+ \else
+ \d_anch_sidebars_distance\dimexpr\scratchdimen+\numexpr\m_level-\plusone\relax\dimexpr\scratchdistance\relax\relax
\fi
\startpositionoverlay{\v!text-1}%
\normalexpanded{\setMPpositiongraphicrange % maybe expand in definition
@@ -146,13 +144,8 @@
%D one lua call).
\startMPpositionmethod{mpos:sidebar}
- \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance,alternative}%
- anch_sidebars_draw (
- \MPp\MPbself,\MPp\MPeself,\MPy\MPbself,\MPy\MPeself,\MPh\MPbself,\MPd\MPeself,
- \MPx{\textanchor},\MPy{\textanchor},\MPw{\textanchor},\MPh{\textanchor},
- \MPvar{alternative},\MPvar{distance},\MPvar{linewidth},\MPvar{linecolor},
- \MPvar{topoffset}, \MPvar{bottomoffset}
- ) ;
+ \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance,alternative}
+ anch_sidebars_draw("\MPbself", "\MPeself", "\textanchor") ;
\stopMPpositiongraphic
\MPpositiongraphic{mpos:sidebar}{}%
\stopMPpositionmethod
diff --git a/tex/context/base/mkxl/anch-bck.mklx b/tex/context/base/mkxl/anch-bck.mklx
index 36416c93d..bf3885539 100644
--- a/tex/context/base/mkxl/anch-bck.mklx
+++ b/tex/context/base/mkxl/anch-bck.mklx
@@ -119,19 +119,6 @@
\eposkind\v_anch_backgrounds_text_current\c_anch_backgrounds_pos_state
\fi}
-% \permanent\tolerant\protected\def\starttextbackground[#tag]#spacer[#settings]%
-% {\begingroup
-% \advance\c_anch_backgrounds_text_level\plusone
-% \def\currenttextbackground{#tag}%
-% \anch_backgrounds_text_initialize_next
-% \ifparameter#settings\or
-% \setupcurrenttextbackground[#settings]%
-% \fi
-% \doifelse{\textbackgroundparameter\c!state}\v!start
-% \anch_backgrounds_text_preset_yes
-% \anch_backgrounds_text_preset_nop
-% \anch_backgrounds_text_start_indeed}
-
% ugly hack to register usage
\newcount \c_anch_backgrounds_text_count
@@ -558,35 +545,14 @@
gridcolor=red,
linecolor=blue,
fillcolor=lightgray,
- filloffset=\!!zeropoint,
+ filloffset=\zeropoint,
linewidth=\linewidth,
gridwidth=\linewidth,
- gridshift=\!!zeropoint,
+ gridshift=\zeropoint,
lineradius=.5\bodyfontsize,
- lineoffset=\!!zeropoint,
+ lineoffset=\zeropoint,
dashtype=1]
-\startuseMPgraphic{mpos:region:setup}
- boxgridtype := \MPvar{gridtype} ;
- boxlinetype := \MPvar{linetype} ;
- boxfilltype := \MPvar{filltype} ;
- boxdashtype := \MPvar{dashtype} ;
- boxfilloffset := \MPvar{filloffset} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxgridwidth := \MPvar{gridwidth} ;
- boxgridshift := \MPvar{gridshift} ;
- boxlineradius := \MPvar{lineradius} ;
- boxlineoffset := \MPvar{lineoffset} ;
- %
- def boxgridcolor = \MPvar{gridcolor} enddef ;
- def boxlinecolor = \MPvar{linecolor} enddef ;
- def boxfillcolor = \MPvar{fillcolor} enddef ;
- %
- def boxgridoptions = withcolor boxgridcolor enddef ;
- def boxlineoptions = withcolor boxlinecolor enddef ;
- def boxfilloptions = withcolor boxfillcolor enddef ;
-\stopuseMPgraphic
-
\startuseMPgraphic{mpos:region:extra}
% user stuff
\stopuseMPgraphic
@@ -598,8 +564,7 @@
\startMPpositiongraphic{mpos:region}{fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius,lineoffset}
\includeMPgraphic{mpos:region:setup} ;
\includeMPgraphic{mpos:region:extra} ;
- % \getmultipars("self","anchor") ;
- \MPgetmultipars{\MPvar{self}}{\MPanchorid} ;
+ getmultipars("self", "anchor") ;
\includeMPgraphic{\MPvar{mp}} ;
\includeMPgraphic{mpos:region:anchor} ;
\stopMPpositiongraphic
@@ -670,15 +635,6 @@
lineoffset=5pt,
linewidth=1pt]
-% \startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset}
-% getposboxes("self","anchor") ;
-% if nofposboxes = 1 :
-% posboxes[1] := posboxes[1] enlarged \MPvar{lineoffset} cornered \MPvar{lineoffset} ;
-% fill posboxes[1] withcolor \MPvar{fillcolor} ;
-% draw posboxes[1] withpen pencircle scaled \MPvar{linewidth} withcolor \MPvar{linecolor} ;
-% fi ;
-% \stopMPpositiongraphic
-
\startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset}
getposboxes("self","anchor") ;
if nofposboxes = 1 :
@@ -694,14 +650,6 @@
lineoffset=.25ex,
linewidth=1pt]
-% \startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth}
-% boxlinewidth := \MPvar{linewidth} ;
-% boxlineoffset := \MPvar{lineoffset} ;
-% def boxlineoptions = withcolor \MPvar{linecolor} enddef ;
-% getposboxes("from,to","anchor") ;
-% connect_positions ;
-% \stopMPpositiongraphic
-
\startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth}
boxlinewidth := mpvar "linewidth" ;
boxlineoffset := mpvar "lineoffset" ;
diff --git a/tex/context/base/mkxl/anch-pgr.lmt b/tex/context/base/mkxl/anch-pgr.lmt
index 5b750d80e..c30c456d5 100644
--- a/tex/context/base/mkxl/anch-pgr.lmt
+++ b/tex/context/base/mkxl/anch-pgr.lmt
@@ -33,9 +33,14 @@ local context = context
local implement = interfaces.implement
+local texgetcount = tex.getcount
+
local getmacro = tokens.getters.macro
+local expandasvalue = tex.expandasvalue
local scanmpstring = mp.scan.string
-local mpgnamespace = getmacro("??graphicvariable")
+----- mpgnamespace = getmacro("??graphicvariable")
+
+local string_value = tokens.values.string
local report_graphics = logs.reporter("backgrounds")
local report_shapes = logs.reporter("backgrounds","shapes")
@@ -1195,13 +1200,13 @@ backgrounds.fetchmultipar = fetchmultipar
local function getwhatever(action)
local tags = scanmpstring()
local anchor = scanmpstring()
- local page = nil
+ local page = texgetcount("realpageno")
if tags == "self" then
- tags = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":self",true) -- Isn't it already edef'd?
+ tags = expandasvalue(string_value,"mpcategoryparameter",true,"self")
elseif type(tags) == "string" then
tags = settings_to_array(tags)
for i=1,#tags do
- tags[i] = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. tags[i],true) -- Isn't it already edef'd?
+ tags[i] = expandasvalue(string_value,"mpcategoryparameter",true,tags[i])
end
end
if anchor == "anchor" then
@@ -1212,6 +1217,8 @@ local function getwhatever(action)
end
end
+-- backgrounds.getwhatever = getwhatever -- public for tracing
+
metapost.registerscript("getmultipars", function()
return getwhatever(fetchmultipar)
end)
diff --git a/tex/context/base/mkxl/anch-pgr.mkxl b/tex/context/base/mkxl/anch-pgr.mkxl
index ec8f0e549..af84c6ce9 100644
--- a/tex/context/base/mkxl/anch-pgr.mkxl
+++ b/tex/context/base/mkxl/anch-pgr.mkxl
@@ -318,16 +318,15 @@
\aliased\let\stopMPpositiongraphic\relax
\def\anch_positions_meta_graphic_prepare
- {\ifcsname\??graphicvariable\currentmpvariableclass:self\endcsname \else
- \letcsname\??graphicvariable\currentmpvariableclass:self\endcsname\currentposition
+ {\iftok{\mpcategoryparameter{self}}\emptytoks
+ \letmpcategoryparameter{self}\currentposition
\fi
- \ifcsname\??graphicvariable\currentmpvariableclass:from\endcsname \else
- \letcsname\??graphicvariable\currentmpvariableclass:from\endcsname\currentposition
+ \iftok{\mpcategoryparameter{from}}\emptytoks
+ \letmpcategoryparameter{from}\currentposition
\fi}
\def\anch_positions_meta_graphic_use#1#2#3%
{\begingroup
- \meta_prepare_variables{#2}%
\anch_positions_meta_graphic_prepare
\startMPcode#3\stopMPcode
\endgroup}
@@ -346,8 +345,8 @@
\def\anch_positions_meta_graphic_direct#1#2#3% what tag setups
{\begingroup
- \setupMPvariables[#2][#3]%
- \edef\currentmpvariableclass{#2}%
+ \edef\currentmpcategory{#2}%
+ \setupcurrentmpcategory[#3]%
\anch_positions_meta_graphic_prepare
\obeyMPboxorigin % do we also set the size ? when needed this must be done in mp ... might change
\enforced\tolerant\protected\def\MPpositiongraphic##=##*##={\anch_positions_meta_graphic_nested{#3}{##1}{##2}}% takes two extra arguments
@@ -360,8 +359,8 @@
\def\anch_positions_meta_graphic_nested#1#2#3% nesting used in prikkels / pascal (might go away)
{\begingroup
- \setupMPvariables[#2][#1,#3]%
- \edef\currentmpvariableclass{#2}%
+ \edef\currentmpcategory{#2}%
+ \setupcurrentmpcategory[#1,#3]%
\anch_positions_meta_graphic_prepare
\begincsname\??positiongraphic#2\endcsname
\endgroup}%
diff --git a/tex/context/base/mkxl/colo-ini.mkxl b/tex/context/base/mkxl/colo-ini.mkxl
index 97ad183e5..80835920f 100644
--- a/tex/context/base/mkxl/colo-ini.mkxl
+++ b/tex/context/base/mkxl/colo-ini.mkxl
@@ -1314,6 +1314,13 @@
\permanent\protected\def\forcecolorhack{\leaders\hrule\s!height\zeropoint\s!depth\zeropoint\hskip\zeropoint\relax} % relax is needed !
+\aliased\let\normalforcecolorhack\forcecolorhack
+
+\installtexexperiment
+ {disablecolorhack}
+ {\pushoverloadmode\enforced\let\forcecolorhack\relax\popoverloadmode}
+ {\pushoverloadmode\enforced\let\forcecolorhack\normalforcecolorhack\popoverloadmode}
+
%D We default to the colors defined in \type {colo-imp-rgb} and support both \RGB\
%D and \CMYK\ output. Transparencies are defined here:
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 3b39145bf..5be5fa23f 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.04.29 23:04}
+\newcontextversion{2021.05.05 19:22}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/cont-run.lmt b/tex/context/base/mkxl/cont-run.lmt
index 4fbf25ebc..5c9ed4003 100644
--- a/tex/context/base/mkxl/cont-run.lmt
+++ b/tex/context/base/mkxl/cont-run.lmt
@@ -21,6 +21,8 @@ local possiblepath = sandbox.possiblepath
local context = context
local implement = interfaces.implement
+local texset = tex.set
+
local qualified = { }
local writeable = { }
local readable = { }
@@ -190,6 +192,21 @@ else
end
+local function setoverloadmode(overloadmode)
+ if overloadmode == "warning" then
+ overloadmode = 3 -- 5
+ elseif overloadmode == "error" then
+ overloadmode = 4 -- 6
+ else
+ overloadmode = tonumber(overloadmode)
+ end
+ if overloadmode then
+ texset("overloadmode",overloadmode)
+ end
+end
+
+directives.register("overloadmode", setoverloadmode)
+
local function processjob()
tokens.setters.macro("processjob","","permanent")
@@ -213,19 +230,7 @@ local function processjob()
}
end
- local overloadmode = arguments.overloadmode
-
- if overloadmode == "warning" then
- overloadmode = 3 -- 5
- elseif overloadmode == "error" then
- overloadmode = 4 -- 6
- else
- overloadmode = tonumber(overloadmode)
- end
-
- if overloadmode then
- tex.set("overloadmode",overloadmode)
- end
+ setoverloadmode(arguments.overloadmode)
if not filename or filename == "" then
-- skip
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index 9de5a2c11..5b5bdb60a 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2021.04.29 23:04}
+\immutable\edef\contextversion{2021.05.05 19:22}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/font-mpf.lmt b/tex/context/base/mkxl/font-mpf.lmt
index b1e6a00dd..18f3365db 100644
--- a/tex/context/base/mkxl/font-mpf.lmt
+++ b/tex/context/base/mkxl/font-mpf.lmt
@@ -56,31 +56,35 @@ local function setmetaglyphs(category,fontid,unicode,specification)
local units = shapes.parameters.units
local scale = tfmdata.parameters.size / units
local shape = shapes.glyphs[unicode]
- --
- local llx, lly, urx, ury = unpack(shape.boundingbox)
- llx = llx * scale
- urx = urx * scale
- lly = lly * scale
- ury = ury * scale
- --
- local newdata = { }
- characters[unicode] = newdata -- so that we can register commands
- fonts.dropins.swapone("mps",tfmdata,shape,unicode)
- --
- local olddata = characters[unicode]
- newdata.width = urx - llx
- newdata.height = ury
- newdata.depth = -lly
- newdata.unicode = unicode
- -- commands = { { "offset", -llx, 0, newdata.commands[1][1], newdata.commands[1][2] } }
- if llx ~= 0 then
- newdata.commands = { { "offset", -llx, 0 }, newdata.commands[1] }
+ if shape then
+ --
+ local llx, lly, urx, ury = unpack(shape.boundingbox)
+ llx = llx * scale
+ urx = urx * scale
+ lly = lly * scale
+ ury = ury * scale
+ --
+ local newdata = { }
+ characters[unicode] = newdata -- so that we can register commands
+ fonts.dropins.swapone("mps",tfmdata,shape,unicode)
+ --
+ local olddata = characters[unicode]
+ newdata.width = urx - llx
+ newdata.height = ury
+ newdata.depth = -lly
+ newdata.unicode = unicode
+ -- commands = { { "offset", -llx, 0, newdata.commands[1][1], newdata.commands[1][2] } }
+ if llx ~= 0 then
+ newdata.commands = { { "offset", -llx, 0 }, newdata.commands[1] }
+ end
+ -- pass dimensions to lua
+ characters[unicode] = newdata
+ -- pass dimensions to tex
+ addcharacters(fontid, { characters = { [unicode] = newdata } })
+ return fontid, unicode
+ else
+ logs.report("metaglyph", "bad shape %U in font %i", unicode, fontid)
end
- -- pass dimensions to lua
- characters[unicode] = newdata
- -- pass dimensions to tex
- addcharacters(fontid, { characters = { [unicode] = newdata } })
- return fontid, unicode
end
end
diff --git a/tex/context/base/mkxl/font-pre.mkxl b/tex/context/base/mkxl/font-pre.mkxl
index 0840d3255..41c961f61 100644
--- a/tex/context/base/mkxl/font-pre.mkxl
+++ b/tex/context/base/mkxl/font-pre.mkxl
@@ -180,7 +180,7 @@
\definefontfeature
[syriac]
[arabic]
- [fin2=yes,fin3=yes,med2=yes]
+ [fin2=yes,fin3=yes,med2=yes] % script=syrc
\definefontfeature
[reordercombining]
diff --git a/tex/context/base/mkxl/libs-imp-zstd.lmt b/tex/context/base/mkxl/libs-imp-zstd.lmt
new file mode 100644
index 000000000..a240c1ec7
--- /dev/null
+++ b/tex/context/base/mkxl/libs-imp-zstd.lmt
@@ -0,0 +1,48 @@
+if not modules then modules = { } end modules ['libs-imp-zstd'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/curl/libzstd.dll
+
+-- require("libs-imp-zstd.lmt") -- only loads
+--
+-- local zstd = require("zstd") -- activates
+--
+-- local data = io.loaddata("t:/sources/char-def.lua")
+-- local comp = zstd.compress (data)
+-- local back = zstd.decompress(comp)
+--
+-- print(#data,#comp,#back,#back==#data)
+
+local libname = "zstd"
+local libfile = "libzstd"
+
+local zstdlib = resolvers.libraries.validoptional(libname)
+
+if not zstdlib then return end
+
+local zstd_compress = zstdlib.compress
+local zstd_decompress = zstdlib.decompress
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local zstd = {
+ compress = function (s) return okay() and zstd_compress (s) end,
+ decompress = function (s) return okay() and zstd_decompress(s) end,
+}
+
+package.loaded[libname] = zstd
+
+return zstd
+
diff --git a/tex/context/base/mkxl/lpdf-emb.lmt b/tex/context/base/mkxl/lpdf-emb.lmt
index 4337e5931..3a2b2a0aa 100644
--- a/tex/context/base/mkxl/lpdf-emb.lmt
+++ b/tex/context/base/mkxl/lpdf-emb.lmt
@@ -189,10 +189,10 @@ end
return blob
end
- widtharray = function(details,indices,maxindex,units)
+ widtharray = function(details,indices,maxindex,units,correction)
local widths = pdfarray()
local length = 0
- local factor = 10000 / units
+ local factor = 10000 / (units * correction)
if maxindex > 0 then
local lastindex = -1
local sublist = nil
@@ -799,7 +799,7 @@ do
--
local units = metadata.units
local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units)
+ local widths = widtharray(details,indices,maxindex,units,1)
local object = details.objectnumber
local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
local tocidset = tocidsetdictionary(indices,minindex,maxindex)
@@ -1379,10 +1379,16 @@ do
--
fontfile = closefontfile(fontfile)
--
- local units = fontheader.units or metadata.units
-
+ local units = fontheader.units or metadata.units
+ if units ~= 1000 then
+ -- maybe only otf
+ -- public sans has 2000 so we need to mess different from e.g. ttf
+ report_fonts("width units in %a are %i, forcing 1000 instead",basefontname,units)
+ units = 1000
+ end
+ --
local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units * correction)
+ local widths = widtharray(details,indices,maxindex,units,correction)
local object = details.objectnumber
local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
local tocidset = tocidsetdictionary(indices,minindex,maxindex)
diff --git a/tex/context/base/mkxl/meta-grd.mkxl b/tex/context/base/mkxl/meta-grd.mkxl
index 009149e46..99db410c6 100644
--- a/tex/context/base/mkxl/meta-grd.mkxl
+++ b/tex/context/base/mkxl/meta-grd.mkxl
@@ -36,39 +36,39 @@
\startuseMPgraphic{meta:grd:basegrid}
begingroup ;
- save sc, dx, dy, wd, ht, ox, oy, ax, ay ;
+ save nx, ny, dx, dy, ox, oy, sx, sy ;
- sc = \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
- dx = \MPdpar\directdummyparameter\c!dx*sc ;
- dy = \MPdpar\directdummyparameter\c!dy*sc ;
- wd = \directdummyparameter\c!nx*dx ;
- ht = \directdummyparameter\c!ny*dy ;
- ox = \MPdpar\directdummyparameter\c!xoffset\relax ;
- oy = \MPdpar\directdummyparameter\c!yoffset\relax ;
+ sc := \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
+ nx := \directdummyparameter\c!nx ;
+ ny := \directdummyparameter\c!ny ;
+ dx := \MPdpar\directdummyparameter\c!dx * sc ;
+ dy := \MPdpar\directdummyparameter\c!dy * sc ;
+ ox := \MPdpar\directdummyparameter\c!xoffset ;
+ oy := \MPdpar\directdummyparameter\c!yoffset ;
+ sx := \directdummyparameter\c!xstep ;
+ sy := \directdummyparameter\c!ystep ;
if "\directdummyparameter\c!align" = "\v!middle" :
- ax = \MPdpar\directdummyparameter\c!dx/2
- ay = \MPdpar\directdummyparameter\c!dy/2
+ ax := dx / 2 ;
+ ay := dy / 2 ;
else :
- ax = 0 ;
- ay = 0 ;
+ ax := 0 ;
+ ay := 0 ;
fi ;
- draw image (
- for i=0 step dx until wd : draw (i,0) -- (i,ht) ; endfor ;
- for i=0 step dy until ht : draw (0,i) -- (wd,i) ; endfor ;
- )
+ draw lmt_grid [ nx = nx, ny = ny, dx = 1, dy = 1 ]
+ xyscaled (dx,dy) shifted (ax, ay)
withpen pencircle scaled \MPdpar\directdummyparameter\c!rulethickness\space
withcolor "\directdummyparameter\c!rulecolor" ;
draw image (
- if \directdummyparameter\c!xstep > 0 :
- for i=1 step \directdummyparameter\c!xstep until \directdummyparameter\c!nx :
+ if sx > 0 :
+ for i=1 step sx until nx :
draw thetextext.bot(decimal i,(i*dx-ax,oy));
endfor ;
fi ;
- if \directdummyparameter\c!ystep > 0 :
- for i=1 step \directdummyparameter\c!ystep until \directdummyparameter\c!ny :
+ if sy > 0 :
+ for i=1 step sy until ny :
draw thetextext.lft(decimal i,(ox,i*dy-ay)) ;
endfor ;
fi ;
diff --git a/tex/context/base/mkxl/meta-ini.lmt b/tex/context/base/mkxl/meta-ini.lmt
index ed7b2264f..be5a4f947 100644
--- a/tex/context/base/mkxl/meta-ini.lmt
+++ b/tex/context/base/mkxl/meta-ini.lmt
@@ -8,7 +8,6 @@ if not modules then modules = { } end modules ['meta-ini'] = {
local tonumber = tonumber
local format = string.format
-local concat = table.concat
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local P, Cs, R, S, C, Cc = lpeg.P, lpeg.Cs, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc
@@ -16,68 +15,68 @@ metapost = metapost or { }
local metapost = metapost
local context = context
-local colorhash = attributes.list[attributes.private('color')]
-local textype = tex.type
-local MPcolor = context.MPcolor
-
-do
-
- local dimenorname =
- lpegpatterns.validdimen / function(s)
- context("\\the\\dimexpr %s",s)
- end
- + (C(lpegpatterns.float) + Cc(1)) * lpegpatterns.space^0 * P("\\") * C(lpegpatterns.letter^1) / function(f,s)
- local t = textype(s)
- if t == "dimen" then
- context("\\the\\dimexpr %s\\%s\\relax",f,s)
- elseif t == "count" then
- context("\\the\\numexpr \\%s * %s\\relax",s,f) -- <n>\scratchcounter is not permitted
- end
- end
-
- local splitter = lpeg.splitat("::",true)
-
- interfaces.implement {
- name = "prepareMPvariable",
- arguments = "string",
- actions = function(v)
- if v == "" then
- -- MPcolor("black")
- context("black")
- else
- local typ, var = lpegmatch(splitter,v)
- if not var then
- -- parse
- if colorhash[v] then
- -- MPcolor(v)
- context("%q",var)
- elseif tonumber(v) then
- context(v)
- elseif not lpegmatch(dimenorname,v) then
- context("\\number %s",v) -- 0.4 ...
- end
- elseif typ == "d" then -- to be documented
- -- dimension
- context("\\the\\dimexpr %s\\relax",var)
- elseif typ == "n" then -- to be documented
- -- number
- context("\\the\\numexpr %s\\relax",var)
- elseif typ == "s" then -- to be documented
- -- string
- -- context(var)
- context("%q",var)
- elseif typ == "c" then -- to be documented
- -- color
- -- MPcolor(var)
- context("%q",var)
- else
- context(var)
- end
- end
- end
- }
-
-end
+-- local colorhash = attributes.list[attributes.private('color')]
+-- local textype = tex.type
+-- local MPcolor = context.MPcolor
+--
+-- do
+--
+-- local dimenorname =
+-- lpegpatterns.validdimen / function(s)
+-- context("\\the\\dimexpr %s",s)
+-- end
+-- + (C(lpegpatterns.float) + Cc(1)) * lpegpatterns.space^0 * P("\\") * C(lpegpatterns.letter^1) / function(f,s)
+-- local t = textype(s)
+-- if t == "dimen" then
+-- context("\\the\\dimexpr %s\\%s\\relax",f,s)
+-- elseif t == "count" then
+-- context("\\the\\numexpr \\%s * %s\\relax",s,f) -- <n>\scratchcounter is not permitted
+-- end
+-- end
+--
+-- local splitter = lpeg.splitat("::",true)
+--
+-- interfaces.implement {
+-- name = "prepareMPvariable",
+-- arguments = "string",
+-- actions = function(v)
+-- if v == "" then
+-- -- MPcolor("black")
+-- context("black")
+-- else
+-- local typ, var = lpegmatch(splitter,v)
+-- if not var then
+-- -- parse
+-- if colorhash[v] then
+-- -- MPcolor(v)
+-- context("%q",var)
+-- elseif tonumber(v) then
+-- context(v)
+-- elseif not lpegmatch(dimenorname,v) then
+-- context("\\number %s",v) -- 0.4 ...
+-- end
+-- elseif typ == "d" then -- to be documented
+-- -- dimension
+-- context("\\the\\dimexpr %s\\relax",var)
+-- elseif typ == "n" then -- to be documented
+-- -- number
+-- context("\\the\\numexpr %s\\relax",var)
+-- elseif typ == "s" then -- to be documented
+-- -- string
+-- -- context(var)
+-- context("%q",var)
+-- elseif typ == "c" then -- to be documented
+-- -- color
+-- -- MPcolor(var)
+-- context("%q",var)
+-- else
+-- context(var)
+-- end
+-- end
+-- end
+-- }
+--
+-- end
do
diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl
index 823d369f0..faf0d3c69 100644
--- a/tex/context/base/mkxl/meta-ini.mkxl
+++ b/tex/context/base/mkxl/meta-ini.mkxl
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Some lmtx upgrading work needs to be done here.
-%D
%D For real \METAFUN\ magic see \type {https://art-aleatoire.com/}.
% initializations:
@@ -82,6 +80,7 @@
\installcorenamespace{mpgraphic}
\installcorenamespace{mpstaticgraphic}
\installcorenamespace{mpclip}
+\installcorenamespace{mpcategory}
\newtoks \t_meta_initializations % tex, each
@@ -173,8 +172,7 @@
{\writestatus\m!metapost{reset will be implemented when needed}}
\def\meta_analyze_graphicname[#1]%
- %{\normalexpanded{\meta_analyze_graphicname_indeed[#1::::]}}
- {\normalexpanded{\meta_analyze_graphicname_indeed[#1}::::]}
+ {\normalexpanded{\meta_analyze_graphicname_indeed[#1::::]}}
\def\meta_show_properties_indeed
{\writestatus{metapost}{name: \currentMPgraphicname, instance: \currentMPinstance, format: \currentMPformat}}
@@ -292,21 +290,20 @@
\protected\def\meta_process_graphic#1% todo: extensions and inclusions outside beginfig
{\meta_start_current_graphic
\forgetall
- \edef\p_extensions{\MPinstanceparameter\s!extensions}%
\meta_process_graphic_start
\normalexpanded{\noexpand\clf_mpgraphic
instance {\currentMPinstance}%
format {\currentMPformat}%
data {#1;}%
initializations {\meta_flush_current_initializations}%
- \ifx\p_extensions\v!yes
- extensions {\clf_getmpextensions{\currentMPinstance}}% goes through tex again
+ \ifcstok{\MPinstanceparameter\s!extensions}\v!yes
+ extensions {\clf_getmpextensions{\currentMPinstance}}% goes through tex again, can be done better now
\fi
inclusions {\meta_flush_current_inclusions}%
definitions {\meta_flush_current_definitions}%
figure {\MPaskedfigure}%
method {\MPinstanceparameter\c!method}%
- namespace {\??graphicvariable\currentmpvariableclass:}%
+ namespace {\??graphicvariable\currentmpcategory:}%
\relax}%
\meta_process_graphic_stop
\meta_stop_current_graphic}
@@ -409,8 +406,8 @@
\aliased\let\stopMPclip\relax
-\mutable\def\width {0 } % left-over
-\mutable\def\height{0 } % left-over
+\mutable\def\width {0 } % left-over, obsolete
+\mutable\def\height{0 } % left-over, obsolete
\mutable\let\currentMPclip\empty
@@ -418,8 +415,8 @@
{\begingroup
\d_overlay_width #2\relax
\d_overlay_height#3\relax
- \edef\width {\the\d_overlay_width \space}% hm
- \edef\height{\the\d_overlay_height\space}% hm
+ \edef\width {\the\d_overlay_width \space}% obsolete
+ \edef\height{\the\d_overlay_height\space}% obsolete
\edef\currentMPclip{#1}%
\ifcsname\??mpclip\currentMPclip\endcsname
\meta_grab_clip_path_yes
@@ -433,7 +430,7 @@
\normalexpanded{\noexpand\clf_mpsetclippath
instance {\currentMPinstance}%
format {\currentMPformat}%
- data {\csname\??mpclip\currentMPclip\endcsname}%
+ data {\begincsname\??mpclip\currentMPclip\endcsname}%
initializations {\meta_flush_current_initializations}%
useextensions {\MPinstanceparameter\s!extensions}%
inclusions {\meta_flush_current_inclusions}%
@@ -493,97 +490,57 @@
%D Currently the inheritance of backgrounds does not work and we might drop it
%D anyway (too messy)
-\newbox\b_meta_variable_box
-
-\mutable\let \currentmpvariableclass \empty % public
-
-\let \m_meta_current_variable \empty
-\let \m_meta_current_variable_template\empty
-
-% \installcorenamespace{graphicvariable} % already set
-
-\def\meta_prepare_variable_default{\MPcolor{black}} % just to be sure we use a color but ...
+\let\m_meta_current_variable\empty
-\permanent\tolerant\protected\def\setupMPvariables[#1]#*[#2]%
- {\ifarguments
- \or
- \getrawparameters[\??graphicvariable:][#1]%
- \else
- \getrawparameters[\??graphicvariable#1:][#2]%
- \fi}
+\installbasicnativeautosetuphandler \??mpcategory {mpcategory}
-\permanent\tolerant\protected\def\presetMPvariable[#1]#*[#2=#3]%
- {\ifcsname\??graphicvariable#1:#2\endcsname \else
- \defcsname\??graphicvariable#1:#2\endcsname{#3}%
- \fi}
+\permanent\tolerant\protected\def\useMPvariables[#1]#*[#2]{} % no longer needed
-\permanent\def\MPrawvar#1#2% no checking
- {\begincsname\??graphicvariable#1:#2\endcsname}
+%D The uppercase ones are the official ones:
-\permanent\def\MPvariable#1% todo: could be a framed chain
- {\begincsname\??graphicvariable\currentmpvariableclass:#1\endcsname}
+\aliased\let\setupMPvariables\setupmpcategory
+\aliased\let\setMPvariables \setupmpcategory
-\permanent\tolerant\protected\def\useMPvariables[#1]#*[#2]%
- {\edef\currentmpvariableclass{#1}%
- \meta_prepare_variables{#2}}
+\def\meta_mpvar_default{\MPcolor{black}\space}
+%def\meta_mpvar_default{0 }
-\protected\def\meta_prepare_variables#1%
- {\processcommalist[#1]\meta_prepare_variable}
-
-\protected\def\meta_prepare_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\begincsname\m_meta_current_variable_template\endcsname}%
+\permanent\def\MPvar#1% todo: could be a framed chain
+ {\beginlocalcontrol
+ \edef\m_meta_current_variable{\mpcategoryparameter{#1}}%
+ \endlocalcontrol
\ifempty\m_meta_current_variable
- \expandafter\meta_prepare_variable_nop
+ \meta_mpvar_default
+ \orelse\ifchkdim\m_meta_current_variable\or
+ \todimension\m_meta_current_variable\space\space
+ \orelse\ifchknum\m_meta_current_variable\or
+ \tointeger\m_meta_current_variable\space\space
+ \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
+ \orelse\ifcsname\??colorattribute\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
\else
- \expandafter\meta_prepare_variable_yes
+ \m_meta_current_variable
\fi}
-\protected\def\meta_prepare_instance_variables
- {\expandafter\processcommalist\expandafter[\m_meta_instance_variables]\meta_prepare_instance_variable}
-
-\protected\def\meta_prepare_instance_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\ifcsname\m_meta_current_variable_template\endcsname
- \lastnamedcs
- \else
- \begincsname\??graphicvariable\currentMPgraphicname:#1\endcsname
- \fi}%
+\permanent\def\MPrawvar#1#2% todo: could be a framed chain
+ {\beginlocalcontrol
+ \edef\m_meta_current_variable{\namedmpcategoryparameter{#1}{#2}}%
+ \endlocalcontrol
\ifempty\m_meta_current_variable
- \expandafter\meta_prepare_variable_nop
- \else
- \expandafter\meta_prepare_variable_yes
- \fi}
-
-\def\meta_prepare_variable_nop
- {\expandafter\letcsname\m_meta_current_variable_template\endcsname\meta_prepare_variable_default}
-
-\def\meta_prepare_variable_color % we use the attribute so we dont' go through namedcolor (why not)
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\MPcolor\m_meta_current_variable}}
-
-\def\meta_prepare_variable_number
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\number\m_meta_current_variable}}% also accepts 0.number
-
-\def\meta_prepare_variable_dimension
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\the\dimexpr\m_meta_current_variable}}
-
-\def\meta_prepare_variable_yes
- {\ifchkdim\m_meta_current_variable\or
- \meta_prepare_variable_dimension
+ \meta_mpvar_default
+ \orelse\ifchkdim\m_meta_current_variable\or
+ \todimension\m_meta_current_variable\space\space
\orelse\ifchknum\m_meta_current_variable\or
- \meta_prepare_variable_number
+ \tointeger\m_meta_current_variable\space\space
+ \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
+ \orelse\ifcsname\??colorattribute\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
\else
- \doifelsecolor\m_meta_current_variable
- \meta_prepare_variable_color
- \meta_prepare_variable_dimension
+ \m_meta_current_variable
\fi}
-\aliased\let\MPvar \MPvariable
-\aliased\let\setMPvariables\setupMPvariables
+\aliased\let\MPvariable\MPvar
%D \macros
%D {startuniqueMPgraphic, uniqueMPgraphic}
@@ -673,7 +630,7 @@
\def\meta_handle_unique_graphic#1#2#3% when there are too many, we can store data at the lua end, although,
{\begingroup % when there are that many they're probably not that unique anyway
- \edef\currentmpvariableclass{#1}%
+ \edef\currentmpcategory{#1}%
\extendMPoverlaystamp{#2}% incl prepare
\ifcsname\??mpgraphic\overlaystamp:#1\endcsname
\lastnamedcs
@@ -701,22 +658,20 @@
\permanent\tolerant\protected\def\uniqueMPgraphic#=#*#=%
{\meta_begin_graphic_group{#1}%
- \setupMPvariables[#1][#2]%
+ \checkmpcategoryparent
+ \let\currentmpcategory\currentMPgraphicname
+ \setupcurrentmpcategory[#2]%
\begincsname\??mpgraphic#1\endcsname\empty
\meta_end_graphic_group}
\def\meta_handle_use_graphic#1#2#3%
{\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifempty\m_meta_instance_variables \else
- \meta_prepare_instance_variables
- \fi
+ \edef\currentmpcategory{#1}%
\meta_enable_include % redundant
\meta_process_graphic{#3}%
\endgroup}
-\permanent\protected\def\startuseMPgraphic % todo, modernize
+\permanent\protected\def\startuseMPgraphic
{\dodoublegroupempty\meta_start_use_graphic}
\aliased\let\stopuseMPgraphic\relax
@@ -727,7 +682,7 @@
\protected\def\meta_start_use_graphic_indeed#1#2#3\stopuseMPgraphic
{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_use_graphic{#1}{#2}{#3}}}
-\permanent\protected\def\startusableMPgraphic % redundant but handy % todo, modernize
+\permanent\protected\def\startusableMPgraphic
{\dodoublegroupempty\meta_start_usable_graphic}
\aliased\let\stopusableMPgraphic\relax
@@ -740,11 +695,7 @@
\def\meta_handle_reusable_graphic#1#2#3%
{\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifempty\m_meta_instance_variables \else
- \meta_prepare_instance_variables
- \fi
+ \edef\currentmpcategory{#1}%
\meta_enable_include % redundant
\global\advance\c_meta_object_counter\plusone
\meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox
@@ -752,7 +703,7 @@
\csname\??mpgraphic#1\endcsname\empty
\endgroup}
-\permanent\protected\def\startreusableMPgraphic % todo, modernize
+\permanent\protected\def\startreusableMPgraphic
{\dodoublegroupempty\meta_start_reusable_graphic}
\aliased\let\stopreusableMPgraphic\relax
@@ -763,22 +714,21 @@
\protected\def\meta_start_reusable_graphic_indeed#1#2#3\stopreusableMPgraphic
{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_reusable_graphic{#1}{#2}{#3}}}
-\mutable\let\usedMPgraphicname\empty
-
\permanent\tolerant\protected\def\useMPgraphic#=#*#=%
{\meta_begin_graphic_group{#1}%
\ifcsname\??mpgraphic#1\endcsname
- \edef\usedMPgraphicname{#1}%
+ \edef\currentmpcategory{#1}%
\orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname
- \let\usedMPgraphicname\currentMPgraphicname
+ \let\currentmpcategory\currentMPgraphicname
\else
- \let\usedMPgraphicname\empty
+ \let\currentmpcategory\empty
\fi
- \ifempty\usedMPgraphicname
+ \ifempty\currentmpcategory
% message
\else
- \doifsomething{#2}{\setupMPvariables[\usedMPgraphicname][#2]}%
- \csname\??mpgraphic\usedMPgraphicname\endcsname
+ \checkmpcategoryparent
+ \doifsomething{#2}{\setupcurrentmpcategory[#2]}%
+ \csname\??mpgraphic\currentmpcategory\endcsname
\fi
\meta_end_graphic_group}
@@ -810,35 +760,22 @@
\def\meta_start_unique_page_graphic#1%
{\normalexpanded{\meta_start_unique_page_graphic_indeed{#1}}}
-\protected\def\meta_start_unique_page_graphic_indeed#1#2#3\stopuniqueMPpagegraphic % inefficient, double storage
- {\gdefcsname\??mpgraphic o:#1\endcsname{\meta_handle_unique_graphic{o:#1}{#2}{#3}}% % but these also keep the state
- \gdefcsname\??mpgraphic e:#1\endcsname{\meta_handle_unique_graphic{e:#1}{#2}{#3}}} % and meaning will be redefined
+\protected\def\meta_start_unique_page_graphic_indeed#1#2#3\stopuniqueMPpagegraphic % inefficient, double storage
+ {\gdefcsname\??mpgraphic o:#1\endcsname{\meta_handle_unique_graphic{o:#1}{#2}{#3}}% % but these also keep the state
+ \gdefcsname\??mpgraphic e:#1\endcsname{\meta_handle_unique_graphic{e:#1}{#2}{#3}}} % and meaning will be redefined
\permanent\tolerant\protected\def\uniqueMPpagegraphic#=#=%
{\meta_begin_graphic_group{#1}%
\enforced\let\overlaystamp\overlaypagestamp
- \setupMPvariables[\m_meta_page_prefix:#1][#2]% prefix is new here
+ \setupmpcategory[\m_meta_page_prefix:#1][#2]% prefix is new here
\csname\??mpgraphic\m_meta_page_prefix:#1\endcsname\empty
\meta_end_graphic_group}
-%D One way of defining a stamp is:
-%D
-%D \starttyping
-%D \def\extendMPoverlaystamp#1%
-%D {\def\docommand##1%
-%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
-%D \processcommalist[#1]\docommand}
-%D \stoptyping
-%D
-%D Since we need to feed \METAPOST\ with expanded dimensions, we introduce a
-%D dedicated expansion engine. We redefine \type {\extendMPoverlaystamp} to
-
\permanent\protected\def\extendMPoverlaystamp#1%
{\processcommalist[#1]\meta_extend_overlay_stamp}
\def\meta_extend_overlay_stamp#1%
- {\meta_prepare_instance_variable{#1}%
- \enforced\permanent\edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
+ {\enforced\permanent\edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
% \getMPdata % define at the lua end
% \rawMPdata % define at the lua end
@@ -951,13 +888,10 @@
\aliased\let\stopMPrun\relax
-%D The \type {\resetMPenvironment} is a quick way to erase
-%D the token list.
-%D
-%D You should be aware of independencies. For instance, if you use a font
-%D in a graphic that is not used in the main document, you need to load the
-%D typescript at the outer level (either directly or by using the global
-%D option).
+%D The \type {\resetMPenvironment} is a quick way to erase the token list. You
+%D should be aware of independencies. For instance, if you use a font in a graphic
+%D that is not used in the main document, you need to load the typescript at the
+%D outer level (either directly or by using the global option).
%D
%D \starttyping
%D \usetypescript[palatino][texnansi]
@@ -973,8 +907,7 @@
%D \stopMPpage
%D \stoptyping
-%D Loading specific \METAPOST\ related definitions is
-%D accomplished by:
+%D Loading specific \METAPOST\ related definitions is accomplished by:
\permanent\protected\def\useMPlibrary[#1]{\clf_useMPlibrary{#1}}
@@ -1018,15 +951,11 @@
\appendtoks
\disablediscretionaries
%\disablecompoundcharacters
-\to \everyMPgraphic
-
-\appendtoks
+ %
\baselineskip1\baselineskip
\lineheight 1\lineheight
\topskip 1\topskip
-\to \everyMPgraphic
-
-\appendtoks
+ %
\enforced\let\#\letterhash
\enforced\let\_\letterunderscore
\enforced\let\&\letterampersand
@@ -1034,14 +963,6 @@
\enforced\let\}\letterclosebrace
\to \everyMPgraphic
-%D \macros
-%D {PDFMPformoffset}
-%D
-%D In \PDF, forms are clipped and therefore we have to take precautions to get this
-%D right. Since this is related to objects, we use the same offset as used there.
-
-\def\PDFMPformoffset{\objectoffset}
-
\newtoks\everyinsertMPfile
\startMPextensions
@@ -1306,25 +1227,6 @@
\setupMPgraphics
[\c!color=\v!local]
-% %D This can save some runtime: rename the mpy file from a first run (when stable) to
-% %D another file and reuse it. One can also use the original filename, but a copy is
-% %D often better.
-% %D
-% %D \starttyping
-% %D \setupMPgraphics
-% %D [mpy=\jobname.mpy]
-% %D \stoptyping
-%
-% \mutable\let\MPdataMPYfile\empty
-%
-% \appendtoks
-% \edef\p_mpy{\directMPgraphicsparameter{mpy}}%
-% \ifempty\p_mpy \else
-% \let\MPdataMPYfile\p_mpy
-% \clf_registermpyfile{\p_mpy}%
-% \fi
-% \to \everysetupMPgraphics
-
%D Some more helpers (see \type {meta-grd.mkiv} for an example of usage):
\permanent\def\MPdpar#1#2{\the\dimexpr#1#2\relax\empty}
diff --git a/tex/context/base/mkxl/meta-pdf.mkxl b/tex/context/base/mkxl/meta-pdf.mkxl
index d53ff7780..32f53ceb3 100644
--- a/tex/context/base/mkxl/meta-pdf.mkxl
+++ b/tex/context/base/mkxl/meta-pdf.mkxl
@@ -34,8 +34,6 @@
%D graphics. The color control flags are also gone as we now integrate into the
%D regular colorspace handling (i.e.\ no longer independent configurations.)
-\permanent\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi} % obsolete, will go
-
\mutable\let\MPfilename\empty
\permanent\protected\def\convertMPtoPDF#1#2#3% scaling no longer supported at this level (so #2 & #3 are ignored)
diff --git a/tex/context/base/mkxl/meta-pdh.mkxl b/tex/context/base/mkxl/meta-pdh.mkxl
index e2d0e15b6..b748682a7 100644
--- a/tex/context/base/mkxl/meta-pdh.mkxl
+++ b/tex/context/base/mkxl/meta-pdh.mkxl
@@ -88,7 +88,7 @@
\let\currentPDFresources\empty
\let\setMPextensions \relax
-\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi}
+\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi} % no longer used
\def\resetMPvariables#1#2#3%
{\glet\MPwidth \!!zeropoint
diff --git a/tex/context/base/mkxl/mlib-ctx.mkxl b/tex/context/base/mkxl/mlib-ctx.mkxl
index fb069b6ea..ac9e73c2e 100644
--- a/tex/context/base/mkxl/mlib-ctx.mkxl
+++ b/tex/context/base/mkxl/mlib-ctx.mkxl
@@ -26,6 +26,7 @@
\registerctxluafile{mlib-lmp}{autosuffix}
\registerctxluafile{mlib-int}{autosuffix}
\registerctxluafile{mlib-lmt}{autosuffix}
+\registerctxluafile{mlib-pos}{autosuffix}
\registerctxluafile{mlib-cnt}{autosuffix,optimize}
\registerctxluafile{mlib-svg}{autosuffix,optimize}
diff --git a/tex/context/base/mkxl/mlib-int.lmt b/tex/context/base/mkxl/mlib-int.lmt
index a936e5592..208370a3c 100644
--- a/tex/context/base/mkxl/mlib-int.lmt
+++ b/tex/context/base/mkxl/mlib-int.lmt
@@ -16,7 +16,7 @@ local get = tex.get
local emwidths = fonts.hashes.emwidths
local exheights = fonts.hashes.exheights
-local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
local on_right_page = structures.pages.on_right
local is_odd_page = structures.pages.is_odd
@@ -52,109 +52,119 @@ do
end
end
- registerscript("year", function() return item("year") end)
- registerscript("month", function() return item("month") end)
- registerscript("day", function() return item("day") end)
- registerscript("hour", function() return item("hour") end)
- registerscript("minute", function() return item("min") end)
- registerscript("second", function() return item("sec") end)
+ registerdirect("year", function() return item("year") end)
+ registerdirect("month", function() return item("month") end)
+ registerdirect("day", function() return item("day") end)
+ registerdirect("hour", function() return item("hour") end)
+ registerdirect("minute", function() return item("min") end)
+ registerdirect("second", function() return item("sec") end)
end
-registerscript("PaperHeight", function() return getdimen("paperheight") * factor end)
-registerscript("PaperWidth", function() return getdimen("paperwidth") * factor end)
-registerscript("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end)
-registerscript("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end)
-registerscript("TopSpace", function() return getdimen("topspace") * factor end)
-registerscript("BottomSpace", function() return getdimen("bottomspace") * factor end)
-registerscript("BackSpace", function() return getdimen("backspace") * factor end)
-registerscript("CutSpace", function() return getdimen("cutspace") * factor end)
-registerscript("MakeupHeight", function() return getdimen("makeupheight") * factor end)
-registerscript("MakeupWidth", function() return getdimen("makeupwidth") * factor end)
-registerscript("TopHeight", function() return getdimen("topheight") * factor end)
-registerscript("TopDistance", function() return getdimen("topdistance") * factor end)
-registerscript("HeaderHeight", function() return getdimen("headerheight") * factor end)
-registerscript("HeaderDistance", function() return getdimen("headerdistance") * factor end)
-registerscript("TextHeight", function() return getdimen("textheight") * factor end)
-registerscript("FooterDistance", function() return getdimen("footerdistance") * factor end)
-registerscript("FooterHeight", function() return getdimen("footerheight") * factor end)
-registerscript("BottomDistance", function() return getdimen("bottomdistance") * factor end)
-registerscript("BottomHeight", function() return getdimen("bottomheight") * factor end)
-registerscript("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end)
-registerscript("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end)
-registerscript("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end)
-registerscript("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end)
-registerscript("TextWidth", function() return getdimen("textwidth") * factor end)
-registerscript("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end)
-registerscript("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end)
-registerscript("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end)
-registerscript("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end)
-registerscript("InnerMarginDistance", function() return getdimen("innermargindistance") * factor end)
-registerscript("InnerMarginWidth", function() return getdimen("innermarginwidth") * factor end)
-registerscript("OuterMarginDistance", function() return getdimen("outermargindistance") * factor end)
-registerscript("OuterMarginWidth", function() return getdimen("outermarginwidth") * factor end)
-registerscript("InnerEdgeDistance", function() return getdimen("inneredgedistance") * factor end)
-registerscript("InnerEdgeWidth", function() return getdimen("inneredgewidth") * factor end)
-registerscript("OuterEdgeDistance", function() return getdimen("outeredgedistance") * factor end)
-registerscript("OuterEdgeWidth", function() return getdimen("outeredgewidth") * factor end)
-registerscript("PageOffset", function() return getdimen("pagebackgroundoffset") * factor end)
-registerscript("PageDepth", function() return getdimen("pagebackgrounddepth") * factor end)
-registerscript("LayoutColumns", function() return getcount("layoutcolumns") end)
-registerscript("LayoutColumnDistance", function() return getdimen("layoutcolumndistance") * factor end)
-registerscript("LayoutColumnWidth", function() return getdimen("layoutcolumnwidth") * factor end)
-registerscript("SpineWidth", function() return getdimen("spinewidth") * factor end)
-registerscript("PaperBleed", function() return getdimen("paperbleed") * factor end)
-
-registerscript("RealPageNumber", function() return getcount("realpageno") end)
-registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
-registerscript("PageNumber", function() return getcount("pageno") end)
-registerscript("NOfPages", function() return getcount("lastpageno") end)
-
-registerscript("SubPageNumber", function() return getcount("subpageno") end)
-registerscript("NOfSubPages", function() return getcount("lastsubpageno") end)
-
-registerscript("CurrentColumn", function() return getcount("mofcolumns") end)
-registerscript("NOfColumns", function() return getcount("nofcolumns") end)
-
-registerscript("BaseLineSkip", function() return get ("baselineskip",true) * factor end)
-registerscript("LineHeight", function() return getdimen("lineheight") * factor end)
-registerscript("BodyFontSize", function() return getdimen("bodyfontsize") * factor end)
-
-registerscript("TopSkip", function() return get ("topskip",true) * factor end)
-registerscript("StrutHeight", function() return getdimen("strutht") * factor end)
-registerscript("StrutDepth", function() return getdimen("strutdp") * factor end)
-
-registerscript("PageNumber", function() return getcount("pageno") end)
-registerscript("RealPageNumber", function() return getcount("realpageno") end)
-registerscript("NOfPages", function() return getcount("lastpageno") end)
-
-registerscript("CurrentWidth", function() return get ("hsize") * factor end)
-registerscript("CurrentHeight", function() return get ("vsize") * factor end)
-
-registerscript("EmWidth", function() return emwidths [false] * factor end)
-registerscript("ExHeight", function() return exheights[false] * factor end)
-
-registerscript("HSize", function() return get ("hsize") * factor end)
-registerscript("VSize", function() return get ("vsize") * factor end)
-registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
-registerscript("OverlayWidth", function() return getdimen("d_overlay_width") * factor end)
-registerscript("OverlayHeight", function() return getdimen("d_overlay_height") * factor end)
-registerscript("OverlayDepth", function() return getdimen("d_overlay_depth") * factor end)
-registerscript("OverlayLineWidth", function() return getdimen("d_overlay_linewidth") * factor end)
-registerscript("OverlayOffset", function() return getdimen("d_overlay_offset") * factor end)
-registerscript("OverlayRegion", function() mpstring(getmacro("m_overlay_region")) end)
---------------("CurrentLayout", function() mpstring(getmacro("currentlayout")) end)
-
--- should be direct
---
--- registerscript("PageFraction", page_fraction)
-
-registerscript("PageFraction", function() return mpboolean(page_fraction ()) end)
-registerscript("OnRightPage", function() return mpboolean(on_right_page ()) end)
-registerscript("OnOddPage", function() return mpboolean(is_odd_page ()) end)
-registerscript("InPageBody", function() return mpboolean(in_body_page ()) end)
-registerscript("LayoutHasChanged", function() return mpboolean(layout_has_changed()) end)
-
-registerscript("defaultcolormodel", defaultcolormodel)
+local injectnumeric = mp.inject.numeric
+
+registerdirect("PaperHeight", function() return getdimen("paperheight") * factor end)
+registerdirect("PaperWidth", function() return getdimen("paperwidth") * factor end)
+registerdirect("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end)
+registerdirect("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end)
+registerdirect("TopSpace", function() return getdimen("topspace") * factor end)
+registerdirect("BottomSpace", function() return getdimen("bottomspace") * factor end)
+registerdirect("BackSpace", function() return getdimen("backspace") * factor end)
+registerdirect("CutSpace", function() return getdimen("cutspace") * factor end)
+registerdirect("MakeupHeight", function() return getdimen("makeupheight") * factor end)
+registerdirect("MakeupWidth", function() return getdimen("makeupwidth") * factor end)
+registerdirect("TopHeight", function() return getdimen("topheight") * factor end)
+registerdirect("TopDistance", function() return getdimen("topdistance") * factor end)
+registerdirect("HeaderHeight", function() return getdimen("headerheight") * factor end)
+registerdirect("HeaderDistance", function() return getdimen("headerdistance") * factor end)
+registerdirect("TextHeight", function() return getdimen("textheight") * factor end)
+registerdirect("FooterDistance", function() return getdimen("footerdistance") * factor end)
+registerdirect("FooterHeight", function() return getdimen("footerheight") * factor end)
+registerdirect("BottomDistance", function() return getdimen("bottomdistance") * factor end)
+registerdirect("BottomHeight", function() return getdimen("bottomheight") * factor end)
+registerdirect("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end)
+registerdirect("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end)
+registerdirect("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end)
+registerdirect("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end)
+registerdirect("TextWidth", function() return getdimen("textwidth") * factor end)
+registerdirect("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end)
+registerdirect("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end)
+registerdirect("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end)
+registerdirect("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end)
+registerdirect("InnerMarginDistance", function() return getdimen("innermargindistance") * factor end)
+registerdirect("InnerMarginWidth", function() return getdimen("innermarginwidth") * factor end)
+registerdirect("OuterMarginDistance", function() return getdimen("outermargindistance") * factor end)
+registerdirect("OuterMarginWidth", function() return getdimen("outermarginwidth") * factor end)
+registerdirect("InnerEdgeDistance", function() return getdimen("inneredgedistance") * factor end)
+registerdirect("InnerEdgeWidth", function() return getdimen("inneredgewidth") * factor end)
+registerdirect("OuterEdgeDistance", function() return getdimen("outeredgedistance") * factor end)
+registerdirect("OuterEdgeWidth", function() return getdimen("outeredgewidth") * factor end)
+registerdirect("PageOffset", function() return getdimen("pagebackgroundoffset") * factor end)
+registerdirect("PageDepth", function() return getdimen("pagebackgrounddepth") * factor end)
+registerdirect("LayoutColumns", function() return getcount("layoutcolumns") end)
+registerdirect("LayoutColumnDistance", function() return getdimen("layoutcolumndistance") * factor end)
+registerdirect("LayoutColumnWidth", function() return getdimen("layoutcolumnwidth") * factor end)
+registerdirect("SpineWidth", function() return getdimen("spinewidth") * factor end)
+registerdirect("PaperBleed", function() return getdimen("paperbleed") * factor end)
+
+registerdirect("RealPageNumber", function() return getcount("realpageno") end)
+registerdirect("LastPageNumber", function() return getcount("lastpageno") end)
+
+registerdirect("PageNumber", function() return getcount("pageno") end)
+registerdirect("NOfPages", function() return getcount("lastpageno") end)
+
+registerdirect("SubPageNumber", function() return getcount("subpageno") end)
+registerdirect("NOfSubPages", function() return getcount("lastsubpageno") end)
+
+registerdirect("CurrentColumn", function() return getcount("mofcolumns") end)
+registerdirect("NOfColumns", function() return getcount("nofcolumns") end)
+
+registerdirect("BaseLineSkip", function() return get ("baselineskip",true) * factor end)
+registerdirect("LineHeight", function() return getdimen("lineheight") * factor end)
+registerdirect("BodyFontSize", function() return getdimen("bodyfontsize") * factor end)
+
+registerdirect("TopSkip", function() return get ("topskip",true) * factor end)
+registerdirect("StrutHeight", function() return getdimen("strutht") * factor end)
+registerdirect("StrutDepth", function() return getdimen("strutdp") * factor end)
+
+registerdirect("PageNumber", function() return getcount("pageno") end)
+registerdirect("RealPageNumber", function() return getcount("realpageno") end)
+registerdirect("NOfPages", function() return getcount("lastpageno") end)
+
+registerdirect("CurrentWidth", function() return get ("hsize") * factor end)
+registerdirect("CurrentHeight", function() return get ("vsize") * factor end)
+
+registerdirect("EmWidth", function() return emwidths [false] * factor end)
+registerdirect("ExHeight", function() return exheights[false] * factor end)
+
+registerdirect("HSize", function() return get ("hsize") * factor end)
+registerdirect("VSize", function() return get ("vsize") * factor end)
+registerdirect("LastPageNumber", function() return getcount("lastpageno") end)
+
+registerdirect("OverlayWidth", function() return getdimen("d_overlay_width") * factor end)
+registerdirect("OverlayHeight", function() return getdimen("d_overlay_height") * factor end)
+registerdirect("OverlayDepth", function() return getdimen("d_overlay_depth") * factor end)
+registerdirect("OverlayLineWidth", function() return getdimen("d_overlay_linewidth") * factor end)
+registerdirect("OverlayOffset", function() return getdimen("d_overlay_offset") * factor end)
+registerdirect("OverlayRegion", function() return getmacro("m_overlay_region") end)
+--------------("CurrentLayout", function() return getmacro("currentlayout") end)
+
+-- registerscript("PageFraction", function() return mpboolean(page_fraction ()) end)
+-- registerscript("OnRightPage", function() return mpboolean(on_right_page ()) end)
+-- registerscript("OnOddPage", function() return mpboolean(is_odd_page ()) end)
+-- registerscript("InPageBody", function() return mpboolean(in_body_page ()) end)
+-- registerscript("LayoutHasChanged", function() return mpboolean(layout_has_changed()) end)
+
+registerdirect("PageFraction", function() return page_fraction () end)
+registerdirect("OnRightPage", function() return on_right_page () end)
+registerdirect("OnOddPage", function() return is_odd_page () end)
+registerdirect("InPageBody", function() return in_body_page () end)
+registerdirect("LayoutHasChanged", function() return layout_has_changed() end)
+
+registerdirect("PageFraction", page_fraction )
+registerdirect("OnRightPage", on_right_page )
+registerdirect("OnOddPage", is_odd_page )
+registerdirect("InPageBody", in_body_page )
+registerdirect("LayoutHasChanged", layout_has_changed)
+
+registerdirect("defaultcolormodel", defaultcolormodel)
diff --git a/tex/context/base/mkxl/mlib-lmp.lmt b/tex/context/base/mkxl/mlib-lmp.lmt
index 2b3e910ba..c493c55ae 100644
--- a/tex/context/base/mkxl/mlib-lmp.lmt
+++ b/tex/context/base/mkxl/mlib-lmp.lmt
@@ -14,6 +14,7 @@ local aux = mp.aux
local mpnumeric = aux.numeric
local mppair = aux.pair
+local registerdirect = metapost.registerdirect
local registerscript = metapost.registerscript
local scan = mp.scan
@@ -89,16 +90,31 @@ registerscript("showhashentry", function()
end
end)
-local getmacro = tokens.getters.macro
-local mpgnamespace = getmacro("??graphicvariable")
-
-local scanmpstring = mp.scan.string
-
-local injectnumeric = mp.inject.numeric
-local injectstring = mp.inject.string
-
--- registerscript("mpv_numeric", function() injectnumeric (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end)
--- registerscript("mpv_dimension", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring()) end)
--- registerscript("mpv_string", function() injectstring (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end)
-
-registerscript("mpvar", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring(), true) end) -- Isn't it already edef'd?
+-- local getmacro = tokens.getters.macro
+-- local mpgnamespace = getmacro("??graphicvariable")
+-- local scanmpstring = mp.scan.string
+-- local injectnumeric = mp.inject.numeric
+-- local injectstring = mp.inject.string
+
+-- registerscript("mpv_numeric", function() injectnumeric (getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring())) end)
+-- registerscript("mpv_dimension", function() return getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring()) end)
+-- registerscript("mpv_string", function() injectstring (getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring())) end)
+
+-- registerscript("mpvar", function() return getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring(), true) end) -- Isn't it already edef'd?
+-- registerscript("mpvar", function() return getmacro(metapost.namespace .. scanmpstring(), true) end) -- Isn't it already edef'd?
+
+local scanstring = mp.scan.string
+local expandtex = mp.expandtex
+
+local tokenvalues = tokens.values
+local dimension_value = tokenvalues.dimension
+local integer_value = tokenvalues.integer
+local boolean_value = tokenvalues.boolean
+local string_value = tokenvalues.string
+local unknown_value = tokenvalues.none
+
+registerdirect("mpvard", function() expandtex(dimension_value,"mpcategoryparameter",true,scanstring()) end)
+registerdirect("mpvarn", function() expandtex(integer_value, "mpcategoryparameter",true,scanstring()) end)
+registerdirect("mpvars", function() expandtex(string_value, "mpcategoryparameter",true,scanstring()) end)
+registerdirect("mpvarb", function() expandtex(boolean_value, "mpcategoryparameter",true,scanstring()) end)
+registerdirect("mpvar", function() expandtex(unknown_value, "mpcategoryparameter",true,scanstring()) end)
diff --git a/tex/context/base/mkxl/mlib-lua.lmt b/tex/context/base/mkxl/mlib-lua.lmt
index 068d17f32..e5737be8c 100644
--- a/tex/context/base/mkxl/mlib-lua.lmt
+++ b/tex/context/base/mkxl/mlib-lua.lmt
@@ -71,16 +71,15 @@ scan.transform = function(t) if trace then reporti("transform") end return s
scan.path = function(t) if trace then reporti("path") end return scan_path (currentmpx,t) end
scan.pen = function(t) if trace then reporti("pen") end return scan_pen (currentmpx,t) end
-skip.token = function(t) return skip_token (currentmpx,t) end
-
-get.hashentry = function(n) return get_hashentry (currentmpx,n) end
+skip.token = function(t) return skip_token (currentmpx,t) end
+get.hashentry = function(n) return get_hashentry(currentmpx,n) end
local solvepath = mplib.solvepath
local getstatus = mplib.getstatus
+local expandtex = mplib.expandtex
-mp.solve = function(...)
- return solvepath(currentmpx,...)
-end
+mp.solve = function(...) return solvepath(currentmpx,...) end
+mp.expandtex = function(...) expandtex(currentmpx,...) end
local inject_path = mplib.inject_path
local inject_numeric = mplib.inject_numeric
@@ -93,7 +92,6 @@ local inject_cmykcolor = mplib.inject_cmykcolor
local inject_transform = mplib.inject_transform
local inject_whatever = mplib.inject_whatever
-
------.path = function(t,cycle,curled) if trace then reporti("path") end return inject_path (currentmpx,t,cycle,curled) end
inject.numeric = function(n) if trace then reporti("numeric") end return inject_numeric (currentmpx,n) end
inject.pair = function(x,y) if trace then reporti("pair") end return inject_pair (currentmpx,x,y) end
diff --git a/tex/context/base/mkxl/mlib-mat.lmt b/tex/context/base/mkxl/mlib-mat.lmt
index 3a63b32c7..68e3c98d1 100644
--- a/tex/context/base/mkxl/mlib-mat.lmt
+++ b/tex/context/base/mkxl/mlib-mat.lmt
@@ -16,78 +16,82 @@ local scancolor = scanners.color
local mppair = injectors.pair or mp.pair
local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
local m = xmath
local c = xcomplex
-local m_acos = m.acos registerscript("m_acos", function() return m_acos (scannumeric()) end)
-local m_acosh = m.acosh registerscript("m_acosh", function() return m_acosh (scannumeric()) end)
-local m_asin = m.asin registerscript("m_asin", function() return m_asin (scannumeric()) end)
-local m_asinh = m.asinh registerscript("m_asinh", function() return m_asinh (scannumeric()) end)
-local m_atan = m.atan registerscript("m_atan", function() return m_atan (scannumeric()) end)
-local m_atan2 = m.atan2 registerscript("m_atan2", function() return m_atan2 (scanpair ()) end)
-local m_atanh = m.atanh registerscript("m_atanh", function() return m_atanh (scannumeric()) end)
-local m_cbrt = m.cbrt registerscript("m_cbrt", function() return m_cbrt (scannumeric()) end)
-local m_ceil = m.ceil registerscript("m_ceil", function() return m_ceil (scannumeric()) end)
-local m_copysign = m.copysign registerscript("m_copysign", function() return m_copysign (scanpair ()) end)
-local m_cos = m.cos registerscript("m_cos", function() return m_cos (scannumeric()) end)
-local m_cosh = m.cosh registerscript("m_cosh", function() return m_cosh (scannumeric()) end)
-local m_deg = m.deg registerscript("m_deg", function() return m_deg (scannumeric()) end)
-local m_erf = m.erf registerscript("m_erf", function() return m_erf (scannumeric()) end)
-local m_erfc = m.erfc registerscript("m_erfc", function() return m_erfc (scannumeric()) end)
-local m_exp = m.exp registerscript("m_exp", function() return m_exp (scannumeric()) end)
-local m_exp2 = m.exp2 registerscript("m_exp2", function() return m_exp2 (scannumeric()) end)
-local m_expm1 = m.expm1 registerscript("m_expm1", function() return m_expm1 (scannumeric()) end)
-local m_fabs = m.fabs registerscript("m_fabs", function() return m_fabs (scannumeric()) end)
-local m_fdim = m.fdim registerscript("m_fdim", function() return m_fdim (scanpair ()) end)
-local m_floor = m.floor registerscript("m_floor", function() return m_floor (scannumeric()) end)
-local m_fma = m.fma registerscript("m_fma", function() return m_fma (scancolor ()) end)
-local m_fmax = m.fmax registerscript("m_fmax", function() return m_fmax (scannumeric()) end)
-local m_fmin = m.fmin registerscript("m_fmin", function() return m_fmin (scannumeric()) end)
-local m_fmod = m.fmod registerscript("m_fmod", function() return m_fmod (scanpair ()) end)
-local m_frexp = m.frexp registerscript("m_frexp", function() return m_frexp (scannumeric()) end)
-local m_gamma = m.gamma registerscript("m_gamma", function() return m_gamma (scannumeric()) end)
-local m_hypot = m.hypot registerscript("m_hypot", function() return m_hypot (scanpair ()) end)
-local m_isfinite = m.isfinite registerscript("m_isfinite", function() return m_isfinite (scannumeric()) end)
-local m_isinf = m.isinf registerscript("m_isinf", function() return m_isinf (scannumeric()) end)
-local m_isnan = m.isnan registerscript("m_isnan", function() return m_isnan (scannumeric()) end)
-local m_isnormal = m.isnormal registerscript("m_isnormal", function() return m_isnormal (scannumeric()) end)
-local m_j0 = m.j0 registerscript("m_j0", function() return m_j0 (scannumeric()) end)
-local m_j1 = m.j1 registerscript("m_j1", function() return m_j1 (scannumeric()) end)
-local m_jn = m.jn registerscript("m_jn", function() return m_jn (scanpair ()) end)
-local m_ldexp = m.ldexp registerscript("m_ldexp", function() return m_ldexp (scanpair ()) end)
-local m_lgamma = m.lgamma registerscript("m_lgamma", function() return m_lgamma (scannumeric()) end)
-local m_log = m.log registerscript("m_log", function() return m_log (scannumeric()) end)
-local m_log10 = m.log10 registerscript("m_log10", function() return m_log10 (scannumeric()) end)
-local m_log1p = m.log1p registerscript("m_log1p", function() return m_log1p (scannumeric()) end)
-local m_log2 = m.log2 registerscript("m_log2", function() return m_log2 (scannumeric()) end)
-local m_logb = m.logb registerscript("m_logb", function() return m_logb (scannumeric()) end)
-local m_modf = m.modf registerscript("m_modf", function() return m_modf (scannumeric()) end)
-local m_nearbyint = m.nearbyint registerscript("m_nearbyint", function() return m_nearbyint(scannumeric()) end)
-local m_nextafter = m.nextafter registerscript("m_nextafter", function() return m_nextafter(scanpair ()) end)
-local m_pow = m.pow registerscript("m_pow", function() return m_pow (scanpair ()) end)
-local m_rad = m.rad registerscript("m_rad", function() return m_rad (scannumeric()) end)
-local m_remainder = m.remainder registerscript("m_remainder", function() return m_remainder(scanpair ()) end)
-local m_remquo = m.remquo registerscript("m_remquo", function() return m_remquo (scannumeric()) end)
-local m_round = m.round registerscript("m_round", function() return m_round (scannumeric()) end)
-local m_scalbn = m.scalbn registerscript("m_scalbn", function() return m_scalbn (scanpair ()) end)
-local m_sin = m.sin registerscript("m_sin", function() return m_sin (scannumeric()) end)
-local m_sinh = m.sinh registerscript("m_sinh", function() return m_sinh (scannumeric()) end)
-local m_sqrt = m.sqrt registerscript("m_sqrt", function() return m_sqrt (scannumeric()) end)
-local m_tan = m.tan registerscript("m_tan", function() return m_tan (scannumeric()) end)
-local m_tanh = m.tanh registerscript("m_tanh", function() return m_tanh (scannumeric()) end)
-local m_tgamma = m.tgamma registerscript("m_tgamma", function() return m_tgamma (scannumeric()) end)
-local m_trunc = m.trunc registerscript("m_trunc", function() return m_trunc (scannumeric()) end)
-local m_y0 = m.y0 registerscript("m_y0", function() return m_y0 (scannumeric()) end)
-local m_y1 = m.y1 registerscript("m_y1", function() return m_y1 (scannumeric()) end)
-local m_yn = m.yn registerscript("m_yn", function() return m_yn (scanpair ()) end)
+local m_acos = m.acos registerdirect("m_acos", function() return m_acos (scannumeric()) end)
+local m_acosh = m.acosh registerdirect("m_acosh", function() return m_acosh (scannumeric()) end)
+local m_asin = m.asin registerdirect("m_asin", function() return m_asin (scannumeric()) end)
+local m_asinh = m.asinh registerdirect("m_asinh", function() return m_asinh (scannumeric()) end)
+local m_atan = m.atan registerdirect("m_atan", function() return m_atan (scannumeric()) end)
+local m_atan2 = m.atan2 registerdirect("m_atan2", function() return m_atan2 (scanpair ()) end)
+local m_atanh = m.atanh registerdirect("m_atanh", function() return m_atanh (scannumeric()) end)
+local m_cbrt = m.cbrt registerdirect("m_cbrt", function() return m_cbrt (scannumeric()) end)
+local m_ceil = m.ceil registerdirect("m_ceil", function() return m_ceil (scannumeric()) end)
+local m_copysign = m.copysign registerdirect("m_copysign", function() return m_copysign (scanpair ()) end)
+local m_cos = m.cos registerdirect("m_cos", function() return m_cos (scannumeric()) end)
+local m_cosh = m.cosh registerdirect("m_cosh", function() return m_cosh (scannumeric()) end)
+local m_deg = m.deg registerdirect("m_deg", function() return m_deg (scannumeric()) end)
+local m_erf = m.erf registerdirect("m_erf", function() return m_erf (scannumeric()) end)
+local m_erfc = m.erfc registerdirect("m_erfc", function() return m_erfc (scannumeric()) end)
+local m_exp = m.exp registerdirect("m_exp", function() return m_exp (scannumeric()) end)
+local m_exp2 = m.exp2 registerdirect("m_exp2", function() return m_exp2 (scannumeric()) end)
+local m_expm1 = m.expm1 registerdirect("m_expm1", function() return m_expm1 (scannumeric()) end)
+local m_fabs = m.fabs registerdirect("m_fabs", function() return m_fabs (scannumeric()) end)
+local m_fdim = m.fdim registerdirect("m_fdim", function() return m_fdim (scanpair ()) end)
+local m_floor = m.floor registerdirect("m_floor", function() return m_floor (scannumeric()) end)
+local m_fma = m.fma registerdirect("m_fma", function() return m_fma (scancolor ()) end)
+local m_fmax = m.fmax registerdirect("m_fmax", function() return m_fmax (scannumeric()) end)
+local m_fmin = m.fmin registerdirect("m_fmin", function() return m_fmin (scannumeric()) end)
+local m_fmod = m.fmod registerdirect("m_fmod", function() return m_fmod (scanpair ()) end)
+local m_frexp = m.frexp registerdirect("m_frexp", function() return m_frexp (scannumeric()) end)
+local m_gamma = m.gamma registerdirect("m_gamma", function() return m_gamma (scannumeric()) end)
+local m_hypot = m.hypot registerdirect("m_hypot", function() return m_hypot (scanpair ()) end)
+local m_isfinite = m.isfinite registerdirect("m_isfinite", function() return m_isfinite (scannumeric()) end)
+local m_isinf = m.isinf registerdirect("m_isinf", function() return m_isinf (scannumeric()) end)
+local m_isnan = m.isnan registerdirect("m_isnan", function() return m_isnan (scannumeric()) end)
+local m_isnormal = m.isnormal registerdirect("m_isnormal", function() return m_isnormal (scannumeric()) end)
+local m_j0 = m.j0 registerdirect("m_j0", function() return m_j0 (scannumeric()) end)
+local m_j1 = m.j1 registerdirect("m_j1", function() return m_j1 (scannumeric()) end)
+local m_jn = m.jn registerdirect("m_jn", function() return m_jn (scanpair ()) end)
+local m_ldexp = m.ldexp registerdirect("m_ldexp", function() return m_ldexp (scanpair ()) end)
+local m_lgamma = m.lgamma registerdirect("m_lgamma", function() return m_lgamma (scannumeric()) end)
+local m_log = m.log registerdirect("m_log", function() return m_log (scannumeric()) end)
+local m_log10 = m.log10 registerdirect("m_log10", function() return m_log10 (scannumeric()) end)
+local m_log1p = m.log1p registerdirect("m_log1p", function() return m_log1p (scannumeric()) end)
+local m_log2 = m.log2 registerdirect("m_log2", function() return m_log2 (scannumeric()) end)
+local m_logb = m.logb registerdirect("m_logb", function() return m_logb (scannumeric()) end)
+local m_modf = m.modf registerdirect("m_modf", function() return m_modf (scannumeric()) end)
+local m_nearbyint = m.nearbyint registerdirect("m_nearbyint", function() return m_nearbyint(scannumeric()) end)
+local m_nextafter = m.nextafter registerdirect("m_nextafter", function() return m_nextafter(scanpair ()) end)
+local m_pow = m.pow registerdirect("m_pow", function() return m_pow (scanpair ()) end)
+local m_rad = m.rad registerdirect("m_rad", function() return m_rad (scannumeric()) end)
+local m_remainder = m.remainder registerdirect("m_remainder", function() return m_remainder(scanpair ()) end)
+local m_remquo = m.remquo registerdirect("m_remquo", function() return m_remquo (scannumeric()) end)
+local m_round = m.round registerdirect("m_round", function() return m_round (scannumeric()) end)
+local m_scalbn = m.scalbn registerdirect("m_scalbn", function() return m_scalbn (scanpair ()) end)
+local m_sin = m.sin registerdirect("m_sin", function() return m_sin (scannumeric()) end)
+local m_sinh = m.sinh registerdirect("m_sinh", function() return m_sinh (scannumeric()) end)
+local m_sqrt = m.sqrt registerdirect("m_sqrt", function() return m_sqrt (scannumeric()) end)
+local m_tan = m.tan registerdirect("m_tan", function() return m_tan (scannumeric()) end)
+local m_tanh = m.tanh registerdirect("m_tanh", function() return m_tanh (scannumeric()) end)
+local m_tgamma = m.tgamma registerdirect("m_tgamma", function() return m_tgamma (scannumeric()) end)
+local m_trunc = m.trunc registerdirect("m_trunc", function() return m_trunc (scannumeric()) end)
+local m_y0 = m.y0 registerdirect("m_y0", function() return m_y0 (scannumeric()) end)
+local m_y1 = m.y1 registerdirect("m_y1", function() return m_y1 (scannumeric()) end)
+local m_yn = m.yn registerdirect("m_yn", function() return m_yn (scanpair ()) end)
if not (c and c.sin) then
return
end
-local c_topair = c.topair
-local c_new = c.new
+local c_topair = c.topair
+local c_totable = c.totable
+local c_new = c.new
+
+----- c_sin = c.sin registerdirect("c_sin", function() return c_totable(c_sin (c_new(scanpair()))) end)
local c_sin = c.sin registerscript("c_sin", function() return mppair(c_topair(c_sin (c_new(scanpair())))) end)
local c_cos = c.cos registerscript("c_cos", function() return mppair(c_topair(c_cos (c_new(scanpair())))) end)
diff --git a/tex/context/base/mkxl/mlib-mpf.lmt b/tex/context/base/mkxl/mlib-mpf.lmt
index f24d7fde0..51b507647 100644
--- a/tex/context/base/mkxl/mlib-mpf.lmt
+++ b/tex/context/base/mkxl/mlib-mpf.lmt
@@ -77,22 +77,38 @@ do
local runscripts = { }
local runnames = { }
+ local runmodes = { }
local nofscripts = 0
- function metapost.registerscript(name,f)
+ local function registerscript(name,mode,f)
nofscripts = nofscripts + 1
+ if not f then
+ f = mode
+ mode = "buffered"
+ end
if f then
runscripts[nofscripts] = f
runnames[name] = nofscripts
else
runscripts[nofscripts] = name
end
+ runmodes[nofscripts] = mode
if trace_script then
- report_script("registering script %a as %i",name,nofscripts)
+ report_script("registering %s script %a as %i",mode,name,nofscripts)
end
return nofscripts
end
+ metapost.registerscript = registerscript
+
+ function metapost.registerdirect(name,f)
+ registerscript(name,"direct",f)
+ end
+
+ function metapost.registertokens(name,f)
+ registerscript(name,"tokens",f)
+ end
+
function metapost.scriptindex(name)
local index = runnames[name] or 0
if trace_script then
@@ -157,6 +173,16 @@ do
elseif trace_luarun then
report_luarun("%i: index: %i",nesting,code)
end
+ local m = runmodes[code]
+ if m == "direct" then
+ result = f()
+ nesting = nesting - 1
+ return result, true -- string and tables as string and objects
+ elseif m == "tokens" then
+ result = f()
+ nesting = nesting - 1
+ return result -- string and tables as text to be scanned
+ end
else
if trace_luarun then
report_luarun("%i: code: %s",nesting,code)
@@ -687,11 +713,8 @@ do
-- once bootstrapped ... (needs pushed mpx instances)
- metapost.registerscript("scriptindex",function()
- local name = scanstring()
- local index = scriptindex(name)
- -- report_script("method %i, name %a, index %i",2,name,index)
- mpnumeric(index)
+ metapost.registerdirect("scriptindex",function()
+ return scriptindex(scanstring())
end)
end
@@ -923,6 +946,7 @@ do
local injectstring = inject.string
local injectnumeric = inject.numeric
+ local registerdirect = metapost.registerdirect
local registerscript = metapost.registerscript
local comma_code = metapost.codes.comma
@@ -941,10 +965,15 @@ do
-- more helpers
- registerscript("getmacro", function() injectstring (getmacro(scanstring())) end)
- registerscript("getdimen", function() injectnumeric(getdimen(scanstring())*bpfactor) end)
- registerscript("getcount", function() injectnumeric(getcount(scanstring())) end)
- registerscript("gettoks", function() injectstring (gettoks (scanstring())) end)
+ -- registerscript("getmacro", function() injectstring (getmacro(scanstring())) end)
+ -- registerscript("getcount", function() injectnumeric(getcount(scanstring())) end)
+ -- registerscript("gettoks", function() injectstring (gettoks (scanstring())) end)
+ -- registerscript("getdimen", function() injectnumeric(getdimen(scanstring()) * bpfactor) end)
+
+ registerdirect("getmacro", function() return getmacro(scanstring()) end)
+ registerdirect("getcount", function() return getcount(scanstring()) end)
+ registerdirect("gettoks", function() return gettoks (scanstring()) end)
+ registerdirect("getdimen", function() return getdimen(scanstring()) * bpfactor end)
registerscript("setmacro", function() setmacro(scanstring(),scanstring()) end)
registerscript("setdimen", function() setdimen(scanstring(),scannumeric()/bpfactor) end)
@@ -956,21 +985,22 @@ do
registerscript("setglobalcount", function() setcount("global",scanstring(),scannumeric()) end)
registerscript("setglobaltoks", function() settoks ("global",scanstring(),scanstring()) end)
-
local utfnum = utf.byte
local utflen = utf.len
local utfsub = utf.sub
- registerscript("utfnum", function()
- injectnumeric(utfnum(scanstring()))
- end)
+ -- registerscript("utfnum", function() injectnumeric(utfnum(scanstring())) end)
+ -- registerscript("utflen", function() injectnumeric(utflen(scanstring())) end)
+ --
+ -- registerscript("utfsub", function() -- we have an optional third argument so we explicitly scan a text argument
+ -- injectstring(utfsub(scanstring(),skiptoken(comma_code) and scannumeric(),skiptoken(comma_code) and scannumeric()))
+ -- end)
- registerscript("utflen", function()
- injectnumeric(utflen(scanstring()))
- end)
+ registerdirect("utfnum", function() utfnum(scanstring()) end)
+ registerdirect("utflen", function() utflen(scanstring()) end)
- registerscript("utfsub", function() -- we have an optional third argument so we explicitly scan a text argument
- injectstring(utfsub(scanstring(),skiptoken(comma_code) and scannumeric(),skiptoken(comma_code) and scannumeric()))
+ registerdirect("utfsub", function() -- we have an optional third argument so we explicitly scan a text argument
+ utfsub(scanstring(),skiptoken(comma_code) and scannumeric(),skiptoken(comma_code) and scannumeric())
end)
end
diff --git a/tex/context/base/mkxl/mlib-pos.lmt b/tex/context/base/mkxl/mlib-pos.lmt
new file mode 100644
index 000000000..5ea0e1a1e
--- /dev/null
+++ b/tex/context/base/mkxl/mlib-pos.lmt
@@ -0,0 +1,59 @@
+if not modules then modules = { } end modules ['mlib-pos'] = {
+ version = 1.001,
+ comment = "companion to mlib-ctx.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local jobpositions = job.positions
+local mpnumeric = mp.inject.numeric
+local mpstring = mp.inject.string
+local scanstring = mp.scan.string
+local factor = number.dimenfactors.bp
+local registerdirect = metapost.registerdirect
+
+local page = jobpositions.page
+local paragraph = jobpositions.paragraph
+local column = jobpositions.column
+local region = jobpositions.region
+local x = jobpositions.x
+local y = jobpositions.y
+local xy = jobpositions.xy
+local width = jobpositions.width
+local height = jobpositions.height
+local depth = jobpositions.depth
+local leftskip = jobpositions.leftskip
+local rightskip = jobpositions.rightskip
+local hsize = jobpositions.hsize
+local parindent = jobpositions.parindent
+local hangindent = jobpositions.hangindent
+local hangafter = jobpositions.hangafter
+local lowerleft = jobpositions.lowerleft
+local upperleft = jobpositions.upperleft
+local lowerright = jobpositions.lowerright
+local upperright = jobpositions.upperright
+
+registerdirect("getpospage", function() return page (scanstring()) end)
+registerdirect("getposparagraph", function() return paragraph (scanstring()) end)
+registerdirect("getposcolumn", function() return column (scanstring()) end)
+registerdirect("getposregion", function() return region (scanstring()) end)
+registerdirect("getposx", function() return x (scanstring()) * factor end)
+registerdirect("getposy", function() return y (scanstring()) * factor end)
+registerdirect("getposwidth", function() return width (scanstring()) * factor end)
+registerdirect("getposheight", function() return height (scanstring()) * factor end)
+registerdirect("getposdepth", function() return depth (scanstring()) * factor end)
+registerdirect("getposleftskip", function() return leftskip (scanstring()) * factor end)
+registerdirect("getposrightskip", function() return rightskip (scanstring()) * factor end)
+registerdirect("getposhsize", function() return hsize (scanstring()) * factor end)
+registerdirect("getposparindent", function() return parindent (scanstring()) * factor end)
+registerdirect("getposhangindent", function() return hangindent(scanstring()) * factor end)
+registerdirect("getposhangafter", function() return hangafter (scanstring()) * factor end)
+
+local t = { 0, 0 } -- let's share
+
+registerdirect("getposxy", function() local x, y = xy (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposupperleft", function() local x, y = upperleft (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposlowerleft", function() local x, y = lowerleft (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposupperright", function() local x, y = upperright(scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposlowerright", function() local x, y = lowerright(scanstring()) t[1] = x * factor t[2] = y * factor return t end)
diff --git a/tex/context/base/mkxl/mlib-pps.lmt b/tex/context/base/mkxl/mlib-pps.lmt
index 01e0dbfcf..0d6beee00 100644
--- a/tex/context/base/mkxl/mlib-pps.lmt
+++ b/tex/context/base/mkxl/mlib-pps.lmt
@@ -28,7 +28,7 @@ local mpscannumeric = scan.numeric
local injecttriplet = inject.triplet
-local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
local implement = interfaces.implement
local setmacro = interfaces.setmacro
@@ -568,7 +568,7 @@ local function checkaskedfig(askedfig) -- return askedfig, wrappit
end
-- This one is called from the \TEX\ end so the specification is different
--- from the specification to metapost,run cum suis! The definitions and
+-- from the specification to metapost.run cum suis! The definitions and
-- extension used to be handled here but are now delegated to the format
-- initializers because we need to accumulate them for nested instances (a
-- side effect of going single pass).
@@ -866,8 +866,8 @@ local tx_reset, tx_process do
mf_some_text(index,madetext,catcodes.numbers.ctxcatcodes) -- btex/etex ..
end
- registerscript("sometextext", function() mf_some_text(mpscannumeric(),mpscanstring(),mpscannumeric()) end)
- registerscript("madetextext", function() mf_made_text(mpscannumeric()) end)
+ registerdirect("sometextext", function() mf_some_text(mpscannumeric(),mpscanstring(),mpscannumeric()) end)
+ registerdirect("madetextext", function() mf_made_text(mpscannumeric()) end)
-- a label can be anything, also something mp doesn't like in strings
-- so we return an index instead
diff --git a/tex/context/base/mkxl/mlib-scn.lmt b/tex/context/base/mkxl/mlib-scn.lmt
index e68abf587..786ec2631 100644
--- a/tex/context/base/mkxl/mlib-scn.lmt
+++ b/tex/context/base/mkxl/mlib-scn.lmt
@@ -258,7 +258,6 @@ local function getparameters()
setmetatableindex(parameters,presets)
end
namespaces[namespace] = parameters
- --
end
local function applyparameters()
@@ -279,8 +278,9 @@ local function applyparameters()
end
namespaces[namespace] = parameters
-- till here
- mpprint(action)
+ -- mpprint(action)
namespaces = saved
+ return action
end
local knownparameters = { }
@@ -398,11 +398,12 @@ local function getparameter()
end
v = vl
end
- if v == nil then
- return injectnumeric(0)
- else
- return get(v)
- end
+-- if v == nil then
+-- return injectnumeric(0)
+-- else
+-- return get(v)
+-- end
+ return v or 0
end
local function hasparameter()
@@ -423,11 +424,12 @@ local function hasparameter()
end
v = vl
end
- if v == nil then
- return injectboolean(false)
- else
- return injectboolean(true)
- end
+ -- if v == nil then
+ -- return injectboolean(false)
+ -- else
+ -- return injectboolean(true)
+ -- end
+ return v ~= nil
end
local function hasoption()
@@ -439,7 +441,8 @@ local function hasoption()
local l = list[i]
local vl = v[l]
if vl == nil then
- return injectboolean(false)
+ -- return injectboolean(false)
+ return false
end
v = vl
end
@@ -450,18 +453,21 @@ local function hasoption()
-- no caching .. slow anyway
local o = list[n]
if v == o then
- return injectboolean(true)
+ -- return injectboolean(true)
+ return true
end
for vv in gmatch(v,"[^%s,]+") do
for oo in gmatch(o,"[^%s,]+") do
if vv == oo then
- return injectboolean(true)
+ -- return injectboolean(true)
+ return true
end
end
end
end
end
- return injectboolean(false)
+ -- return injectboolean(false)
+ return false
end
local function getparameterdefault()
@@ -478,7 +484,8 @@ local function getparameterdefault()
end
end
if vl == nil then
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
else
if type(vl) == "string" then
local td = type(list[n])
@@ -488,7 +495,8 @@ local function getparameterdefault()
vl = vl == "true"
end
end
- return get(vl)
+ -- return get(vl)
+ return vl
end
else
for i=1,n-1 do
@@ -498,7 +506,8 @@ local function getparameterdefault()
if type(l) == "number" then
vl = v[1]
if vl == nil then
- return get(list[n])
+ -- return get(list[n])
+ return list[n]
end
else
local last = list[n]
@@ -514,26 +523,31 @@ local function getparameterdefault()
local l = list[i]
local vl = v[l]
if vl == nil then
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
end
v = vl
end
- if v == nil then
- return injectnumeric(0)
- else
- return get(v)
- end
+ -- if v == nil then
+ -- return injectnumeric(0)
+ -- else
+ -- return get(v)
+ -- end
+ return v or 0
end
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
else
- return get(last)
+ -- return get(last)
+ return last
end
end
end
v = vl
end
if v == nil then
- return get(list[n])
+ -- return get(list[n])
+ return list[n]
else
if type(v) == "string" then
local td = type(list[n])
@@ -543,7 +557,8 @@ local function getparameterdefault()
v = v == "true"
end
end
- return get(v)
+ -- return get(v)
+ return v
end
end
end
@@ -557,7 +572,8 @@ local function getparametercount()
break
end
end
- return injectnumeric(type(v) == "table" and #v or 0)
+ -- return injectnumeric(type(v) == "table" and #v or 0)
+ return type(v) == "table" and #v or 0
end
local function getmaxparametercount()
@@ -588,7 +604,8 @@ local function getmaxparametercount()
end
end
- return injectnumeric(n)
+ -- return injectnumeric(n)
+ return n
end
local validconnectors = {
@@ -694,22 +711,24 @@ function metapost.scanparameters()
end
local registerscript = metapost.registerscript
-
-registerscript("getparameters", getparameters)
-registerscript("applyparameters", applyparameters)
-registerscript("presetparameters", presetparameters)
-registerscript("hasparameter", hasparameter)
-registerscript("hasoption", hasoption)
-registerscript("getparameter", getparameter)
-registerscript("getparameterdefault", getparameterdefault)
-registerscript("getparametercount", getparametercount)
-registerscript("getmaxparametercount",getmaxparametercount)
-registerscript("getparameterpath", getparameterpath)
-registerscript("getparameterpen", getparameterpen)
-registerscript("getparametertext", getparametertext)
---------------("getparameteroption", getparameteroption)
-registerscript("pushparameters", pushparameters)
-registerscript("popparameters", popparameters)
+local registerdirect = metapost.registerdirect
+local registertokens = metapost.registertokens
+
+registerdirect("getparameters", getparameters) -- nothing
+registertokens("applyparameters", applyparameters) -- action : todo "token"
+registerdirect("presetparameters", presetparameters) -- nothing
+registerdirect("hasparameter", hasparameter) -- boolean
+registerdirect("hasoption", hasoption) -- boolean
+registerdirect("getparameter", getparameter) -- whatever
+registerdirect("getparameterdefault", getparameterdefault) -- whatever
+registerdirect("getparametercount", getparametercount) -- numeric
+registerdirect("getmaxparametercount",getmaxparametercount) -- numeric
+registerscript("getparameterpath", getparameterpath) -- tricky
+registerscript("getparameterpen", getparameterpen) -- tricky
+registerscript("getparametertext", getparametertext) -- tricky
+--------direct("getparameteroption", getparameteroption) -- boolean
+registerdirect("pushparameters", pushparameters) -- nothing
+registerdirect("popparameters", popparameters) -- nothing
function metapost.getparameter(list)
local n = #list
@@ -735,7 +754,7 @@ end
-- goodies
-registerscript("definecolor", function()
+registerdirect("definecolor", function()
scantoken() -- we scan the semicolon
local s = get_parameters()
attributes.colors.defineprocesscolordirect(s)
diff --git a/tex/context/base/mkxl/mlib-snc.lmt b/tex/context/base/mkxl/mlib-snc.lmt
index 0d9c970a3..eddf6417a 100644
--- a/tex/context/base/mkxl/mlib-snc.lmt
+++ b/tex/context/base/mkxl/mlib-snc.lmt
@@ -7,37 +7,30 @@ if not modules then modules = { } end modules ['mlib-snc'] = {
}
local scanners = mp.scan
-local injectors = mp.inject
-
-local scannumeric = scanners.numeric
local scaninteger = scanners.integer
local scanstring = scanners.string
-local mpnumeric = injectors.numeric
-
local factor = number.dimenfactors.bp
-
local synchronizers = graphics.synchronizers
-local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
-- no need for locals (yet)
-registerscript("asnc_collect", function()
- -- category realpage region
- mpnumeric(synchronizers.collect(scaninteger(),scaninteger(),scanstring()))
+registerdirect("asnc_collect", function()
+ return synchronizers.collect(scaninteger(),scaninteger(),scanstring()) -- category realpage region
end)
-registerscript("asnc_extend", function() mpnumeric(synchronizers.extend ()) end)
-registerscript("asnc_prune", function() mpnumeric(synchronizers.prune ()) end)
-registerscript("asnc_collapse", function() mpnumeric(synchronizers.collapse()) end)
-
-registerscript("asnc_getsize", function() mpnumeric(synchronizers.getsize () ) end)
-registerscript("asnc_gettop", function() mpnumeric(synchronizers.gettop (scaninteger()) * factor) end)
-registerscript("asnc_getbottom",function() mpnumeric(synchronizers.getbottom(scaninteger()) * factor) end)
-registerscript("asnc_getkind", function() mpnumeric(synchronizers.getkind (scaninteger()) ) end)
-registerscript("asnc_gettask", function() mpnumeric(synchronizers.gettask (scaninteger()) ) end)
-
-registerscript("asnc_getx", function() mpnumeric(synchronizers.getx() * factor) end)
-registerscript("asnc_gety", function() mpnumeric(synchronizers.gety() * factor) end)
-registerscript("asnc_getw", function() mpnumeric(synchronizers.getw() * factor) end)
-registerscript("asnc_geth", function() mpnumeric(synchronizers.geth() * factor) end)
-registerscript("asnc_getd", function() mpnumeric(synchronizers.getd() * factor) end)
+registerdirect("asnc_extend", synchronizers.extend )
+registerdirect("asnc_prune", synchronizers.prune )
+registerdirect("asnc_collapse", synchronizers.collapse)
+registerdirect("asnc_getsize", synchronizers.getsize )
+
+registerdirect("asnc_gettop", function() return synchronizers.gettop (scaninteger()) * factor end)
+registerdirect("asnc_getbottom",function() return synchronizers.getbottom(scaninteger()) * factor end)
+registerdirect("asnc_getkind", function() return synchronizers.getkind (scaninteger()) end)
+registerdirect("asnc_gettask", function() return synchronizers.gettask (scaninteger()) end)
+
+registerdirect("asnc_getx", function() return synchronizers.getx() * factor end)
+registerdirect("asnc_gety", function() return synchronizers.gety() * factor end)
+registerdirect("asnc_getw", function() return synchronizers.getw() * factor end)
+registerdirect("asnc_geth", function() return synchronizers.geth() * factor end)
+registerdirect("asnc_getd", function() return synchronizers.getd() * factor end)
diff --git a/tex/context/base/mkxl/mult-aux.mkxl b/tex/context/base/mkxl/mult-aux.mkxl
index 40667e17d..017aa9d6b 100644
--- a/tex/context/base/mkxl/mult-aux.mkxl
+++ b/tex/context/base/mkxl/mult-aux.mkxl
@@ -578,7 +578,7 @@
{\let#7#3%
\ifarguments
\let#3\empty
- \the#5%
+ \the#4%
\or
\let#3\empty
\mult_interfaces_get_parameters{#1:}[##1]%
@@ -619,11 +619,11 @@
\installparametersethandler {#1}{#2}%
\installrootparameterhandler{#1}{#2}}
-\permanent\protected\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\permanent\protected\def\installbasicautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}}
-\permanent\protected\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\permanent\protected\def\installstylisticautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
@@ -1169,4 +1169,71 @@
\permanent\protected\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
+%D This is a special one, used in \METAPOST\ graphic support. It is english only because
+%D we have no multilingual interface in \METAFUN.
+
+\startinterface english
+ \let\mult_interfaces_install_native_auto_setup_handler\mult_interfaces_install_auto_setup_handler
+ \aliased\let\installbasicnativeautosetuphandler\installbasicsetuphandler
+\stopinterface
+
+\ifdefined\installnativebasicsetuphandler \else
+
+ \let\mult_interfaces_adef_yes\mult_interfaces_adef
+ \protected\def\mult_interfaces_adef_nop#1#2{\defcsname#1#2\endcsname}
+
+ \protected\def\mult_interfaces_install_native_auto_setup_handler#1#2#3#4#5#6#7#8%
+ {\newtoks#4%
+ \frozen\protected\def#5{\mult_interfaces_get_parameters{#1#3:}}%
+ \frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]%
+ {\let#7#3%
+ \ifarguments
+ \let#3\empty
+ \the#4%
+ \or
+ \let#3\empty
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1:}[##1]%
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4%
+ \or
+ \def#8####1%
+ {\edef#3{####1}%
+ #6% checks parent and sets if needed
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1#3:}[##2]%
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4}%
+ \processcommalist[##1]#8%
+ \or
+ \def#8####1%
+ {\edef#3{####1}%
+ \defcsname#1#3:\s!parent\endcsname{#1##2}%
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4}%
+ \processcommalist[##1]#8%
+ \fi
+ \let#3#7}}
+
+ \permanent\protected\def\installnativeautosetuphandler#1#2%
+ {\mutable\letcsname current#2\endcsname\empty
+ \normalexpanded
+ {\mult_interfaces_install_native_auto_setup_handler
+ {\noexpand#1}% \??aa
+ \expandafter\noexpand\csname setup#2\endcsname
+ \expandafter\noexpand\csname current#2\endcsname
+ \expandafter\noexpand\csname everysetup#2\endcsname
+ \expandafter\noexpand\csname setupcurrent#2\endcsname
+ \expandafter\noexpand\csname check#2parent\endcsname
+ \expandafter\noexpand\csname saved_setup_current#2\endcsname
+ \expandafter\noexpand\csname nested_setup_current#2\endcsname}}
+
+ \permanent\protected\def\installbasicnativeautosetuphandler#1#2%
+ {\installbasicparameterhandler {#1}{#2}%
+ \installnativeautosetuphandler{#1}{#2}}
+
+\fi
+
\protect \endinput
diff --git a/tex/context/base/mkxl/pack-obj.lmt b/tex/context/base/mkxl/pack-obj.lmt
index f021339b4..894d9e8b2 100644
--- a/tex/context/base/mkxl/pack-obj.lmt
+++ b/tex/context/base/mkxl/pack-obj.lmt
@@ -89,41 +89,6 @@ jobobjects.get = getobject
jobobjects.number = getobjectnumber
jobobjects.page = getobjectpage
--- implement {
--- name = "saveobject",
--- actions = saveobject
--- }
---
--- implement {
--- name = "setobject",
--- actions = setobject,
--- arguments = { "string", "integer", "integer" }
--- }
---
--- implement {
--- name = "objectnumber",
--- actions = { getobjectnumber, context },
--- arguments = "2 strings",
--- }
---
--- implement {
--- name = "objectpage",
--- actions = { getobjectpage, context },
--- arguments = "2 strings",
--- }
---
--- implement {
--- name = "doifelseobjectreferencefound",
--- actions = { getobject, commands.doifelse },
--- arguments = "string"
--- }
-
--- if false then
--- -- we can flush the inline ref ourselves now if we want
--- local flush = new_latelua("pdf.flushxform("..index..")")
--- flush.next = list
--- next.prev = flush
--- end
local data = table.setmetatableindex("table")
@@ -179,11 +144,11 @@ function objects.restore(ns,id) -- why not just pass a box number here too (ok,
-- list is a rule
setlink(list,page)
end
- setbox("objectbox",hbox)
- settexdimen("objectoff",offset or 0)
+ setbox("b_pack_objects",hbox)
+ settexdimen("d_pack_objects_offset",offset or 0)
else
- setbox("objectbox",nil)
- settexdimen("objectoff",0) -- for good old times
+ setbox("b_pack_objects",nil)
+ settexdimen("d_pack_objects_offset",0) -- for good old times
end
if trace then
report("restoring object %a",id)
@@ -287,10 +252,10 @@ implement {
if object then
w, h, d, o = codeinjections.boxresourcedimensions(object[1])
end
- settexdimen("objectwd",w or 0)
- settexdimen("objectht",h or 0)
- settexdimen("objectdp",d or 0)
- settexdimen("objectoff",o or #objects > 2 and object[2] or 0)
+ settexdimen("d_pack_objects_width", w or 0)
+ settexdimen("d_pack_objects_height",h or 0)
+ settexdimen("d_pack_objects_depth", d or 0)
+ settexdimen("d_pack_objects_offset",o or #objects > 2 and object[2] or 0)
end
}
diff --git a/tex/context/base/mkxl/pack-obj.mkxl b/tex/context/base/mkxl/pack-obj.mkxl
index 04fc90a58..ab42d163f 100644
--- a/tex/context/base/mkxl/pack-obj.mkxl
+++ b/tex/context/base/mkxl/pack-obj.mkxl
@@ -40,22 +40,22 @@
\installcorenamespace {objects}
\newif \ifinobject
-\newbox \objectbox
+\newbox \b_pack_objects
-\mutable\def\objectoffset{1cm}
+\mutable\def\objectoffset{1cm} % Still public but use with care!
-\newdimen\objectoff \permanent\def\objectmargin{\the\objectoff}
-\newdimen\objectwd \permanent\def\objectwidth {\the\objectwd}
-\newdimen\objectht \permanent\def\objectheight{\the\objectht}
-\newdimen\objectdp \permanent\def\objectdepth {\the\objectdp}
+\newdimen\d_pack_objects_offset \permanent\def\objectmargin{\the\d_pack_objects_offset}
+\newdimen\d_pack_objects_width \permanent\def\objectwidth {\the\d_pack_objects_width}
+\newdimen\d_pack_objects_height \permanent\def\objectheight{\the\d_pack_objects_height}
+\newdimen\d_pack_objects_depth \permanent\def\objectdepth {\the\d_pack_objects_depth}
%D If I have time I will use the unreferenced variant for e.g. mp reuse. This can be
%D rewritten in \LUA\ anyway.
-\permanent\protected\def\setreferencedobject #1#2{\begingroup\synctexpause\objectoff\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
-\permanent\protected\def\settightreferencedobject #1#2{\begingroup\synctexpause\objectoff\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
-\permanent\protected\def\setunreferencedobject #1#2{\begingroup\synctexpause\objectoff\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
-\permanent\protected\def\settightunreferencedobject#1#2{\begingroup\synctexpause\objectoff\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
+\permanent\protected\def\setreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
+\permanent\protected\def\settightreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
+\permanent\protected\def\setunreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
+\permanent\protected\def\settightunreferencedobject#1#2{\begingroup\synctexpause\d_pack_objects_offset\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
\aliased\let\setobject \setreferencedobject
\aliased\let\settightobject\settightreferencedobject
@@ -66,7 +66,7 @@
\protected\def\pack_objects_set_yes#1#2%
{\ifcase\c_pack_objects_offset_mode
- \ifzeropt\objectoff
+ \ifzeropt\d_pack_objects_offset
\pack_objects_package_nop\nextbox
\else
\pack_objects_package_yes\nextbox
@@ -74,13 +74,13 @@
\else
\pack_objects_package_nop\nextbox
\fi
- \clf_registerreferencedobject{#1}{#2}\objectbox\objectoff\c_pack_objects_offset_mode
+ \clf_registerreferencedobject{#1}{#2}\b_pack_objects\d_pack_objects_offset\c_pack_objects_offset_mode
\synctexresume
\endgroup}
\protected\def\pack_objects_set_nop#1#2%
{\ifcase\c_pack_objects_offset_mode
- \ifzeropt\objectoff
+ \ifzeropt\d_pack_objects_offset
\pack_objects_package_nop\nextbox
\else
\pack_objects_package_yes\nextbox
@@ -88,33 +88,31 @@
\else
\pack_objects_package_nop\nextbox
\fi
- \clf_registerobject{#1}{#2}\objectbox\objectoff\c_pack_objects_offset_mode
+ \clf_registerobject{#1}{#2}\b_pack_objects\d_pack_objects_offset\c_pack_objects_offset_mode
\synctexresume
\endgroup}
\def\pack_objects_package_nop#1% we pack because otherwise \ruledhbox is still tight
- {\setbox\objectbox\hpack{\box#1}}
+ {\setbox\b_pack_objects\hpack{\box#1}}
\def\pack_objects_package_yes#1%
- {\objectwd\dimexpr\wd#1+2\objectoff\relax
- \objectht\dimexpr\ht#1+ \objectoff\relax
- \objectdp\dimexpr\dp#1+ \objectoff\relax
- \setbox\objectbox\hpack
- {\hskip\objectoff
- \box#1}%
- \wd\objectbox\objectwd
- \ht\objectbox\objectht
- \dp\objectbox\objectdp}
+ {\d_pack_objects_width \dimexpr\wd#1+2\d_pack_objects_offset\relax
+ \d_pack_objects_height\dimexpr\ht#1+ \d_pack_objects_offset\relax
+ \d_pack_objects_depth \dimexpr\dp#1+ \d_pack_objects_offset\relax
+ \setbox\b_pack_objects\hpack{\hskip\d_pack_objects_offset\box#1}%
+ \wd\b_pack_objects\d_pack_objects_width
+ \ht\b_pack_objects\d_pack_objects_height
+ \dp\b_pack_objects\d_pack_objects_depth}
\permanent\protected\def\getobject#1#2%
{\begingroup
\synctexpause
\clf_restoreobject{#1}{#2}%
- \ifzeropt\objectoff\else
- \objectoff-\objectoff
- \pack_objects_package_yes\objectbox
+ \ifzeropt\d_pack_objects_offset\else
+ \d_pack_objects_offset-\d_pack_objects_offset
+ \pack_objects_package_yes\b_pack_objects
\fi
- \box\objectbox
+ \box\b_pack_objects
\synctexresume
\endgroup}
diff --git a/tex/context/base/mkxl/page-one.mkxl b/tex/context/base/mkxl/page-one.mkxl
index 9d0fb2065..a6890c8a6 100644
--- a/tex/context/base/mkxl/page-one.mkxl
+++ b/tex/context/base/mkxl/page-one.mkxl
@@ -62,7 +62,7 @@
\pushoverloadmode
\setnewconstant\kindofpagetextareas\plustwo % \plusone can become default some day
- \overloaded\mutable\let\kindofpagetextareas\kindofpagetextareas % fo rnow mutable, can become a key/value
+ \overloaded\mutable\let\kindofpagetextareas\kindofpagetextareas % for now mutable, can become a key/value
\popoverloadmode
\def\page_one_registered_text_area_a % two arguments: (un)vbox n
diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl
index fb85531b7..d4ffccb9b 100644
--- a/tex/context/base/mkxl/syst-ini.mkxl
+++ b/tex/context/base/mkxl/syst-ini.mkxl
@@ -681,7 +681,7 @@
\tracingrestores \plusone
\tracinggroups \plusone
\tracingifs \plusone
- \tracingnesting \plustwo
+ \tracingnesting \plusthree
\tracingassigns \plustwo
\tracingmath \plusone
\tracingalignments\plusone
diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml
index 3a1e64452..031a715e6 100644
--- a/tex/context/interface/mkii/keys-fr.xml
+++ b/tex/context/interface/mkii/keys-fr.xml
@@ -767,6 +767,7 @@
<cd:constant name='coupling' value='couplage'/>
<cd:constant name='couplingway' value='faconcouplage'/>
<cd:constant name='criterium' value='critere'/>
+ <cd:constant name='crop' value='recadre'/>
<cd:constant name='cropoffset' value='decalagerecadre'/>
<cd:constant name='crossreference' value='renvoi'/>
<cd:constant name='cssfile' value='fichiercss'/>
diff --git a/tex/context/modules/mkiv/m-steps.mkvi b/tex/context/modules/mkiv/m-steps.mkvi
index fb2000d40..b6ebfac6b 100644
--- a/tex/context/modules/mkiv/m-steps.mkvi
+++ b/tex/context/modules/mkiv/m-steps.mkvi
@@ -33,10 +33,10 @@
\installcorenamespace {steptexts}
\installcorenamespace {steplines}
-\installstylisticautosetuphandler \??stepcharts {STEPchart} \??stepcharts
-\installstylisticautosetuphandler \??stepcells {STEPcell} \??stepcells
-\installstylisticautosetuphandler \??steptexts {STEPtext} \??steptexts
-\installstylisticautosetuphandler \??steplines {STEPline} \??steplines
+\installstylisticautosetuphandler \??stepcharts {STEPchart}
+\installstylisticautosetuphandler \??stepcells {STEPcell}
+\installstylisticautosetuphandler \??steptexts {STEPtext}
+\installstylisticautosetuphandler \??steplines {STEPline}
\let\setupSTEPcharts\setupSTEPchart
\let\setupSTEPtables\setupSTEPchart % one can define categories so no need
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 09fb9e955..b642df123 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2021-04-29 23:04
+-- merge date : 2021-05-05 19:22
do -- begin closure to overcome local limits and interference