summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.properties28
-rw-r--r--doc/context/documents/general/fonts/fonts-mkiv.pdfbin1256587 -> 1212138 bytes
-rw-r--r--doc/context/documents/general/manuals/charts-mkiv.pdfbin0 -> 144089 bytes
-rw-r--r--doc/context/documents/general/manuals/luatex.pdfbin1041845 -> 1042288 bytes
-rw-r--r--doc/context/documents/general/manuals/mreadme.pdfbin41455 -> 41444 bytes
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-math.tex24
-rw-r--r--doc/context/sources/general/manuals/charts/charts-mkiv.tex1339
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-math.tex24
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex.tex2
-rw-r--r--doc/context/sources/general/manuals/mcommon.tex2
-rw-r--r--metapost/context/base/mpiv/mp-asnc.mpiv2
-rw-r--r--metapost/context/base/mpiv/mp-char.mpiv15
-rw-r--r--metapost/context/base/mpiv/mp-idea.mpiv14
-rw-r--r--metapost/context/base/mpiv/mp-luas.mpiv4
-rw-r--r--metapost/context/base/mpiv/mp-tool.mpiv3
-rw-r--r--tex/context/base/context-version.pdfbin4253 -> 4259 bytes
-rw-r--r--tex/context/base/mkiv/back-exp.lua98
-rw-r--r--tex/context/base/mkiv/back-ini.lua19
-rw-r--r--tex/context/base/mkiv/char-tex.lua3
-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/font-dsp.lua3
-rw-r--r--tex/context/base/mkiv/font-pre.mkiv2
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua4
-rw-r--r--tex/context/base/mkiv/lpdf-xmp.lua11
-rw-r--r--tex/context/base/mkiv/math-ali.mkiv34
-rw-r--r--tex/context/base/mkiv/mult-fun.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin9305 -> 9189 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin368824 -> 368972 bytes
-rw-r--r--tex/context/base/mkiv/typo-krn.lua15
-rw-r--r--tex/context/interface/mkiv/i-chart.xml217
-rw-r--r--tex/context/interface/mkiv/i-chemical.xml2
-rw-r--r--tex/context/interface/mkiv/i-common-value.xml9
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin775837 -> 757849 bytes
-rw-r--r--tex/context/interface/mkiv/i-framed.xml4
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60790 -> 60794 bytes
-rw-r--r--tex/context/modules/mkiv/m-chart.lua120
-rw-r--r--tex/context/modules/mkiv/m-chart.mkvi62
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua4
40 files changed, 1881 insertions, 191 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 e707e9d3e..089ce747a 100644
--- a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
+++ b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua
@@ -1,4 +1,4 @@
return {
- ["commands"]={ "transparency", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "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", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "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", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize" },
+ ["commands"]={ "transparency", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "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", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "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", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "format", "formatted", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize" },
["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "metapostversion", "maxdimensions", "drawoptionsfactor" },
} \ No newline at end of file
diff --git a/context/data/scite/context/scite-context-data-metafun.properties b/context/data/scite/context/scite-context-data-metafun.properties
index 94387df64..eea41f9e5 100644
--- a/context/data/scite/context/scite-context-data-metafun.properties
+++ b/context/data/scite/context/scite-context-data-metafun.properties
@@ -41,20 +41,20 @@ anchored originpath infinite break xstretched \
ystretched snapped pathconnectors function constructedfunction \
constructedpath constructedpairs straightfunction straightpath straightpairs \
curvedfunction curvedpath curvedpairs evenly oddly \
-condition pushcurrentpicture popcurrentpicture arrowpath tensecircle \
-roundedsquare colortype whitecolor blackcolor basiccolors \
-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 decorated redecorated undecorated passvariable \
-passarrayvariable tostring format formatted startpassingvariable \
-stoppassingvariable eofill eoclip nofill fillup \
-eofillup area addbackground shadedup shadeddown \
-shadedleft shadedright sortlist copylist shapedlist \
-listtocurves listtolines listsize
+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 decorated redecorated undecorated \
+passvariable passarrayvariable tostring format formatted \
+startpassingvariable stoppassingvariable eofill eoclip nofill \
+fillup eofillup area addbackground shadedup \
+shadeddown shadedleft shadedright sortlist copylist \
+shapedlist listtocurves listtolines listsize
keywordclass.metafun.internals=\
nocolormodel greycolormodel graycolormodel rgbcolormodel \
diff --git a/doc/context/documents/general/fonts/fonts-mkiv.pdf b/doc/context/documents/general/fonts/fonts-mkiv.pdf
index 4cc8b07e6..2618dd563 100644
--- a/doc/context/documents/general/fonts/fonts-mkiv.pdf
+++ b/doc/context/documents/general/fonts/fonts-mkiv.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/charts-mkiv.pdf b/doc/context/documents/general/manuals/charts-mkiv.pdf
new file mode 100644
index 000000000..14ad492a1
--- /dev/null
+++ b/doc/context/documents/general/manuals/charts-mkiv.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf
index 43bd3905f..eba3d9c33 100644
--- a/doc/context/documents/general/manuals/luatex.pdf
+++ b/doc/context/documents/general/manuals/luatex.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/mreadme.pdf b/doc/context/documents/general/manuals/mreadme.pdf
index 031be0fda..36d31f277 100644
--- a/doc/context/documents/general/manuals/mreadme.pdf
+++ b/doc/context/documents/general/manuals/mreadme.pdf
Binary files differ
diff --git a/doc/context/sources/general/fonts/fonts/fonts-math.tex b/doc/context/sources/general/fonts/fonts/fonts-math.tex
index b9cadceeb..2d7d26dfb 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-math.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-math.tex
@@ -996,9 +996,12 @@ The results are collected here:
\startsection[title=Italics and limits]
An \OPENTYPE\ font treats italic correction differently from traditional fonts.
-For that reason we provide a bit of control over the way the correction is
-applied. There is a parameter \type {\mathnolimitsmode} that controls the
-correction.
+Officially the italic correction is used for placement above and below limits
+where the scripts shift left and right half of the correction from the center of
+the shape. Advanced kerns are then to be used for anchoring the scripts when they
+are placed at the right side (so far no fonts seem to do this). Because we cannot
+foresee if fonts compensate for correction then we can control placement a bit.
+There is a parameter \type {\mathnolimitsmode} that controls the correction.
\definebodyfontenvironment[20pt]
@@ -1013,14 +1016,17 @@ correction.
\stoplinecorrection
A value larger than 15 is interpreted as a factor (in the usual \TEX\ way 1000
-means 1.0). In \CONTEXT\ we set the value to 1 which means that the factors for
-super- and subscript are set via math parameters (or constants in the font). We
-use a default of \type {{0,750}} so we don't shift the superscript and the
-subscript we shift less than the italic correction. This is driven by a feature
-but you can change the values before loading a font, for instance with:
+means 1.0). We have some values left for future use when correction is to be
+combined with kerns.
+
+In \CONTEXT\ we set the value to 1 which means that the factors for super- and
+subscript are set via math parameters (or constants in the font). We use a
+default of \type {{0,800}} so we don't shift the superscript and the subscript we
+shift less than the italic correction. This is driven by a feature but you can
+change the values before loading a font, for instance with:
\starttyping
-\adaptfontfeature[*math*][mathnolimitsmode={100,800}]
+\adaptfontfeature[*math*][mathnolimitsmode={100,700}]
\stoptyping
The defaults come out as:
diff --git a/doc/context/sources/general/manuals/charts/charts-mkiv.tex b/doc/context/sources/general/manuals/charts/charts-mkiv.tex
new file mode 100644
index 000000000..dbf6ef6c8
--- /dev/null
+++ b/doc/context/sources/general/manuals/charts/charts-mkiv.tex
@@ -0,0 +1,1339 @@
+% interface=en engine=luatex language=uk
+
+% author : Hans Hagen
+% copyright : PRAGMA ADE & ConTeXt Development Team
+% license : Creative Commons Attribution ShareAlike 4.0 International
+% reference : pragma-ade.nl | contextgarden.net | texlive (related) distributions
+% origin : the ConTeXt distribution
+%
+% comment : Because this manual is distributed with TeX distributions it comes with a rather
+% liberal license. We try to adapt these documents to upgrades in the (sub)systems
+% that they describe. Using parts of the content otherwise can therefore conflict
+% with existing functionality and we cannot be held responsible for that. Many of
+% the manuals contain characteristic graphics and personal notes or examples that
+% make no sense when used out-of-context.
+
+% somewhat general (derived from mcommon.tex)
+
+\usemodule[abr-02]
+
+\usemodule[setups-basics] \loadsetups[i-chart.xml]
+
+\setupexternalfigures
+ [location={local,default}]
+
+\setuplayout
+ [topspace=15mm,
+ header=15mm,
+ headerdistance=0mm,
+ footer=0cm,
+ width=middle,
+ height=middle]
+
+\setuppagenumbering
+ [alternative=doublesided]
+
+\definetypeface [mainface] [rm] [serif] [pagella] [default]
+\definetypeface [mainface] [ss] [sans] [heros] [default] % [rscale=1.1]
+\definetypeface [mainface] [tt] [mono] [modern] [default] % [rscale=1.1]
+\definetypeface [mainface] [mm] [math] [pagella] [default]
+
+\setupbodyfont[mainface,12pt]
+
+% \definecolor[maincolor][r=.4,g=.2,b=.6]
+\definecolor[maincolor][r=.2,g=.1,b=.3]
+
+\setupwhitespace
+ [big]
+
+\setuptolerance
+ [verytolerant,stretch]
+
+\setuptype
+ [color=maincolor]
+
+\setuptyping
+ [color=maincolor]
+
+\setuphead
+ [section]
+ [style=\bfb,
+ color=maincolor]
+
+\setupinteraction
+ [state=start,
+ color=,
+ contrastcolor=,
+ style=]
+
+\startsetups titlepage
+ \startpagemakeup[doublesided=no,page=no]
+ \useMPgraphic{titlepage}
+ \stoppagemakeup
+ \startstandardmakeup[doublesided=no,page=no]
+ \vfill
+ \startsubject[title=Contents]
+ \startcolumns[distance=4em]
+ \placelist[section][alternative=c,width=2em]
+ \stopcolumns
+ \stopsubject
+ \stopstandardmakeup
+\stopsetups
+
+\startsetups colofon
+ \blank[2*big]
+ \testpage[3]
+ \startpacked
+ \documentvariable{author}\par
+ \documentvariable{affiliation}\par
+ \documentvariable{location}\par
+ \stoppacked
+\stopsetups
+
+\setupdocument
+ [title=No Title,
+ before=\setups{titlepage},
+ after=\setups{colofon}]
+
+% specific for this document
+
+\usemodule[chart]
+
+\setupFLOWcharts
+ [width=2.25cm,
+ height=1.25cm,
+ dx=.25cm,
+ dy=.25cm]
+
+\startuseMPgraphic{titlepage}
+ numeric width, height, delta ;
+ color a, b, c, d ;
+
+ width := PaperWidth ;
+ height := PaperHeight ;
+ delta := width/10 ;
+ ahlength := 6delta ;
+
+ a := white/2 ;
+ b := white/3 ;
+ c := resolvedcolor ("maincolor") ;
+ d := c ;
+
+ path p ; p := unitsquare xscaled width yscaled height ;
+
+ fill p withcolor c ;
+
+ drawarrow llcorner p -- urcorner p withpen pencircle scaled (3.0delta) withcolor a ;
+ draw llcorner p -- urcorner p withpen pencircle scaled (4.0delta) withcolor a ;
+ drawarrow urcorner p -- llcorner p withpen pencircle scaled (2.5delta) withcolor b ;
+ draw llcorner p -- urcorner p withpen pencircle scaled (3.0delta) withcolor b ;
+ drawarrow llcorner p -- urcorner p withpen pencircle scaled (2.0delta) withcolor d ;
+ drawarrow urcorner p -- llcorner p withpen pencircle scaled (1.5delta) withcolor d ;
+
+ draw anchored.lrt(
+ textext("\ss\bf \documentvariable{title}") rotated 90 xsized (3delta/4),
+ lrcorner p shifted (-delta,3delta/4)
+ ) withcolor white ;
+
+ resetarrows ;
+
+ setbounds currentpicture to p ;
+\stopuseMPgraphic
+
+\startdocument
+ [title=Flowcharts,
+ author= Hans Hagen,
+ affiliation=PRAGMA ADE,
+ location=Hasselt NL]
+
+\startsection[reference=introduction,title={Introduction}]
+
+This is just another story of \TEX\ meeting \METAPOST. This time we will focus on
+charts, especially flowcharts. In \CONTEXT\ flowchart support is not part of the
+core functionality, but is provided as a module. Therefore, before you can
+actually define a chart, this module must be loaded:
+
+\starttyping
+\usemodule[chart]
+\stoptyping
+
+Once loaded, you has access to the functionality described here. Before we go
+into detail on the features, we will say some words on history.
+
+When dealing with graphics, it makes sense to use a drawing program. In fact,
+before we started using this module, we did use such programs, and they have
+without doubt their advantages. As soon as \CONTEXT\ supported interactive
+documents, there were means to make graphics interactive, and as long as only a
+few graphics are involved, this mechanism works ok.
+
+And then we suddenly had to make a document with thousands of pages and hundreds
+of often rather complicated flowcharts. Because these charts were tightly
+integrated in the main document, they not only had to be consistent in the use of
+fonts, but also had to be interactive and were to be presented both as a whole
+and in subchart parts. We wanted fonts, colors and the overall appearance as well
+as names of people, places, steps, activities and more to be consistent,
+especially because these charts are constantly updated.
+
+I use the term flowchart here because I want to stress that this module typesets
+charts which cells are connected by lines (often arrows). Our first application
+of this module concerned diagrams that expressed actions and relations between
+those actions, using some techniques originating years ago in programming
+environments: lines were not to cross, one should read from top to bottom and
+left to right, etc. However, the module presented here can be used to draw all
+kind of charts, and all kind of connections. But there are limits.
+
+{\em This manual is mostly the one written of end 1998 when the flowchart module
+showed up in the distribution. In the meantime the code has been rewritten for
+\MKIV\ and some functionality is adapted. But the interface hasn't changed much.}
+
+\stopsection
+
+\startsection[title={The grid}]
+
+A flowchart consists of shapes, positioned on a grid, connected by lines. The
+grid enables the user to anchor the shapes and enables the drawing routines to
+determine connections. One can either explicitly specify the grid, or let it be
+calculated automatically.
+
+\startbuffer[grid]
+\setupFLOWcharts
+ [option=test,
+ nx=4,
+ ny=3,
+ dx=\bodyfontsize,
+ dy=\bodyfontsize,
+ width=6\bodyfontsize,
+ height=4\bodyfontsize,
+ maxwidth=\textwidth]
+
+\startFLOWchart [grid]
+\stopFLOWchart
+\stopbuffer
+
+\placefigure
+ [here][fig:grid]
+ {The grid.}
+ {\getbuffer[grid]\FLOWchart[grid]}
+
+Normally the grid is not visible, unless one enters test mode. The grid in \in
+{figure} [fig:grid] is the result of the definition:
+
+\typebuffer[grid]
+
+The most straightforward way of calling up this chart is by saying:
+
+\starttyping
+\FLOWchart[grid]
+\stoptyping
+
+In \in {figure} [fig:grid] we see a grid an dwithin each cell a shape. Normally
+shapes are smaller than grid cells. This is necessary because connecting lines
+need some room. The offset is important, because when a connection follows the
+outer lines, a little extra space outside that line not only looks better, but
+also prevents the line from being clipped. It makes sense to keep the offset as
+well as the space between shapes constant across a document. The numbers are
+typeset outside the bounding box of the figure.
+
+Grid cells are numbered from top to bottom starting at the left side, so the left
+topmost cell is $(1,1)$. Later we will see that because cells have names, these
+numbers play a minor role.
+
+\stopsection
+
+\startsection[title={Shapes}]
+
+A shape is something, typically a text, within a frame. The frame has certain
+dimensions and can have some color and background. In this respect it looks like
+the \CONTEXT\ command \type {\framed}. The most important shapes have been
+assigned names as indicated in \in {figure} [fig:shapes]. There are more shapes,
+but they are identified by a number only. The total number of shapes will quite
+certainly increase. The shapes {\em up}, {\em down}, {\em left} and {\em right}
+are not really shapes, but lines that can be used to force a direction.
+
+\startFLOWchart [shapes]
+\startFLOWcell \name{a} \location{1,1} \shape{node} \text{node} \stopFLOWcell
+\startFLOWcell \name{b} \location{2,1} \shape{action} \text{action} \stopFLOWcell
+\startFLOWcell \name{c} \location{3,1} \shape{procedure} \text{procedure} \stopFLOWcell
+\startFLOWcell \name{d} \location{4,1} \shape{product} \text{product} \stopFLOWcell
+\startFLOWcell \name{e} \location{1,2} \shape{decision} \text{decision} \stopFLOWcell
+\startFLOWcell \name{f} \location{2,2} \shape{archive} \text{archive} \stopFLOWcell
+\startFLOWcell \name{g} \location{3,2} \shape{loop} \text{loop} \stopFLOWcell
+\startFLOWcell \name{h} \location{4,2} \shape{wait} \text{wait} \stopFLOWcell
+\startFLOWcell \name{i} \location{1,3} \shape{subprocedure} \text{sub procedure} \stopFLOWcell
+\startFLOWcell \name{j} \location{2,3} \shape{singledocument} \text{single document} \stopFLOWcell
+\startFLOWcell \name{k} \location{3,3} \shape{multidocument} \text{multi document} \stopFLOWcell
+
+\startFLOWcell \name{l} \location{1,4} \shape{right} \text{right} \stopFLOWcell
+\startFLOWcell \name{m} \location{2,4} \shape{left} \text{left} \stopFLOWcell
+\startFLOWcell \name{n} \location{3,4} \shape{up} \text{up} \stopFLOWcell
+\startFLOWcell \name{o} \location{4,4} \shape{down} \text{down} \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:shapes]
+ {The shapes.}
+ {\tx\FLOWchart[shapes]}
+
+When no shape is specified, the default shape is used. One can change this
+default value with the \type {\setupFLOWshapes} command.
+
+\startbuffer[cells]
+\startFLOWchart [cells]
+ \startFLOWcell
+ \name {first}
+ \location {1,1}
+ \shape {singledocument}
+ \text {not realy a document}
+ \stopFLOWcell
+\stopFLOWchart
+\stopbuffer
+
+\typebuffer[cells]
+
+\getbuffer[cells]
+
+A flow chart consists of cells. Each cell has a name, is positioned somewhere on
+the grid, has a certain shape, and normally this shape surrounds text. The shape
+is drawn by \METAPOST, and the text is placed by \TEX. Later we will see that
+there are some more fields to fill. Names are local to a chart.
+
+\placefigure
+ [][fig:cells]
+ {}{\tx\FLOWchart[cells]}
+
+\stopsection
+
+\startsection[title={Connections}]
+
+Shapes can be connected. As shown in \in {figure} [fig:points] each shape has
+four connection points: top, bottom, left and right. When connecting shapes we
+refer to their logical names and specify two of the four directions.
+
+\startFLOWchart [points]
+\startFLOWcell \name{a} \location{1,1} \shape{procedure} \stopFLOWcell
+\startFLOWcell \name{b} \location{2,1} \shape{product} \stopFLOWcell
+\startFLOWcell \name{c} \location{3,1} \shape{archive} \stopFLOWcell
+\startFLOWcell \name{d} \location{4,1} \shape{multidocument} \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:points]
+ {The connection points.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[points]}
+
+In \in {figure} [fig:connect] we see three connections. The lines have smooth
+curves and run across the grid lines. By using smooth curves, an option that can
+be turned off, the direction of touching curves is always clear. Here we use
+arrows. Smoothing, arrows and dashed lines are some of the attributes of lines.
+
+\startFLOWchart [connect]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {procedure}
+ \text {first}
+ \connection [rl] {beta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,1}
+ \shape {product}
+ \text {second}
+ \connection [bl] {alpha}
+ \connection [rl] {gamma}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {gamma}
+ \location {3,1}
+ \shape {action}
+ \text {third}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:connect]
+ {A few connections.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[connect]}
+
+\startFLOWchart [two]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {action}
+ \text {first}
+ \connection [rl] {beta}
+ \connection [rl] {alpha}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,1}
+ \shape {loop}
+ \text {second}
+ \connection [tr] {beta}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ {A few more connections.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[two]}
+
+There can be more than one connection per shape. When defining such a connection
+we first specify the direction. In this example \type {[rl]} means connect the
+right point to the left one, while \type {[tr]} results in a connection between
+the top and the right point. The second argument specifies the shape to connect
+to. As we can see, connections can point back to their origin shape.
+
+\startFLOWchart [around]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {procedure}
+ \text {first}
+ \connection [rl] {gamma}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,1}
+ \shape {product}
+ \text {second}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {gamma}
+ \location {3,1}
+ \shape {action}
+ \text {third}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:around]
+ {Going around shapes.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[around]}
+
+\startFLOWchart [straight]
+ \startFLOWcell
+ \name {alpha}
+ \location {2,1}
+ \shape {procedure}
+ \text {first}
+ \connection [lt] {gamma}
+ \connection [rt] {delta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {3,1}
+ \shape {product}
+ \text {second}
+ \connection [tl] {gamma}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {gamma}
+ \location {1,2}
+ \shape {action}
+ \text {third}
+ \connection [rr] {delta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {delta}
+ \location {3,2}
+ \shape {archive}
+ \text {fourth}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:straight]
+ {Following grid lines.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[straight]}
+
+The connection drawing routines have a rather strong urge to follow grid lines.
+\in {Figure} [fig:straight] demonstrates this several times. From the first shape
+to the third one, we see that the connection takes the shortest route possible
+without crossing other shapes. I have to admit that the routines in themselves
+are rather stupid, but for normal use they suffice.
+
+\startFLOWchart [straightagain]
+ \startFLOWcell
+ \name {alpha}
+ \location {2,1}
+ \shape {procedure}
+ \text {first}
+ \connection [lt] {gamma}
+ \connection [rt] {delta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {3,1}
+ \shape {product}
+ \text {second}
+ \connection [tl] {gamma}
+ \connection [tt] {alpha}
+ \connection [bt] {delta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {gamma}
+ \location {1,2}
+ \shape {action}
+ \text {third}
+ \connection [rr] {delta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {delta}
+ \location {3,2}
+ \shape {archive}
+ \text {fourth}
+ \connection [bb] {gamma}
+ \stopFLOWcell
+\stopFLOWchart
+
+Generally speaking, when two lines end at the same point, it makes sense to
+connect these. When on the other hand lines originate at the same point or cross
+eachother, readers can get confused. Therefore such lines are drawn in such a way
+that they don't touch. In this respect, \in {figure} [fig:white] demonstrates a
+less than optimal chart.
+
+\placefigure
+ [here][fig:white]
+ {Confusing (crossing) grid lines.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[straightagain]}
+
+\stopsection
+
+\startsection[title={Adding text}]
+
+In \in {figure} [fig:comment] we have added some comment to a connection. Like
+the dots at the connections, the point halfway the connection shows up in a
+special debugging mode. The comment will be placed relative to this point. In \in
+{figure} [fig:comment] this is to the left of the point.
+
+\startFLOWchart [comment]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {action}
+ \text {here}
+ \connection [bl] {beta}
+ \comment [l] {from here to there}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,2}
+ \shape {action}
+ \text {there}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:comment]
+ {Comment to connections.}
+ {\tx\setupFLOWcharts[dot=mid]\FLOWchart[comment]}
+
+It will be no surprise that a comment is defined using \type {\comment}. Comments
+can be anchored to eight locations, simply \type {l}, \type {r}, \type {t}, \type
+{b}, or a combination like \type {tr}.
+
+\starttyping
+\startFLOWcell
+ ...
+ \comment [l] {from here to there}
+ ...
+\stopFLOWcell
+\stoptyping
+
+\startFLOWchart [labels]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {action}
+ \text {here}
+ \connection [bl] {beta}
+ \label [b] {from here}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,2}
+ \shape {action}
+ \text {there}
+ \label [l] {to there}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:labels]
+ {Labels to connection points.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[labels]}
+
+We can also put labels at the connection points. Often this is preferred over
+comment halfway along a connection. Like comments, labels have a dedicated
+command. Here we specify the connection point \type {l}, \type {r}, \type {t} or
+\type {b}.
+
+\starttyping
+\startFLOWcell
+ ...
+ \label [l] {to there}
+ ...
+\stopFLOWcell
+\stoptyping
+
+\startFLOWchart [text]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {action}
+ \text {here}
+ \connection [bl] {beta}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,2}
+ \shape {action}
+ \text {there}
+ \stopFLOWcell
+ \startFLOWcell
+ \shape {none}
+ \location {2,1}
+ \text {Is there any reason to go
+ from here to there?}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:text]
+ {Text without shapes.}
+ {\tx\setupFLOWcharts[dot=con]\FLOWchart[text]}
+
+In \in {figure} [fig:text] we see some text without any shapes around it. When
+shape \type {none} is specified, the whole shape area is available for text.
+
+\starttyping
+\startFLOWcell
+ \shape {none}
+ \location {2,1}
+ \text {Is there any reason to go
+ from here to there?}
+\stopFLOWcell
+\stoptyping
+
+One can force the alignment with the key characters \type {l}, \type {r}, \type
+{c}, \type {t} and \type {b}. So, the next definition only places text.
+
+\stopsection
+
+\startsection[title={Inheritance}]
+
+When explaining something by using a chart, we often show successive versions of
+the chart, where each version adds a new feature. To prevent us from retyping the
+same components again and again, it helps to partition the source code of the
+complete chart into subcharts. Inclusion of a part is straightforward: the
+subchart is called by name and positioned on the grid.
+
+\startbuffer[include]
+\startFLOWchart [include]
+
+ \includeFLOWchart[labels][x=1,y=1]
+
+ \startFLOWcell
+ \shape {none}
+ \location {2,1}
+ \text {There is no reason to go
+ from here to there!}
+ \stopFLOWcell
+
+\stopFLOWchart
+\stopbuffer
+
+\typebuffer[include]
+
+The included sub chart has its own reference point, so one does not have to
+bother about positions.
+
+\getbuffer[include]
+
+\placefigure
+ [here][fig:include]
+ {Sharing components.}
+ {\tx\FLOWchart[include]}
+
+\stopsection
+
+\startsection[title={How it works}]
+
+The charting module, loaded by \type {\usemodule[chart]} is only responsible for
+the \TEX\ part of the job, which means positioning text and graphics generated by
+\METAPOST. The grid, shape and connection drawing routines are grouped together
+in a dedicated \METAPOST\ module.
+
+Because of the mix of \TEX\ and \METAPOST, and because we want to be able to
+scale charts, the buffer mechanism is used. The communication between \TEX\ and
+\METAPOST\ uses the \METAPOST\ embedding macros that are native to \CONTEXT.
+Additional communication from \METAPOST\ to \CONTEXT\ is handled in the module
+itself. This rather fuzzy description is visualized in \in {figure}
+[fig:process]. Depending on the general color settings, among the other processes
+involved are: color conversion and|/|or reduction to grayscales, and conversion
+to \PDF. When watching this module in action, don't feel disturbed by the many
+steps involved.
+
+\startFLOWchart [process]
+ \startFLOWcell
+ \name {user file}
+ \location {1,2}
+ \shape {action}
+ \text {User File}
+ \connection [rl] {context}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {context}
+ \location {2,2}
+ \shape {action}
+ \text {\CONTEXT}
+ \connection [nrnl] {buffer}
+ \connection [prl] {metapost}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {buffer}
+ \location {3,2}
+ \shape {action}
+ \text {scalable buffer}
+ \connection [nlnr] {context}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {metapost}
+ \location {4,2}
+ \shape {action}
+ \text {\METAPOST}
+ \connection [rr] {graphic}
+ \connection [rr] {datafile}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {graphic}
+ \location {4,1}
+ \shape {action}
+ \text {\POSTSCRIPT}
+ \connection [lt] {context}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {datafile}
+ \location {4,3}
+ \shape {action}
+ \text {Data File}
+ \connection [lb] {context}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:process]
+ {The process.}
+ {\tx\FLOWchart[process]}
+
+\startbuffer[collection]
+\startFLOWchart [collection]
+ \dorecurse{10}
+ {\dorecurse{8}
+ {\scratchcounter=\numexpr\numexpr##1-1\relax*10+#1\relax
+ \startFLOWcell
+ \name {#1-##1}
+ \location {#1,##1}
+ \shape {\the\scratchcounter}
+ \normalexpanded{\label[bc]{\hbox{\tt\the\scratchcounter}}}
+ \stopFLOWcell}}
+\stopFLOWchart
+
+\setupFLOWcharts
+ [width=.08\textwidth,
+ height=.06\textwidth,
+ dx=.01\textwidth,
+ dy=.02\textwidth,
+ linewidth=1pt,
+ dot=yes]
+
+\FLOWchart[collection]
+\stopbuffer
+
+A few pages back we introduced the named shapes. There are however some more
+shapes. Each shape is identified by a number. In \in {figure} [fig:collection]
+all currently available shapes are shown. The zero numbered shape is actually a
+shape, but with zero dimensions. It can be used as a meeting point for lines. The
+unused numbers can be used for new shapes. The maximum number of shapes is
+limited to 4095, which is a \METAPOST\ limitation.
+
+\placefigure
+ [here][fig:collection]
+ {All shapes by number. Shape 0 is valid and has zero dimensions.}
+ {\tx\getbuffer[collection]}
+
+\stopsection
+
+\startsection[title={Bonus points}]
+
+Sometimes charts can become rather large, due to the many shapes used or lines
+drawn. At the same time charts can become unclear because more than one
+connection starts or ends at a shape. \in {Figure} [fig:bonus 1] shows a way out
+of this situation.
+
+\startFLOWchart [bonus 1]
+ \startFLOWcell
+ \name {tex}
+ \location {1,1}
+ \shape {action}
+ \text {\TEX}
+ \connection [prpl] {pdf}
+ \connection [nrnl] {dvi}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {dvi}
+ \location {2,1}
+ \shape {action}
+ \text {\DVI}
+ \connection [prpl] {ps}
+ \connection [nrr] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {ps}
+ \location {3,1}
+ \shape {action}
+ \text {\POSTSCRIPT}
+ \connection [rnl] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {pdf}
+ \location {4,1}
+ \shape {action}
+ \text {\PDF}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:bonus 1]
+ {Even more points.}
+ {\tx\setupFLOWcharts[dot=all]\FLOWchart[bonus 1]}
+
+\startFLOWchart [bonus 2]
+ \startFLOWcell
+ \name {tex}
+ \location {1,1}
+ \shape {action}
+ \text {\TEX}
+ \connection [bt] {pdf}
+ \connection [rl] {dvi}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {dvi}
+ \location {2,1}
+ \shape {action}
+ \text {\DVI}
+ \connection [rl] {ps}
+ \connection [br] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {ps}
+ \location {3,1}
+ \shape {action}
+ \text {\POSTSCRIPT}
+ \connection [br] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {pdf}
+ \location {1,2}
+ \shape {action}
+ \text {\PDF}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:bonus 2]
+ {An alternative for \in {figure}[fig:bonus 1].}
+ {\tx\FLOWchart[bonus 2]}
+
+\startFLOWchart [bonus 3]
+ \startFLOWcell
+ \name {tex}
+ \location {1,1}
+ \shape {action}
+ \text {\TEX}
+ \connection [bb] {pdf}
+ \connection [rl] {dvi}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {dvi}
+ \location {2,1}
+ \shape {action}
+ \text {\DVI}
+ \connection [rl] {ps}
+ \connection [tt] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {ps}
+ \location {3,1}
+ \shape {action}
+ \text {\POSTSCRIPT}
+ \connection [rl] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {pdf}
+ \location {4,1}
+ \shape {action}
+ \text {\PDF}
+ \stopFLOWcell
+\stopFLOWchart
+
+\placefigure
+ [here][fig:bonus 3]
+ {Yet another alternative for \in {figure}[fig:bonus 1].}
+ {\tx\FLOWchart[bonus 3]}
+
+Defining such a chart is not so much harder than previous cases. Each left,
+right, top and bottom point has two companion points: positive and negative. In
+connections the left points are: \type {pl}, \type {l} and \type {nl}: positive
+left, left and negative left, so the first cell in \in {figure} [fig:bonus 1] is
+defined as:
+
+\starttyping
+\startFLOWcell
+ \name {tex}
+ \location {1,1}
+ \shape {action}
+ \text {\TEX}
+ \connection [prpl] {pdf}
+ \connection [nrnl] {dvi}
+\stopFLOWcell
+\stoptyping
+
+Alternatively to \type {p} and \type {n} one may use \type {+} and \type {-}. As
+soon as the positive and negative points are used, the connection drawing
+routines will take into account the fact that they are off||center. This does not
+free users from thinking about better ways to draw such a chart.
+
+\stopsection
+
+\startsection[title={Clip and focus}]
+
+The flowcharter automatically calculates the size of the grid. When needed, one
+can force the dimensions and/or clip pieces of a chart. \in {Figure}
+[fig:clipped] shows such a clip. This example also shows why the offset, the
+small area around the outer grid lines, is important. \in {Figure} [fig:clipped]
+was produced while the next settings were in action.
+
+\startbuffer[clip]
+\setupFLOWcharts
+ [x=1,y=1,nx=2,ny=1]
+\stopbuffer
+
+\typebuffer[clip]
+
+\placefigure
+ [here][fig:clipped]
+ {Clipping a piece of a chart.}
+ {\tx\getbuffer[clip]\FLOWchart[connect]}
+
+Sometimes, for instance when explaining a chart, it makes sense to emphasize one
+or more particular cells. Therefore this module offers the ability to focus on
+cells. In \in {figure} [fig:focus] we see that the focus is on the cell with name
+\type {dvi}. This is accomplished by saying:
+
+\startbuffer
+\setupFLOWfocus
+ [framecolor=pragmacolor]
+\setupFLOWcharts
+ [focus=dvi]
+\stopbuffer
+
+\typebuffer
+
+\placefigure
+ [here][fig:focus]
+ {Gaining some focus.}
+ {\tx\getbuffer\FLOWchart[bonus 3]}
+
+Clipping and focus bring us to the third way of zooming in: autofocus. \in
+{Figure} [fig:autofocus] shows what happens when we say:
+
+\startbuffer
+\setupFLOWfocus
+ [framecolor=pragmacolor]
+\setupFLOWcharts
+ [focus=dvi,autofocus=dvi,
+ nx=1,ny=1]
+
+\startFLOWchart [bonus 3]
+ \startFLOWcell
+ \name {tex}
+ \location {1,1}
+ \shape {action}
+ \text {\TEX}
+ \connection [rl] {pdf}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {pdf}
+ \location {4,1}
+ \shape {action}
+ \text {\PDF}
+ \stopFLOWcell
+\stopFLOWchart
+\stopbuffer
+
+\typebuffer
+
+\placefigure
+ [here][fig:autofocus]
+ {Applying autofocus.}
+ {\tx\getbuffer\FLOWchart[bonus 3]}
+
+In \in {figure}[fig:autofocus] we see both focus and auto focus in action.
+
+\stopsection
+
+\startsection[title={Line types}]
+
+As is to be expected, we can set up some characteristics of a chart, the shapes,
+the connecting lines, and the focus. When we want dashed lines and a different
+shape color, we just say:
+
+\startbuffer
+\setupFLOWshapes
+ [framecolor=pragmacolor]
+\setupFLOWlines
+ [framecolor=pragmacolor,
+ dash=yes]
+\stopbuffer
+
+\typebuffer
+
+\placefigure
+ [here][fig:lines]
+ {Dashed and colored lines.}
+ {\tx\getbuffer\FLOWchart[bonus 3]}
+
+We can change the characteristics at several levels: chart, line, shape and|/|or
+focus. In the near future some more options will be added. Once the \METAPOST\
+module is stable and documented, the graphic code will also be accessible. The
+formal definition of the four setup commands is as follows (these diagrams
+conform the \CONTEXT\ conventions):
+
+\setup{setupFLOWcharts}
+
+\setup{setupFLOWfocus}
+
+\setup{setupFLOWlines}
+
+\setup{setupFLOWshapes}
+
+\stopsection
+
+\startsection[title={Overlays}]
+
+Why should we limit ourselves to text? In \CONTEXT\ most frames||related features
+can have overlays. Because in this flowchart module shapes are drawn by
+\METAPOST, we use a slightly different approach: there can be overlays but they
+are sort of clipped by the shape. \in {Figure} [fig:overlay] illustrates this.
+
+\startbuffer
+\defineoverlay
+ [coward]
+ [{\externalfigure
+ [cow]
+ [width=\overlaywidth,
+ height=\overlayheight]}]
+
+\startFLOWchart [overlay]
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {procedure}
+ \connection [rl] {beta}
+ \figure {cow}
+ \text [lt] {\darkred \bfb COW 1}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {beta}
+ \location {2,1}
+ \shape {product}
+ \connection [rl] {gamma}
+ \overlay {cow}
+ \text {\darkgreen \bfb COW 2}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {gamma}
+ \location {3,1}
+ \shape {action}
+ \connection [rl] {alpha}
+ \overlay {cow}
+ \text [rb] {\darkblue \bfb COW 3}
+ \stopFLOWcell
+\stopFLOWchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\placefigure
+ [here][fig:overlay]
+ {Overlays.}
+ {\tx\FLOWchart[overlay]}
+
+There are two commands related to overlays. In our example we used: which
+automatically scales figure {\em cow} to the shape size. The normal rules for
+overlays apply. The width and height of the overlay are available at the moment
+the overlay is typeset.
+
+The text is aligned differently in this example and driven by an optional
+argument that can take one of the following values: \type {l}, \type {r}, \type
+{m}, \type {c}, \type {t}, \type {b}, \type {lt}, \type {rt}, \type {mt}, \type
+{ct}, \type {lb}, \type {rb}, \type {mb}, \type {cb}.
+
+\stopsection
+
+\startsection[title={Interaction}]
+
+One of the reasons for writing this module was that we wanted interactive
+flowcharts. The shape text can contain references. \footnote {Currently this only
+works ok when the chart is not scaled.} The shape as a whole becomes a button as
+soon as we add the \type {\destination} entry:
+
+\starttyping
+\startFLOWcell
+ ...
+ \destination {destination}
+ ...
+\stopFLOWcell
+\stoptyping
+
+\startbuffer[movie]
+\defineoverlay
+ [fun]
+ [{\externalfigure
+ [texwork.mov]
+ [width=\framedwidth,
+ height=\framedheight,
+ preview=yes,
+ repeat=yes]}]
+\stopbuffer
+
+\getbuffer[movie]
+
+\starthelptext [alpha]
+ \input knuth \blank D.E.~Knuth
+\stophelptext
+
+\starthelptext [beta]
+ \input tufte \blank E.R.~Tufte
+\stophelptext
+
+\starthelptext [delta]
+ \externalfigure[cow][width=\hsize]
+\stophelptext
+
+\startFLOWchart [interactive]
+
+ \startFLOWcell
+ \name {alpha}
+ \location {1,1}
+ \shape {procedure}
+ \connection [rl] {beta}
+ \text {\goto{introduction}[introduction]}
+ \stopFLOWcell
+
+ \startFLOWcell
+ \name {beta}
+ \location {2,1}
+ \shape {product}
+ \connection [rl] {gamma}
+ \text {Did you\\read me\\indeed?}
+ \destination{introduction}
+ \stopFLOWcell
+
+ \setupFLOWlines[dash=yes]
+
+ \startFLOWcell
+ \name {gamma}
+ \location {3,1}
+ \shape {action}
+ \connection [rl] {alpha}
+ \overlay {fun}
+ \stopFLOWcell
+
+ \setupFLOWlines[dash=no]
+
+ \startFLOWcell
+ \name {delta}
+ \location {4,1}
+ \shape {decision}
+ \connection [tt] {alpha}
+ \connection [tt] {beta}
+ \connection [tt] {gamma}
+ \figure {cow}
+ \stopFLOWcell
+
+\stopFLOWchart
+
+\placefigure
+ [here][fig:interactive]
+ {Interactive buttons.}
+ {\tx\FLOWchart[interactive]}
+
+When read as \PDF\ file, \in {figure} [fig:interactive] shows quite a few
+interactive features. The first cell has a \type {\goto} included in the text,
+like:
+
+\starttyping
+\startFLOWcell
+ ...
+ \text {\goto{introduction}[introduction]}
+ ...
+\stopFLOWcell
+\stoptyping
+
+The second shape is interactive as a whole. This is accomplished by saying:
+
+\starttyping
+\startFLOWcell
+ ...
+ \text {Did you\\read me\\indeed?}
+ \destination {introduction}
+ ...
+\stopFLOWcell
+\stoptyping
+
+The third cell is a movie, which is only visible in suitable viewers. The movie
+is included as an overlay.
+
+\typebuffer[movie]
+
+The last cell is an illustration.
+
+\stopsection
+
+\startsection[title={Splitting charts}]
+
+Sometimes a chart does not fit comfortably on the page. In such cases, it makes
+sense to split up the chart. There is a dedicated setup command to serve
+splitting:
+
+\setup{setupFLOWsplit}
+
+An example of splitting is:
+
+\starttyping
+\setupFLOWsplit
+ [nx=5,ny=10,
+ dx=1,dy=1,
+ before=,after=\page]
+
+\FLOWcharts[mybigflow]
+\stoptyping
+
+For easy alignment of the split pages, cut marks are added. This can be turned
+off by setting \type {marking} to \type {off}. The \type {n} parameters determine
+the number of cells per split off subject, and the \type {d} parameters specify
+the overlap: a value of~1 means that each split off subject has one row and|/|or
+columns in common with its neighbour.
+
+The splitter can be used with the split float placement macro:
+
+\starttyping
+\splitfloat
+ {\placefigure{What a big flowchart this is!}}
+ {\FLOWcharts[mybigflow]}
+\stoptyping
+
+Here every flowchart gets an caption with a decent subnumber.
+
+Related to splitting up charts is the option to define exit points as
+demonstrated in the next chart.
+
+\startbuffer
+\startFLOWchart[metatex]
+ \setupFLOWcharts
+ [width=6\bodyfontsize,
+ height=3\bodyfontsize,
+ dx=\bodyfontsize,
+ dy=\bodyfontsize]
+ \startFLOWcell
+ \name {texexec 1}
+ \location {1,1}
+ \shape {action}
+ \text {\TEXEXEC}
+ \connection [rl] {context 1}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {context 1}
+ \location {2,1}
+ \shape {action}
+ \text {\CONTEXT}
+ \connection [bt] {metapost 1}
+ \connection [rl] {texexec 2}
+ \exit [r] {123}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {metapost 1}
+ \location {2,2}
+ \shape {action}
+ \text {\METAPOST}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {texexec 2}
+ \location {3,1}
+ \shape {action}
+ \text {\TEXEXEC}
+ \connection [rl] {context 2}
+ \connection [bt] {metapost 2}
+ \exit [l] {123}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {context 2}
+ \location {4,1}
+ \shape {action}
+ \text {\CONTEXT}
+ \stopFLOWcell
+ \startFLOWcell
+ \name {metapost 2}
+ \location {3,2}
+ \shape {action}
+ \text {\METAPOST}
+ \stopFLOWcell
+\stopFLOWchart
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer[a]
+\FLOWchart [metatex] [x=1,nx=2,frame=on]
+\stopbuffer
+
+\startbuffer[b]
+\FLOWchart [metatex] [x=3,nx=2,frame=on]
+\stopbuffer
+
+When we ask for subcharts, the exit points will show up. Because they don't
+attribute to the dimensions of the chart, you can still align charts as expected.
+
+\startlinecorrection[blank] \getbuffer[a] \stoplinecorrection
+\typebuffer[a]
+
+\startlinecorrection[blank] \getbuffer[b] \stoplinecorrection
+\typebuffer[b]
+
+\stopsection
+
+\startsection[title={Other features}]
+
+It is possible to predefine flow charts in a way similar to external figures.
+Currently this mechanism is under construction, so describing it would be a bit
+premature.
+
+Crossing lines, which are often forbidden in charts, can be made less confusing
+by adding a gap in the lines to be crossed. This is one of the features that are
+already implemented but not yet accessible by the \CONTEXT\ user interface.
+
+Another feature, used in this document, concerns automatic down||scaling. As soon
+as we start scaling illustrations, we introduce inconsistent typography,
+especially in the bodyfontsize. Therefore, the flow chart macros, when told to,
+are able to automatically scale down in steps of 1~point.
+
+{\em This manual was first published in GUST magazine and presented at the anual
+meeting of the Polish user group in Bachotek 1999. Next it was published in the
+MAPS volume 23. After that it became Up||To||Date number 1999-003, and now it's
+part of the manual series. This version is for \MKIV.}
+
+\stopsection
+
+\stopdocument
diff --git a/doc/context/sources/general/manuals/luatex/luatex-math.tex b/doc/context/sources/general/manuals/luatex/luatex-math.tex
index 8e0c77119..ca93b1b9b 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-math.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-math.tex
@@ -469,7 +469,12 @@ math font Cambria, but were useful enough to be added.
There are two extra math parameters \type {\Umathnolimitsupfactor} and \type
{\Umathnolimitsubfactor} that were added to provide some control over how limits
are spaced (for example the position of super and subscripts after integral
-operators). They relate to an extra parameter \type {\mathnolimitsmode}.
+operators). They relate to an extra parameter \type {\mathnolimitsmode}. The half
+corrections are what happens when scripts are placed on above and below. The
+problem with italic corrections is that officially that correction italic is used
+for above|/|below placement while advanced kerns are used for placement at the
+right end. The question is: how often is this implemented, and if so, does the
+kerns assume correction too. Anyway, with this parameter one can control it.
\starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|]
\NC
@@ -490,29 +495,30 @@ operators). They relate to an extra parameter \type {\mathnolimitsmode}.
\NC \tttf 8000
\NC \NR
\NC \bf superscript
- \NC +ic/2
- \NC font
\NC 0
+ \NC font
\NC 0
\NC 0
+ \NC +ic/2
\NC 0
\NC \NR
\NC \bf subscript
- \NC -ic/2
+ \NC -ic
\NC font
\NC 0
\NC -ic/2
- \NC -ic
+ \NC -ic/2
\NC 8000ic/1000
\NC \NR
\stoptabulate
When the mode is set to one, the math parameters are used. This way a macro
package writer can decide what looks best. Given the current state of fonts in
-\CONTEXT\ we currently use 0 for the superscript and 750 for the subscripts.
-Positive values are used for both parameters but the subscript shifts to the
-left. A \type {\mathnolimitsmode} larger that 15 is considered to be a factor
-for the subscript correction. This feature can be handy when experimenting.
+\CONTEXT\ we currently use mode 1 with factor 0 for the superscript and 750 for
+the subscripts. Positive values are used for both parameters but the subscript
+shifts to the left. A \type {\mathnolimitsmode} larger that 15 is considered to
+be a factor for the subscript correction. This feature can be handy when
+experimenting.
\section{Math spacing setting}
diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex
index 75e63c9bb..74b2a60c8 100644
--- a/doc/context/sources/general/manuals/luatex/luatex.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex.tex
@@ -12,7 +12,7 @@
\dontcomplain
\startdocument
- [version=0.98.4,
+ [version=0.99,
status=pre-release]
\component luatex-titlepage
diff --git a/doc/context/sources/general/manuals/mcommon.tex b/doc/context/sources/general/manuals/mcommon.tex
index 94b5f9bf5..d4c2acb53 100644
--- a/doc/context/sources/general/manuals/mcommon.tex
+++ b/doc/context/sources/general/manuals/mcommon.tex
@@ -33,7 +33,7 @@
\definetypeface [mainface] [rm] [serif] [pagella] [default]
\definetypeface [mainface] [ss] [sans] [heros] [default] % [rscale=1.1]
-\definetypeface [mainface] [tt] [mono] [heros] [default] % [rscale=1.1]
+\definetypeface [mainface] [tt] [mono] [cursor] [default] % [rscale=1.1]
\definetypeface [mainface] [mm] [math] [pagella] [default]
\setupbodyfont[mainface,12pt]
diff --git a/metapost/context/base/mpiv/mp-asnc.mpiv b/metapost/context/base/mpiv/mp-asnc.mpiv
index 2626e4d58..fba182a64 100644
--- a/metapost/context/base/mpiv/mp-asnc.mpiv
+++ b/metapost/context/base/mpiv/mp-asnc.mpiv
@@ -13,7 +13,7 @@
if known context_asnc : endinput ; fi ;
-boolean context_av ; context_asnc := true ;
+boolean context_asnc ; context_asnc := true ;
% will be replaced
diff --git a/metapost/context/base/mpiv/mp-char.mpiv b/metapost/context/base/mpiv/mp-char.mpiv
index f604accd8..e878c2d16 100644
--- a/metapost/context/base/mpiv/mp-char.mpiv
+++ b/metapost/context/base/mpiv/mp-char.mpiv
@@ -678,14 +678,14 @@ vardef flow_valid_connection (expr xfrom, yfrom, xto, yto) =
flow_xypoints[flow_xypoint] := flow_xylast ;
for i=1 upto flow_max_x :
for j=1 upto flow_max_y : % was bug: xfrom,yto
- if not ( ( (i,j)=(xfrom,yfrom) ) or ( (i,j)=(xto,yto) ) ) :
+% if not ( ( (i,j)=(xfrom,yfrom) ) or ( (i,j)=(xto,yto) ) ) :
if not flow_xyfree[i][j] :
vc := pp intersection_point flow_xypath[i][j] ;
if intersection_found :
ok := false
fi ;
fi ;
- fi ;
+% fi ;
endfor ;
endfor ;
% if not ok: message("crossing") ; fi ;
@@ -944,20 +944,27 @@ def flow_connect_bottom_right (expr n) (expr xfrom,yfrom,zfrom) (expr xto,yto,zt
enddef ;
def flow_draw_test_shape(expr x, y) =
- flow_draw_shape(x,y,fullcircle, .7, .7) ;
+ flow_draw_shape(x,y,fullcircle,flow_shape_width/flow_grid_width,flow_shape_height/flow_grid_height) ;
enddef ;
def flow_draw_test_shapes =
+ flow_draw_test_area ;
for i=1 upto flow_max_x :
for j=1 upto flow_max_y :
flow_draw_test_shape(i,j) ;
+ flow_chart_draw_label(i,j,"",textext("\ttx(" & decimal i & "," & decimal j & ")"))
endfor ;
endfor ;
enddef;
def flow_draw_test_area =
pickup pencircle scaled .5flow_shape_line_width ;
- draw (unitsquare xscaled flow_max_x yscaled flow_max_y shifted (1,1)) flow_scaled_to_grid withcolor blue ;
+ for i=1 upto flow_max_x + 1 :
+ draw ((i,1) -- (i,flow_max_y+1)) flow_scaled_to_grid withcolor white/2 ;
+ endfor ;
+ for i=1 upto flow_max_y + 1 :
+ draw ((1,i) -- (flow_max_x+1,i)) flow_scaled_to_grid withcolor white/2 ;
+ endfor ;
enddef ;
def flow_show_connection(expr n, m) =
diff --git a/metapost/context/base/mpiv/mp-idea.mpiv b/metapost/context/base/mpiv/mp-idea.mpiv
index 462d97553..d417ab51f 100644
--- a/metapost/context/base/mpiv/mp-idea.mpiv
+++ b/metapost/context/base/mpiv/mp-idea.mpiv
@@ -28,3 +28,17 @@ vardef somecolor = (1,1,0,0) enddef ;
fill OverlayBox withcolor (rcomponent somecolor,gcomponent somecolor,bcomponent somecolor) ;
fill OverlayBox withcolor (ccomponent somecolor,mcomponent somecolor,ycomponent somecolor,bcomponent somecolor) ;
+
+% def newcolor text v = forsuffixes i=v : save i ; color i ; endfor ; enddef ;
+% def newnumeric text v = forsuffixes i=v : save i ; numeric i ; endfor ; enddef ;
+% def newboolean text v = forsuffixes i=v : save i ; boolean i ; endfor ; enddef ;
+% def newtransform text v = forsuffixes i=v : save i ; transform i ; endfor ; enddef ;
+% def newpath text v = forsuffixes i=v : save i ; path i ; endfor ; enddef ;
+% def newpicture text v = forsuffixes i=v : save i ; picture i ; endfor ; enddef ;
+% def newstring text v = forsuffixes i=v : save i ; string i ; endfor ; enddef ;
+
+% width := 10 ;
+% beginfig(1) ;
+% newpath width, height ; width := origin -- cycle ;
+% endfig ;
+% width := 10 ;
diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv
index 2c640960b..8c30da279 100644
--- a/metapost/context/base/mpiv/mp-luas.mpiv
+++ b/metapost/context/base/mpiv/mp-luas.mpiv
@@ -102,4 +102,6 @@ vardef MP@#(text t) =
mlib_luas_lualist("MP." & str @#,t)
enddef ;
-def message = lua.mp.report enddef ;
+def message expr t =
+ if t <> "" : lua.mp.report(t) fi ;
+enddef ;
diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv
index 40090ccf2..1814399b5 100644
--- a/metapost/context/base/mpiv/mp-tool.mpiv
+++ b/metapost/context/base/mpiv/mp-tool.mpiv
@@ -1472,8 +1472,7 @@ extra_beginfig := extra_beginfig & " miterlimit := 10 ; " ; % restores
extra_beginfig := extra_beginfig & " linejoin := rounded ; " ; % restores
extra_beginfig := extra_beginfig & " linecap := rounded ; " ; % restores
-%D Normally, arrowheads don't scale well. So we provide a
-%D hack.
+%D Normally, arrowheads don't scale well. So we provide a hack.
boolean autoarrows ; autoarrows := false ;
numeric ahfactor ; ahfactor := 2.5 ;
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 1d505a4c9..d5ddbb215 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index b12247546..82142910b 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -38,7 +38,7 @@ local sub, gsub = string.sub, string.gsub
local validstring = string.valid
local lpegmatch = lpeg.match
local utfchar, utfvalues = utf.char, utf.values
-local concat, insert, remove, merge = table.concat, table.insert, table.remove, table.merge
+local concat, insert, remove, merge, sort = table.concat, table.insert, table.remove, table.merge, table.sort
local sortedhash = table.sortedhash
local formatters = string.formatters
local todimen = number.todimen
@@ -71,6 +71,8 @@ local v_hidden = variables.hidden
local implement = interfaces.implement
+local included = backends.included
+
local settings_to_array = utilities.parsers.settings_to_array
local setmetatableindex = table.setmetatableindex
@@ -604,7 +606,9 @@ do
setattribute(di,"language",languagenames[texgetcount("mainlanguagenumber")])
if not less_state then
setattribute(di,"file",tex.jobname)
- setattribute(di,"date",os.date())
+ if included.date then
+ setattribute(di,"date",backends.timestamp())
+ end
setattribute(di,"context",environment.version)
setattribute(di,"version",exportversion)
setattribute(di,"xmlns:m",mathmlns)
@@ -771,7 +775,7 @@ do
function finalizers.descriptions(tree)
local n = 0
- for id, tag in next, descriptions do
+ for id, tag in sortedhash(descriptions) do
local sym = symbols[id]
if sym then
n = n + 1
@@ -1858,16 +1862,26 @@ do
local f_metadata = formatters["%w<metavariable name=%q>%s</metavariable>\n"]
local f_metadata_end = formatters["%w</metadata>\n"]
- --- we could share the r tables ... but it's fast enough anyway
-
local function attributes(a)
- local r = { } -- can be shared
+ local r = { }
local n = 0
for k, v in next, a do
n = n + 1
r[n] = f_attribute(k,v) -- lpegmatch(p_escaped,v)
end
- return concat(r,"",1,n)
+ sort(r)
+ return concat(r,"")
+ end
+
+ local function properties(a)
+ local r = { }
+ local n = 0
+ for k, v in next, a do
+ n = n + 1
+ r[n] = f_property(exportproperties,k,v)
+ end
+ sort(r)
+ return concat(r,"")
end
local depth = 0
@@ -1959,23 +1973,15 @@ do
if not p then
-- skip
elseif exportproperties == v_yes then
- for k, v in next, p do
- n = n + 1
- r[n] = f_attribute(k,v)
- end
+ r[n] = attributes(p)
else
- for k, v in next, p do
- n = n + 1
- r[n] = f_property(exportproperties,k,v)
- end
+ r[n] = properties(p)
end
end
local a = di.attributes
if a then
- for k, v in next, a do
- n = n + 1
- r[n] = f_attribute(k,v)
- end
+ n = n + 1
+ r[n] = attributes(a)
end
if n == 0 then
if nature == "inline" or inline > 0 then
@@ -2227,7 +2233,7 @@ do
for i=2,#trees do
local currenttree = trees[i]
local currentdata = currenttree.data
- local currentpar = currenttree.parnumber
+ local currentpar = currenttree.parnumber
local previouspar = trees[i-1].parnumber
currenttree.collapsed = true
-- is the next ok?
@@ -2905,7 +2911,7 @@ local xmlpreamble = [[
return replacetemplate(xmlpreamble, {
standalone = standalone and "yes" or "no",
filename = tex.jobname,
- date = os.date(),
+ date = included.date and backends.timestamp(),
contextversion = environment.version,
exportversion = exportversion,
})
@@ -3156,40 +3162,50 @@ local htmltemplate = [[
end)
local function makeclass(tg,at)
- local detail = at.detail
- local chain = at.chain
- local result
- at.detail = nil
- at.chain = nil
+ local detail = at.detail
+ local chain = at.chain
+ local extra = nil
+ local classes = { }
+ local nofclasses = 0
+ at.detail = nil
+ at.chain = nil
+ for k, v in next, at do
+ if not private[k] then
+ nofclasses = nofclasses + 1
+ classes[nofclasses] = k .. "-" .. v
+ end
+ end
if detail and detail ~= "" then
if chain and chain ~= "" then
if chain ~= detail then
- result = { classes[tg .. " " .. chain .. " " .. detail] } -- we need to remove duplicates
+ extra = classes[tg .. " " .. chain .. " " .. detail]
elseif tg ~= detail then
- result = { tg, detail }
- else
- result = { tg }
+ extra = detail
end
elseif tg ~= detail then
- result = { tg, detail }
- else
- result = { tg }
+ extra = detail
end
elseif chain and chain ~= "" then
if tg ~= chain then
- result = { tg, chain }
+ extra = chain
+ end
+ end
+ -- in this order
+ if nofclasses > 0 then
+ sort(classes)
+ classes = concat(classes," ")
+ if extra then
+ return tg .. " " .. extra .. " " .. classes
else
- result = { tg }
+ return tg .. " " .. classes
end
else
- result = { tg }
- end
- for k, v in next, at do
- if not private[k] then
- result[#result+1] = k .. "-" .. v
+ if extra then
+ return tg .. " " .. extra
+ else
+ return tg
end
end
- return concat(result, " ")
end
local function remap(specification,source,target)
diff --git a/tex/context/base/mkiv/back-ini.lua b/tex/context/base/mkiv/back-ini.lua
index e8af4d9d9..fc0074540 100644
--- a/tex/context/base/mkiv/back-ini.lua
+++ b/tex/context/base/mkiv/back-ini.lua
@@ -120,3 +120,22 @@ interfaces.implement {
nodes.tasks.setaction("shipouts","nodes.handlers.accessibility",v == interfaces.variables.yes)
end
}
+
+-- moved to here
+
+local included = table.setmetatableindex( {
+ context = true,
+ id = true,
+ metadata = true,
+ date = true,
+ id = true,
+ pdf = true,
+}, function(t,k)
+ return true
+end)
+
+backends.included = included
+
+function backends.timestamp()
+ return os.date("%Y-%m-%dT%X") .. os.timezone(true)
+end
diff --git a/tex/context/base/mkiv/char-tex.lua b/tex/context/base/mkiv/char-tex.lua
index c1b04abfa..3e0d02bc1 100644
--- a/tex/context/base/mkiv/char-tex.lua
+++ b/tex/context/base/mkiv/char-tex.lua
@@ -591,7 +591,8 @@ if not csletters then
elseif is_mark[category] then
texsetlccode(u,u,u) -- for hyphenation
end
- elseif isletter and u >= 32 and u <= 65536 then
+ -- elseif isletter and u >= 32 and u <= 65536 then
+ elseif isletter then
csletters[utfchar(u)] = u
--
local lc, uc = chr.lccode, chr.uccode
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 92a4ad6e8..7a4ffd2d3 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2016.09.09 08:21}
+\newcontextversion{2016.09.12 08:13}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 67664a557..c2a273351 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.09.09 08:21}
+\edef\contextversion{2016.09.12 08:13}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua
index 1c81e5e22..cd2816893 100644
--- a/tex/context/base/mkiv/font-dsp.lua
+++ b/tex/context/base/mkiv/font-dsp.lua
@@ -1933,7 +1933,7 @@ function readers.gdef(f,fontdata,specification)
end
end
-- mark sets : todo: just make the same as class sets above
- if marksetsoffset then
+ if marksetsoffset and marksetsoffset > tableoffset then -- zero offset means no table
setposition(f,marksetsoffset)
local format = readushort(f)
if format == 1 then
@@ -1942,7 +1942,6 @@ function readers.gdef(f,fontdata,specification)
for i=1,nofsets do
sets[i] = readulong(f)
end
- -- somehow this fails on e.g. notosansethiopic-bold.ttf
for i=1,nofsets do
local offset = sets[i]
if offset ~= 0 then
diff --git a/tex/context/base/mkiv/font-pre.mkiv b/tex/context/base/mkiv/font-pre.mkiv
index a9910e0c9..f12625c46 100644
--- a/tex/context/base/mkiv/font-pre.mkiv
+++ b/tex/context/base/mkiv/font-pre.mkiv
@@ -249,7 +249,7 @@
% liga=yes, % makes no sense
% tlig=yes, % makes no sense
% trep=yes, % makes no sense
- mathnolimitsmode={0,750}, % this looks okay on the average font
+ mathnolimitsmode={0,800}, % this looks okay on the average font
mathalternates=yes,
mathitalics=yes, % we pass them
% mathgaps=yes,
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index f395a32f9..18d29774b 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -1018,7 +1018,7 @@ end
do
- local timestamp = os.date("%Y-%m-%dT%X") .. os.timezone(true)
+ local timestamp = backends.timestamp()
function lpdf.timestamp()
return timestamp
@@ -1029,7 +1029,7 @@ do
n = converters.totime(n)
if n then
converters.settime(n)
- timestamp = os.date("%Y-%m-%dT%X",os.time(n)) .. os.timezone(true)
+ timestamp = backends.timestamp()
end
end
return timestamp
diff --git a/tex/context/base/mkiv/lpdf-xmp.lua b/tex/context/base/mkiv/lpdf-xmp.lua
index c8b86d384..4dd2e72f2 100644
--- a/tex/context/base/mkiv/lpdf-xmp.lua
+++ b/tex/context/base/mkiv/lpdf-xmp.lua
@@ -94,16 +94,7 @@ pdf.setsuppressoptionalinfo(
-- + 512 -- pdfnoid
)
-local included = table.setmetatableindex( {
- context = true,
- id = true,
- metadata = true,
- date = true,
- id = true,
- pdf = true,
-}, function(t,k)
- return true
-end)
+local included = backends.included
function lpdf.settrailerid(v)
if v then
diff --git a/tex/context/base/mkiv/math-ali.mkiv b/tex/context/base/mkiv/math-ali.mkiv
index b77af6383..d57a0b955 100644
--- a/tex/context/base/mkiv/math-ali.mkiv
+++ b/tex/context/base/mkiv/math-ali.mkiv
@@ -230,12 +230,9 @@
\def\math_handle_eqalign_no_l_aligned{\math_both_eqalign_no_aligned\math_prepare_l_eqalign_no}
\def\math_finish_eqalign_no {\crcr\egroup}
-\let \reqalignno \math_handle_eqalign_no_r_normal
-\let \leqalignno \math_handle_eqalign_no_l_normal
-\let\alignreqalignno \math_handle_eqalign_no_r_aligned
-\let\alignleqalignno \math_handle_eqalign_no_l_aligned
-\let \eqalignno \math_handle_eqalign_no_r_normal
-\let \aligneqalignno \math_handle_eqalign_no_r_aligned
+\let\reqalignno\relax
+\let\leqalignno\relax
+\let\eqalignno \relax
%D Here we implement the user interface part. We start with basic math alignments:
@@ -245,8 +242,7 @@
\def\math_alignment_NC_first#1\NR
{\glet\math_alignment_NC\math_alignment_NC_rest
- %\scratchtoks{\math_number_left_of_eqalign\aligntab#1\NR}%
- \scratchtoks{\aligntab#1\NR}%
+ \scratchtoks{\math_number_left_of_eqalign\aligntab#1\NR}% \math_number_left_of_eqalign not used yet
\dodoubleempty\math_alignment_NC_first_indeed}
\def\math_alignment_NC_first_indeed[#1][#2]%
@@ -395,19 +391,27 @@
\ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi
\fi}
+\newconditional\c_math_alignment_local_number % not used but when true puts in front (todo)
+
\def\math_number_right_of_eqalign
{\ifcase\wd\b_strc_formulas_number\else
- \ifcase\c_strc_math_number_location\or\or
+ \ifconditional\c_math_alignment_local_number
+ \ifcase\c_strc_math_number_location\or\or
+ \box\b_strc_formulas_number
+ \fi
+ \else
\box\b_strc_formulas_number
\fi
\fi}
-% \def\math_number_left_of_eqalign
-% {\ifcase\wd\b_strc_formulas_number\else
-% \ifcase\c_strc_math_number_location\or
-% \box\b_strc_formulas_number
-% \fi
-% \fi}
+\def\math_number_left_of_eqalign
+ {\ifcase\wd\b_strc_formulas_number\else
+ \ifconditional\c_math_alignment_local_number
+ \ifcase\c_strc_math_number_location\or
+ \box\b_strc_formulas_number
+ \fi
+ \fi
+ \fi}
\def\math_eqalign_set_column#1% we could just add to the preamble (as with other alignments)
{\expandafter\let\csname\??mathalignmentvariant\number\c_math_eqalign_column\expandafter\endcsname
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index 19abe1bcd..299bcc0dd 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -94,7 +94,7 @@ return {
--
"pushcurrentpicture", "popcurrentpicture",
--
- "arrowpath",
+ "arrowpath", "resetarrows",
-- "colorlike", "dowithpath", "rangepath", "straightpath", "addbackground",
-- "cleanstring", "asciistring", "setunstringed", "getunstringed", "unstringed",
-- "showgrid",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 422b93537..ab7944b82 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 726f5ef16..a490ae3e4 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/typo-krn.lua b/tex/context/base/mkiv/typo-krn.lua
index 5a42caeca..6a2aed9a2 100644
--- a/tex/context/base/mkiv/typo-krn.lua
+++ b/tex/context/base/mkiv/typo-krn.lua
@@ -102,7 +102,8 @@ typesetters.kerns = typesetters.kerns or { }
local kerns = typesetters.kerns
local report = logs.reporter("kerns")
-local trace_ligatures = false trackers.register("typesetters.kerns.ligatures",function(v) trace_ligatures = v end)
+local trace_ligatures = false trackers.register("typesetters.kerns.ligatures", function(v) trace_ligatures = v end)
+local trace_ligatures_d = false trackers.register("typesetters.kerns.ligatures.detail",function(v) trace_ligatures_d = v end)
-- use_advance is just an experiment: it makes copying glyphs (instead of new_glyph) dangerous
@@ -144,18 +145,24 @@ function kerns.keepligature(n) -- might become default
local c = getchar(n)
local d = fontdescriptions[f][c].name
if a > 0 and contextsetups[a].keepligatures == v_auto then
- report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","dynamic","keepligatures")
+ if trace_ligatures_d then
+ report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","dynamic","keepligatures")
+ end
setcolor(n,"darkred")
return true
end
local k = fontfeatures[f].keepligatures
if k == v_auto then
- report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","static","keepligatures")
+ if trace_ligatures_d then
+ report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","static","keepligatures")
+ end
setcolor(n,"darkgreen")
return true
end
if not k then
- report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"split","static","keepligatures")
+ if trace_ligatures_d then
+ report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"split","static","keepligatures")
+ end
resetcolor(n)
return false
end
diff --git a/tex/context/interface/mkiv/i-chart.xml b/tex/context/interface/mkiv/i-chart.xml
new file mode 100644
index 000000000..06c356041
--- /dev/null
+++ b/tex/context/interface/mkiv/i-chart.xml
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?context-directive job ctxfile x-setups.ctx ?>
+
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">
+
+ <?context-directive job ctxfile x-setups.ctx ?>
+
+ <!-- still incomplete -->
+
+ <cd:command name="setupFLOWcharts" file="m-chart.mkiv">
+ <cd:arguments>
+ <cd:resolve name="keyword-name-list-optional"/>
+ <cd:assignments list="yes">
+ <cd:parameter name="width">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="height">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="offset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="dx">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="dy">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="nx">
+ <cd:constant type="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="ny">
+ <cd:constant type="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="x">
+ <cd:constant type="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="y">
+ <cd:constant type="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="labeloffset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="commentoffset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="exitoffset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="split">
+ <cd:constant type="yes"/>
+ <cd:constant type="no" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="bodyfont">
+ <cd:inherit name="setupbodyfont"/>
+ </cd:parameter>
+ <cd:parameter name="option">
+ <cd:constant type="test"/>
+ </cd:parameter>
+ <!-- dot: private option -->
+ <cd:parameter name="focus">
+ <cd:constant type="cd:text"/>
+ </cd:parameter>
+ <cd:parameter name="autofocus">
+ <cd:constant type="yes"/>
+ <cd:constant type="no" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="autofocus">
+ <cd:constant type="yes"/>
+ <cd:constant type="no" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="background">
+ <cd:resolve name="value-background"/>
+ </cd:parameter>
+ <cd:parameter name="framecolor">
+ <cd:constant type="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="backgroundcolor">
+ <cd:constant type="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="rulethickness">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="frame">
+ <cd:constant type="on" default="yes"/>
+ <cd:constant type="off"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="setupFLOWlines" file="m-chart.mkiv">
+ <cd:arguments>
+ <cd:resolve name="keyword-name-list-optional"/>
+ <cd:assignments list="yes">
+ <cd:parameter name="color">
+ <cd:constant name="round"/>
+ <cd:constant name="normal" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="arrow">
+ <cd:constant name="yes" default="yes"/>
+ <cd:constant name="no"/>
+ </cd:parameter>
+ <cd:parameter name="dash">
+ <cd:constant name="yes"/>
+ <cd:constant name="no" default="yes"/>
+ </cd:parameter>
+ <cd:parameter name="radius">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="color">
+ <cd:constant name="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="rulethickness">
+ <cd:constant name="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="offset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="setupFLOWshapes" file="m-chart.mkiv">
+ <cd:arguments>
+ <cd:resolve name="keyword-name-list-optional"/>
+ <cd:assignments list="yes">
+ <cd:parameter name="default">
+ <cd:resolve name="cd:name"/>
+ </cd:parameter>
+ <cd:parameter name="framecolor">
+ <cd:constant name="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="background">
+ <cd:resolve name="value-background"/>
+ </cd:parameter>
+ <cd:parameter name="backgroundcolor">
+ <cd:constant name="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="rulethickness">
+ <cd:constant name="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="offset">
+ <cd:constant type="none"/>
+ <cd:constant type="overlay"/>
+ <cd:constant type="standard"/>
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="setupFLOWfocus" file="m-chart.mkiv">
+ <cd:arguments>
+ <cd:resolve name="keyword-name-list-optional"/>
+ <cd:assignments list="yes">
+ <cd:parameter name="color">
+ <cd:constant type="cd:color"/>
+ </cd:parameter>
+ <cd:parameter name="background">
+ <cd:inherit name="setupFLOWshape"/>
+ </cd:parameter>
+ <cd:parameter name="backgroundcolor">
+ <cd:inherit name="setupFLOWshape"/>
+ </cd:parameter>
+ <cd:parameter name="rulethickness">
+ <cd:inherit name="setupFLOWshape"/>
+ </cd:parameter>
+ <cd:parameter name="offset">
+ <cd:inherit name="setupFLOWshape"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="setupFLOWsplit" file="m-chart.mkiv">
+ <cd:arguments>
+ <cd:resolve name="keyword-name-list-optional"/>
+ <cd:assignments list="yes">
+ <cd:parameter name="dx">
+ <cd:constant name="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="dy">
+ <cd:constant name="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="nx">
+ <cd:constant name="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="ny">
+ <cd:constant name="cd:number"/>
+ </cd:parameter>
+ <cd:parameter name="command">
+ <cd:constant name="cd:command"/>
+ </cd:parameter>
+ <cd:parameter name="before">
+ <cd:constant name="cd:command"/>
+ </cd:parameter>
+ <cd:parameter name="after">
+ <cd:constant name="cd:command"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <!--
+
+ startFLOWchart [name]
+ FLOWchart [name]
+ startFLOWcell [key=value]
+ includeFLOWchart
+
+ name shape destination focus overlay location text label comment exit
+ connection include figure connect locate
+ -->
+
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-chemical.xml b/tex/context/interface/mkiv/i-chemical.xml
index d300f9008..1a81b82fc 100644
--- a/tex/context/interface/mkiv/i-chemical.xml
+++ b/tex/context/interface/mkiv/i-chemical.xml
@@ -252,4 +252,4 @@
</cd:arguments>
</cd:command>
-</cd:interface> \ No newline at end of file
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-common-value.xml b/tex/context/interface/mkiv/i-common-value.xml
index 42c9e11d8..5b068570b 100644
--- a/tex/context/interface/mkiv/i-common-value.xml
+++ b/tex/context/interface/mkiv/i-common-value.xml
@@ -4,6 +4,15 @@
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">
+ <!-- backgrounds-->
+
+ <cd:define name="value-background">
+ <cd:parameter name="background">
+ <cd:constant type="foreground"/>
+ <cd:constant type="color"/>
+ <cd:constant type="cd:name"/>
+ </cd:define>
+
<!-- style = ... -->
<cd:define name="value-style">
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 16ce0cdb9..bf6123331 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-framed.xml b/tex/context/interface/mkiv/i-framed.xml
index 07bdd5de4..b87e498e5 100644
--- a/tex/context/interface/mkiv/i-framed.xml
+++ b/tex/context/interface/mkiv/i-framed.xml
@@ -93,9 +93,7 @@
<cd:constant type="none"/>
</cd:parameter>
<cd:parameter name="background">
- <cd:constant type="foreground"/>
- <cd:constant type="color"/>
- <cd:constant type="cd:name"/>
+ <cd:resolve name="value-background"/>
</cd:parameter>
<cd:parameter name="backgroundoffset">
<cd:constant type="frame"/>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index a36861d6c..3154dfdd2 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-chart.lua b/tex/context/modules/mkiv/m-chart.lua
index f1e7f4cb9..66f2b4c5f 100644
--- a/tex/context/modules/mkiv/m-chart.lua
+++ b/tex/context/modules/mkiv/m-chart.lua
@@ -10,24 +10,28 @@ if not modules then modules = { } end modules ['x-flow'] = {
-- use metapost.graphic(....) directly
-- todo: labels
+-- todo: named colors
-moduledata.charts = moduledata.charts or { }
+local type, tonumber, rawget, next = type, tonumber, rawget, next
+local gsub, find, lower = string.gsub, string.find, string.lower
+local P, S, C, Cc, lpegmatch = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.match
-local gsub, match, find, format, lower = string.gsub, string.match, string.find, string.format, string.lower
+local formatters = string.formatters
local setmetatableindex = table.setmetatableindex
-local P, S, C, Cc, lpegmatch = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.match
-local report_chart = logs.reporter("chart")
+moduledata.charts = moduledata.charts or { }
+
+local report_chart = logs.reporter("chart")
-local variables = interfaces.variables
+local variables = interfaces.variables
-local v_yes = variables.yes
-local v_no = variables.no
-local v_none = variables.none
-local v_standard = variables.standard
-local v_overlay = variables.overlay
-local v_round = variables.round
-local v_test = variables.test
+local v_yes = variables.yes
+local v_no = variables.no
+local v_none = variables.none
+local v_standard = variables.standard
+local v_overlay = variables.overlay
+local v_round = variables.round
+local v_test = variables.test
local defaults = {
chart = {
@@ -252,8 +256,8 @@ end
function commands.flow_set_text(align,str)
temp.texts[#temp.texts+1] = {
- location = align,
- text = str,
+ align = align,
+ text = str,
}
end
@@ -504,7 +508,7 @@ local function process_cells(chart,xoffset,yoffset)
if shapedata.kind == "line" then
local linesettings = settings.line
context("flow_shape_line_color := \\MPcolor{%s} ;", linesettings.color)
- context("flow_shape_fill_color := \\MPcolor{%s} ;", linesettings.backgroundcolor)
+ context("flow_shape_fill_color := black ;")
context("flow_shape_line_width := %p ; ", linesettings.rulethickness)
elseif focus[cell.focus] or focus[cell.name] then
local focussettings = settings.focus
@@ -597,9 +601,17 @@ local function process_connections(chart,xoffset,yoffset)
end
end
-local texttemplate = "\\setvariables[flowcell:text][x=%s,y=%s,text={%s},align={%s},figure={%s},destination={%s}]"
+local f_texttemplate_t = formatters["\\setvariables[flowcell:text][x=%s,y=%s,n=%i,align={%s},figure={%s},overlay={%s},destination={%s}]"]
+local f_texttemplate_l = formatters["\\doFLOWlabel{%i}{%i}{%i}"]
-local splitter = lpeg.splitat(":")
+local splitter = lpeg.splitat(":")
+local charttexts = { } -- permits " etc in mp
+
+function commands.flow_get_text(n)
+ if n > 0 then
+ context(charttexts[n])
+ end
+end
local function process_texts(chart,xoffset,yoffset)
local data = chart.data
@@ -607,41 +619,59 @@ local function process_texts(chart,xoffset,yoffset)
if not data then
return
end
+ charttexts = { }
for i=1,#data do
local cell = visible(chart,data[i])
if cell then
- local x = cell.x or 1
- local y = cell.y or 1
- local texts = cell.texts
- for i=1,#texts do
- local text = texts[i]
- local data = text.text
- local align = validlabellocations[text.align or ""] or text.align or ""
- local figure = i == 1 and cell.figure or ""
- local destination = i == 1 and cell.destination or ""
- context('flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,format(texttemplate,x,y,data,align,figure,destination))
+ local x = cell.x or 1
+ local y = cell.y or 1
+ local figure = cell.figure or ""
+ local overlay = cell.overlay or ""
+ local destination = cell.destination or ""
+ local texts = cell.texts
+ local noftexts = #texts
+ if noftexts > 0 then
+ for i=1,noftexts do
+ local text = texts[i]
+ local data = text.text
+ local align = text.align or ""
+ local align = validlabellocations[align] or align
+ charttexts[#charttexts+1] = data
+ context('flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,#charttexts,align,figure,overlay,destination))
+ if i == 1 then
+ figure = ""
+ overlay = ""
+ destination = ""
+ end
+ end
+ elseif figure ~= "" or overlay ~= "" or destination ~= "" then
+ context('flow_chart_draw_text(%s,%s,textext("%s")) ;',x,y,f_texttemplate_t(x,y,0,"",figure,overlay,destination))
end
local labels = cell.labels
for i=1,#labels do
- local label = labels[i]
- local text = label.text
- local location = validlabellocations[label.location or ""] or label.location or ""
- if text and location then
- context('flow_chart_draw_label(%s,%s,"%s",textext("\\strut %s")) ;',x,y,location,text)
+ local label = labels[i]
+ local text = label.text
+ local location = label.location or ""
+ local location = validlabellocations[location] or location
+ if text and text ~= "" then
+ charttexts[#charttexts+1] = text
+ context('flow_chart_draw_label(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts))
end
end
local exits = cell.exits
for i=1,#exits do
- local exit = exits[i]
- local text = exit.text
- local location = validlabellocations[exit.location or ""]
- if text and location then
+ local exit = exits[i]
+ local text = exit.text
+ local location = exit.location or ""
+ local location = validlabellocations[location] or location
+ if text ~= "" then
-- maybe make autoexit an option
if location == "l" and x == chart.from_x + 1 or
location == "r" and x == chart.to_x - 1 or
location == "t" and y == chart.to_y - 1 or
location == "b" and y == chart.from_y + 1 then
- context('flow_chart_draw_exit(%s,%s,"%s",textext("\\strut %s")) ;',x,y,location,text)
+ charttexts[#charttexts+1] = text
+ context('flow_chart_draw_exit(%s,%s,"%s",textext("%s")) ;',x,y,location,f_texttemplate_l(x,y,#charttexts))
end
end
end
@@ -649,10 +679,10 @@ local function process_texts(chart,xoffset,yoffset)
for i=1,#connections do
local comments = connections[i].comments
for j=1,#comments do
- local comment = comments[j]
- local text = comment.text
+ local comment = comments[j]
+ local text = comment.text
local location = comment.location or ""
- local length = 0
+ local length = 0
-- "tl" "tl:*" "tl:0.5"
local loc, len = lpegmatch(splitter,location) -- do the following in lpeg
if len == "*" then
@@ -664,12 +694,13 @@ local function process_texts(chart,xoffset,yoffset)
end
elseif loc then
location = validcommentlocations[loc] or "*"
- length = tonumber(len) or 0
+ length = tonumber(len) or 0
else
location = validcommentlocations[location] or ""
end
- if text and location then
- context('flow_chart_draw_comment(%s,%s,%s,"%s",%s,textext("\\strut %s")) ;',x,y,i,location,length,text)
+ if text and text ~= "" then
+ charttexts[#charttexts+1] = text
+ context('flow_chart_draw_comment(%s,%s,%s,"%s",%s,textext("%s")) ;',x,y,i,location,length,f_texttemplate_l(x,y,#charttexts))
end
end
end
@@ -837,6 +868,9 @@ local function makechart(chart)
context("flow_chart_offset := %p ;",offset)
--
context("flow_reverse_y := true ;")
+if chartsettings.option == v_test then
+ context("flow_draw_test_shapes ;")
+end
process_cells(chart,0,0)
process_connections(chart,0,0)
process_texts(chart,0,0)
diff --git a/tex/context/modules/mkiv/m-chart.mkvi b/tex/context/modules/mkiv/m-chart.mkvi
index a0c8b2244..a1def7065 100644
--- a/tex/context/modules/mkiv/m-chart.mkvi
+++ b/tex/context/modules/mkiv/m-chart.mkvi
@@ -15,7 +15,6 @@
% flowsets
% autoscaling (bodyfontsteps)
% comment
-% overlay
%
% todo:
% \useFLOWchart[name][parent][setting,setting][additional settings]
@@ -63,8 +62,6 @@
\c!commentoffset=.5\bodyfontsize,
\c!exitoffset=\zeropoint,
% \c!split=\v!no,
- % \c!maxwidth=,
- % \c!maxheight=,
% \c!option=,
% \c!bodyfont=,
% \c!dot=, % private option
@@ -307,7 +304,7 @@
\unexpanded\def\module_charts_FLOW_include [#name][#settings]{%
\begingroup
- \getparameters[FLOWi][x=1,y=1,#settings]%
+ \getparameters[FLOWi][\c!x=1,\c!y=1,#settings]%
\ctxcommand{flow_set_include("#name",\number\FLOWix,\number\FLOWiy,\!!bs\detokenize{#settings}\!!es)}%
\endgroup
\ignorespaces
@@ -315,7 +312,8 @@
\setvariables
[flowcell:text]
- [x=1,
+ [n=0,
+ x=1,
y=1,
text=,
align=,
@@ -324,8 +322,6 @@
\def\FLOWx{\getvariable{flowcell:text}{x}} % compatibility (for Willi)
\def\FLOWy{\getvariable{flowcell:text}{y}} % compatibility (for Willi)
-% \c!background={\@@FLOWbackground,\FLOWoverlay},
-
\defineoverlay
[flowcell:figure]
[\overlayfigure{\getvariable{flowcell:text}{figure}}]
@@ -335,13 +331,15 @@
\iftrialtypesetting
\directsetup{flowcell:text:place:indeed}
\else \iflocation
- \doifelsenothing {\getvariable{flowcell:text}{destination}} {
+ \edef\flowcelldestination{\getvariable{flowcell:text}{destination}}%
+ \ifx\flowcelldestination\empty
\directsetup{flowcell:text:place:indeed}
- } {
+ \else
% tricky: scaling and moving around is not taken into account
- \setupinteraction[\c!color=,\c!contrastcolor=]
- \gotobox{\directsetup{flowcell:text:place:indeed}}[\getvariable{flowcell:text}{destination}]
- }
+ \letinteractionparameter\c!color\empty
+ \letinteractionparameter\c!contrastcolor\empty
+ \gotobox{\directsetup{flowcell:text:place:indeed}}[\flowcelldestination]
+ \fi
\else
\directsetup{flowcell:text:place:indeed}
\fi \fi
@@ -351,17 +349,41 @@
\startsetups flowcell:text:place:indeed
\begingroup
\directsetup{flowcell:text:user}
- \doifelsenothing {\getvariable{flowcell:text}{figure}} {
- \expandcheckedcsname{flowcell:}{\getvariable{flowcell:text}{align}}\empty
- {\getvariable{flowcell:text}{text}}
- } {
- \expandcheckedcsname{flowcell:}{\getvariable{flowcell:text}{align}}\empty
- [\c!background=flowcell:figure]
- {\getvariable{flowcell:text}{text}}
- }
+ \edef\flowcellfigure {\getvariable{flowcell:text}{figure}}%
+ \edef\flowcelloverlay{\getvariable{flowcell:text}{overlay}}%
+ \edef\flowcellalign {\getvariable{flowcell:text}{align}}%
+ \edef\flowcellindex {\getvariable{flowcell:text}{n}}%
+ \ifx\flowcellfigure\empty
+ \ifx\flowcelloverlay\empty
+ \expandcheckedcsname{flowcell:}\flowcellalign\empty
+ % {\getvariable{flowcell:text}{text}}
+ {\getFLOWtext\flowcellindex}
+ \else
+ \expandcheckedcsname{flowcell:}\flowcellalign\empty
+ [\c!background={\flowcelloverlay}]
+ % {\getvariable{flowcell:text}{text}}
+ {\getFLOWtext\flowcellindex}
+ \fi
+ \else
+ \expandcheckedcsname{flowcell:}\flowcellalign\empty
+ [\c!background=flowcell:figure]
+ % {\getvariable{flowcell:text}{text}}
+ {\getFLOWtext\flowcellindex}
+ \fi
\endgroup
\stopsetups
+\unexpanded\def\doFLOWlabel#1#2#3%
+ {\begingroup
+ \def\FLOWx{#1}%
+ \def\FLOWy{#2}%
+ \strut
+ \getFLOWtext{#3}%
+ \endgroup}
+
+\unexpanded\def\getFLOWtext#1%
+ {\ifcase#1\else\ctxcommand{flow_get_text(#1)}\fi}
+
\defineframed % to be discussed: shape or global
[flowcell:base]
[\c!offset=\v!overlay, % no strut ?
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 00da9a536..0d8938137 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 09/09/16 08:21:36
+-- merge date : 09/12/16 08:13:34
do -- begin closure to overcome local limits and interference
@@ -12841,7 +12841,7 @@ function readers.gdef(f,fontdata,specification)
end
end
end
- if marksetsoffset then
+ if marksetsoffset and marksetsoffset>tableoffset then
setposition(f,marksetsoffset)
local format=readushort(f)
if format==1 then