diff options
author | Marius <mariausol@gmail.com> | 2012-11-27 17:20:14 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-11-27 17:20:14 +0200 |
commit | d6a644d5e4a6689051cabe2352c28458e2fc7a99 (patch) | |
tree | 100ab76339c24cbda56cf123b181d15d84f8e9f0 | |
parent | 48c4609c92a6e0cbbbd8c5e894d2e11b081e032f (diff) | |
download | context-d6a644d5e4a6689051cabe2352c28458e2fc7a99.tar.gz |
beta 2012.11.27 15:54
-rw-r--r-- | context/data/scite/lexers/data/scite-context-data-metapost.lua | 2 | ||||
-rw-r--r-- | context/data/scite/scite-context-data-metapost.properties | 42 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4149 -> 4151 bytes | |||
-rw-r--r-- | tex/context/base/context-version.png | bin | 40624 -> 40668 bytes | |||
-rw-r--r-- | tex/context/base/context.mkii | 2 | ||||
-rw-r--r-- | tex/context/base/context.mkiv | 3 | ||||
-rw-r--r-- | tex/context/base/mlib-pps.lua | 20 | ||||
-rw-r--r-- | tex/context/base/mult-fun.lua | 3 | ||||
-rw-r--r-- | tex/context/base/mult-mps.lua | 5 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24569 -> 24544 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 198842 -> 198958 bytes | |||
-rw-r--r-- | tex/context/base/status-mkiv.lua | 12 | ||||
-rw-r--r-- | tex/context/base/task-ini.lua | 8 | ||||
-rw-r--r-- | tex/context/base/trac-jus.lua | 138 | ||||
-rw-r--r-- | tex/context/base/trac-jus.mkiv | 25 | ||||
-rw-r--r-- | tex/context/base/util-sql.lua | 34 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
19 files changed, 251 insertions, 49 deletions
diff --git a/context/data/scite/lexers/data/scite-context-data-metapost.lua b/context/data/scite/lexers/data/scite-context-data-metapost.lua index d3c199089..df97c0a26 100644 --- a/context/data/scite/lexers/data/scite-context-data-metapost.lua +++ b/context/data/scite/lexers/data/scite-context-data-metapost.lua @@ -1,7 +1,7 @@ return { ["commands"]={ "beginfig", "endfig", "rotatedaround", "reflectedabout", "arrowhead", "currentpen", "currentpicture", "cuttings", "defaultfont", "extra_beginfig", "extra_endfig", "ditto", "EOF", "down", "evenly", "fullcircle", "halfcircle", "identity", "in", "left", "origin", "pensquare", "quartercircle", "right", "unitsquare", "up", "withdots", "abs", "bbox", "ceiling", "center", "cutafter", "cutbefore", "dir", "directionpoint", "div", "dotprod", "intersectionpoint", "inverse", "mod", "round", "unitvector", "whatever", "cutdraw", "draw", "drawarrow", "drawdblarrow", "fill", "filldraw", "drawdot", "loggingall", "interact", "tracingall", "tracingnone", "pickup", "undraw", "unfill", "unfilldraw", "buildcycle", "dashpattern", "decr", "dotlabel", "dotlabels", "drawoptions", "incr", "label", "labels", "max", "min", "thelabel", "z", "beginchar", "blacker", "capsule_end", "change_width", "define_blacker_pixels", "define_corrected_pixels", "define_good_x_pixels", "define_good_y_pixels", "define_horizontal_corrected_pixels", "define_pixels", "define_whole_blacker_pixels", "define_whole_pixels", "define_whole_vertical_blacker_pixels", "define_whole_vertical_pixels", "endchar", "extra_beginchar", "extra_endchar", "extra_setup", "font_coding_scheme", "clearxy", "clearit", "clearpen", "shipit", "font_extra_space", "exitunless", "relax", "hide", "gobble", "gobbled", "stop", "blankpicture", "counterclockwise", "tensepath", "takepower", "direction", "softjoin", "makelabel", "rotatedabout", "flex", "superellipse", "erase", "image", "nullpen", "savepen", "clearpen", "penpos", "penlabels", "range", "numtok", "thru", "z", "laboff", "bye", "red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "background", "graypart", "graycolor", "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in" }, ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "pen_lft", "pen_rt", "pen_top", "pen_bot" }, - ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "forsuffixes", "downto", "upto", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "greypart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", "expandafter" }, + ["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "downto", "upto", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "greypart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "expandafter" }, ["shortcuts"]={ "..", "...", "--", "---", "&" }, ["tex"]={ "btex", "etex", "verbatimtex" }, }
\ No newline at end of file diff --git a/context/data/scite/scite-context-data-metapost.properties b/context/data/scite/scite-context-data-metapost.properties index d2027c956..cade4e8ce 100644 --- a/context/data/scite/scite-context-data-metapost.properties +++ b/context/data/scite/scite-context-data-metapost.properties @@ -28,26 +28,28 @@ suffix text primary secondary tertiary \ primarydef secondarydef tertiarydef randomseed also \ contour doublepath withcolor withpen dashed \ if else elseif fi for \ -endfor forever exitif forsuffixes downto \ -upto step until charlist extensible \ -fontdimen headerbyte kern ligtable boundarychar \ -chardp charext charht charic charwd \ -designsize fontmaking charexists cullit currenttransform \ -gfcorners grayfont hround imagerules lowres_fix \ -nodisplays notransforms openit displaying currentwindow \ -screen_rows screen_cols pixels_per_inch cull display \ -openwindow numspecial totalweight autorounding fillin \ -proofing tracingpens xoffset chardx granularity \ -smoothing turningcheck yoffset chardy hppp \ -tracingedges vppp extra_beginfig extra_endfig mpxbreak \ -endinput message delimiters turningnumber errmessage \ -readstring scantokens end outer inner \ -write to readfrom withprescript withpostscript \ -top bot lft rt ulft \ -urt llft lrt redpart greenpart \ -bluepart cyanpart magentapart yellowpart blackpart \ -greypart rgbcolor cmykcolor greycolor graycolor \ -colormodel graypart expandafter +endfor forever exitif within forsuffixes \ +downto upto step until charlist \ +extensible fontdimen headerbyte kern ligtable \ +boundarychar chardp charext charht charic \ +charwd designsize fontmaking charexists cullit \ +currenttransform gfcorners grayfont hround imagerules \ +lowres_fix nodisplays notransforms openit displaying \ +currentwindow screen_rows screen_cols pixels_per_inch cull \ +display openwindow numspecial totalweight autorounding \ +fillin proofing tracingpens xoffset chardx \ +granularity smoothing turningcheck yoffset chardy \ +hppp tracingedges vppp extra_beginfig extra_endfig \ +mpxbreak endinput message delimiters turningnumber \ +errmessage readstring scantokens end outer \ +inner write to readfrom withprescript \ +withpostscript top bot lft rt \ +ulft urt llft lrt redpart \ +greenpart bluepart cyanpart magentapart yellowpart \ +blackpart greypart rgbcolor cmykcolor greycolor \ +graycolor colormodel graypart dashpart penpart \ +stroked filled textual clipped bounded \ +expandafter keywordclass.metapost.commands=\ beginfig endfig rotatedaround reflectedabout \ diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index d5f90c684..05be6ccf4 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.11.26 13:31} +\newcontextversion{2012.11.27 15:54} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 10fba7f40..985372c08 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.11.26 13:31} +\newcontextversion{2012.11.27 15:54} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex f8855c59a..42384dd98 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex db92e1e14..6224e84c5 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index a083e5911..80ca8f918 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.11.26 13:31} +\edef\contextversion{2012.11.27 15:54} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index afe46d69c..1ce05e9c1 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.11.26 13:31} +\edef\contextversion{2012.11.27 15:54} %D For those who want to use this: @@ -367,6 +367,7 @@ \loadmarkfile{blob-ini} % not to be used, we only use a helper \loadmarkfile{trac-vis} +\loadmarkfile{trac-jus} \loadmarkfile{typo-cln} \loadmarkfile{typo-spa} diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index 7821b3dbf..8d8db65ae 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -642,7 +642,7 @@ local scriptsplitter = Ct ( Ct ( C((1-S("= "))^1) * S("= ")^1 * C((1-S("\n\r"))^0) * S("\n\r")^0 )^0 ) -local function splitscript(script) +local function splitprescript(script) local hash = lpegmatch(scriptsplitter,script) for i=#hash,1,-1 do local h = hash[i] @@ -654,6 +654,20 @@ local function splitscript(script) return hash end +-- -- not used: +-- +-- local function splitpostscript(script) +-- local hash = lpegmatch(scriptsplitter,script) +-- for i=1,#hash do +-- local h = hash[i] +-- hash[h[1]] = h[2] +-- end +-- if trace_scripts then +-- report_scripts(table.serialize(hash,"postscript")) +-- end +-- return hash +-- end + function metapost.pluginactions(what,t,flushfigure) -- before/after object, depending on what for i=1,#what do local wi = what[i] @@ -681,7 +695,7 @@ end function metapost.analyzeplugins(object) -- each object (first pass) local prescript = object.prescript -- specifications if prescript and #prescript > 0 then - return analyzer(object,splitscript(prescript)) + return analyzer(object,splitprescript(prescript)) end end @@ -690,7 +704,7 @@ function metapost.processplugins(object) -- each object (second pass) if prescript and #prescript > 0 then local before = { } local after = { } - processor(object,splitscript(prescript),before,after) + processor(object,splitprescript(prescript),before,after) return #before > 0 and before, #after > 0 and after else local c = object.color diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua index ab9c5d434..aa4ef64df 100644 --- a/tex/context/base/mult-fun.lua +++ b/tex/context/base/mult-fun.lua @@ -51,7 +51,8 @@ return { "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", "space", "CRLF", - "grayscale", "greyscale", "withgray", "withgrey", "colorpart", + "grayscale", "greyscale", "withgray", "withgrey", + "colorpart", "readfile", "clearxy", "unitvector", "center", -- redefined "epsed", "anchored", diff --git a/tex/context/base/mult-mps.lua b/tex/context/base/mult-mps.lua index 2f2c41974..59411cd97 100644 --- a/tex/context/base/mult-mps.lua +++ b/tex/context/base/mult-mps.lua @@ -31,7 +31,7 @@ return { "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", - "withcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", + "withcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "downto", "upto", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", @@ -53,6 +53,9 @@ return { "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "greypart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", + "dashpart", "penpart", +-- "colorpart", + "stroked", "filled", "textual", "clipped", "bounded", "expandafter", }, commands = { diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex ddafd2831..80d982a9e 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex fac4e063e..f060b4e6f 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua index f9e28c879..1bcdd3278 100644 --- a/tex/context/base/status-mkiv.lua +++ b/tex/context/base/status-mkiv.lua @@ -1498,6 +1498,12 @@ return { status = "okay", }, { + category = "mkiv", + filename = "trac-jus", + loading = "always", + status = "okay", + }, + { category = "mkvi", filename = "trac-vis", loading = "always", @@ -4524,6 +4530,12 @@ return { }, { category = "lua", + filename = "trac-jus", + loading = "trac-jus", + status = "okay", + }, + { + category = "lua", filename = "type-ini", loading = "type-ini", status = "okay", diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 37e01996d..8bbcea599 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -99,6 +99,11 @@ appendaction("mvlbuilders", "normalizers", "builders.vspacing.pagehandler") appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler") -- +-- experimental too + +appendaction("mvlbuilders","normalizers","typesetters.checkers.handler") +appendaction("vboxbuilders","normalizers","typesetters.checkers.handler") + -- speedup: only kick in when used disableaction("processors", "fonts.collections.process") @@ -148,6 +153,9 @@ disableaction("finalizers", "builders.paragraphs.tag") disableaction("math", "noads.handlers.tags") disableaction("math", "noads.handlers.italics") +disableaction("mvlbuilders", "typesetters.checkers.handler") +disableaction("vboxbuilders","typesetters.checkers.handler") + freezecallbacks("find_.*_file", "find file using resolver") freezecallbacks("read_.*_file", "read file at once") freezecallbacks("open_.*_file", "open file for reading") diff --git a/tex/context/base/trac-jus.lua b/tex/context/base/trac-jus.lua new file mode 100644 index 000000000..412ede90e --- /dev/null +++ b/tex/context/base/trac-jus.lua @@ -0,0 +1,138 @@ +if not modules then modules = { } end modules ['trac-jus'] = { + version = 1.001, + comment = "companion to trac-jus.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local checkers = typesetters.checkers or { } +typesetters.checkers = checkers + +----- report_justification = logs.reporter("visualize","justification") + +local a_alignstate = attributes.private("alignstate") +local a_justification = attributes.private("justification") + +local tracers = nodes.tracers +local setcolor = tracers.colors.set +local settransparency = tracers.transparencies.set + +local new_rule = nodes.pool.rule +local new_glue = nodes.pool.glue +local new_kern = nodes.pool.kern +local concat_nodes = nodes.concat +local hpack_nodes = node.hpack +local copy_node = node.copy +local get_list_dimensions = node.dimensions +local set_attribute = node.set_attribute +local has_attribute = node.has_attribute +local hlist_code = nodes.nodecodes.hlist + +local tex_set_attribute = tex.setattribute +local unsetvalue = attributes.unsetvalue + +local min_threshold = 0 +local max_threshold = 0 + +local function set(n) + nodes.tasks.enableaction("mvlbuilders", "typesetters.checkers.handler") + nodes.tasks.enableaction("vboxbuilders","typesetters.checkers.handler") + tex_set_attribute(a_justification,n or 1) + function typesetters.checkers.set(n) + tex_set_attribute(a_justification,n or 1) + end +end + +local function reset() + tex_set_attribute(a_justification,unsetvalue) +end + +checkers.set = set +checkers.reset = reset + +function commands.showjustification(n) + set(n) +end + +trackers.register("visualizers.justification", function(v) + if v then + set(1) + else + reset() + end +end) + +function checkers.handler(head) + for current in node.traverse_id(hlist_code,head) do + if has_attribute(current,a_justification,1) then + set_attribute(current,a_justification,0) + local width = current.width + if width > 0 then + local list = current.list + if list then + local naturalwidth, naturalheight, naturaldepth = get_list_dimensions(list) + local delta = naturalwidth - width + if naturalwidth == 0 or delta == 0 then + -- special box + elseif delta >= max_threshold then + local rule = new_rule(delta,naturalheight,naturaldepth) + list = hpack_nodes(list,width,"exactly") + if list.glue_set == 1 then + setcolor(rule,"trace:dr") + settransparency(rule,"trace:dr") + else + setcolor(rule,"trace:db") + settransparency(rule,"trace:db") + end + rule = hpack_nodes(rule) + rule.width = 0 + rule.height = 0 + rule.depth = 0 + current.list = concat_nodes { list, rule } + -- current.list = concat_nodes { list, new_kern(-naturalwidth+width), rule } + elseif delta <= min_threshold then + local alignstate = has_attribute(list,a_alignstate) + if alignstate == 1 then + local rule = new_rule(-delta,naturalheight,naturaldepth) + setcolor(rule,"trace:dc") + settransparency(rule,"trace:dc") + rule = hpack_nodes(rule) + rule.height = 0 + rule.depth = 0 + rule.width = 0 + current.list = nodes.concat { rule, list } + elseif alignstate == 2 then + local rule = new_rule(-delta/2,naturalheight,naturaldepth) + setcolor(rule,"trace:dy") + settransparency(rule,"trace:dy") + rule = hpack_nodes(rule) + rule.width = 0 + rule.height = 0 + rule.depth = 0 + current.list = concat_nodes { copy_node(rule), list, new_kern(delta/2), rule } + elseif alignstate == 3 then + local rule = new_rule(-delta,naturalheight,naturaldepth) + setcolor(rule,"trace:dm") + settransparency(rule,"trace:dm") + rule = hpack_nodes(rule) + rule.height = 0 + rule.depth = 0 + current.list = concat_nodes { list, new_kern(delta), rule } + else + local rule = new_rule(-delta,naturalheight,naturaldepth) + setcolor(rule,"trace:dg") + settransparency(rule,"trace:dg") + rule = hpack_nodes(rule) + rule.height = 0 + rule.depth = 0 + rule.width = 0 + current.list = concat_nodes { list, new_kern(delta), rule } + end + end + end + end + end + end + return head +end diff --git a/tex/context/base/trac-jus.mkiv b/tex/context/base/trac-jus.mkiv new file mode 100644 index 000000000..7a5347da8 --- /dev/null +++ b/tex/context/base/trac-jus.mkiv @@ -0,0 +1,25 @@ +%D \module +%D [ file=trac-jus, +%D version=2112.11.27, +%D title=\CONTEXT\ Tracing Macros, +%D subtitle=Justification, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Tracing Macros / Justification} + +\registerctxluafile{trac-jus}{1.001} + +\unprotect + +\definesystemattribute[justification] [public] + +\unexpanded\def\showjustification + {\ctxcommand{showjustification()}} + +\protect \endinput diff --git a/tex/context/base/util-sql.lua b/tex/context/base/util-sql.lua index 6096ffe7b..fc460b984 100644 --- a/tex/context/base/util-sql.lua +++ b/tex/context/base/util-sql.lua @@ -123,31 +123,29 @@ sql.converters = converters local function makeconverter(entries,celltemplate,wraptemplate) local shortcuts = { } local assignments = { } - local function cell(i) - return format(celltemplate,i,i) - end for i=1,#entries do local entry = entries[i] - local nam = entry.name - local typ = entry.type - if typ == "boolean" then - assignments[i] = format("[%q] = booleanstring(%s),",nam,cell(i)) - elseif typ == "number" then - assignments[i] = format("[%q] = tonumber(%s),",nam,cell(i)) - elseif type(typ) == "function" then + local name = entry.name + local kind = entry.type or entry.kind + local value = format(celltemplate,i,i) + if kind == "boolean" then + assignments[i] = format("[%q] = booleanstring(%s),",name,value) + elseif kind == "number" then + assignments[i] = format("[%q] = tonumber(%s),",name,value) + elseif type(kind) == "function" then local c = #converters + 1 - converters[c] = typ + converters[c] = kind shortcuts[#shortcuts+1] = format("local fun_%s = converters[%s]",c,c) - assignments[i] = format("[%q] = fun_%s(%s),",nam,c,cell(i)) - elseif type(typ) == "table" then + assignments[i] = format("[%q] = fun_%s(%s),",name,c,value) + elseif type(kind) == "table" then local c = #converters + 1 - converters[c] = typ + converters[c] = kind shortcuts[#shortcuts+1] = format("local tab_%s = converters[%s]",c,c) - assignments[i] = format("[%q] = tab_%s[%s],",nam,#converters,cell(i)) - elseif typ == "deserialize" then - assignments[i] = format("[%q] = deserialize(%s),",nam,cell(i)) + assignments[i] = format("[%q] = tab_%s[%s],",name,#converters,value) + elseif kind == "deserialize" then + assignments[i] = format("[%q] = deserialize(%s),",name,value) else - assignments[i] = format("[%q] = %s,",nam,cell(i)) + assignments[i] = format("[%q] = %s,",name,value) end end local code = format(wraptemplate,concat(shortcuts,"\n"),concat(assignments,"\n ")) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 9367a1527..5edda4213 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 11/26/12 13:31:26 +-- merge date : 11/27/12 15:54:44 do -- begin closure to overcome local limits and interference |