summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-11-27 17:20:14 +0200
committerMarius <mariausol@gmail.com>2012-11-27 17:20:14 +0200
commitd6a644d5e4a6689051cabe2352c28458e2fc7a99 (patch)
tree100ab76339c24cbda56cf123b181d15d84f8e9f0 /tex
parent48c4609c92a6e0cbbbd8c5e894d2e11b081e032f (diff)
downloadcontext-d6a644d5e4a6689051cabe2352c28458e2fc7a99.tar.gz
beta 2012.11.27 15:54
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4149 -> 4151 bytes
-rw-r--r--tex/context/base/context-version.pngbin40624 -> 40668 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv3
-rw-r--r--tex/context/base/mlib-pps.lua20
-rw-r--r--tex/context/base/mult-fun.lua3
-rw-r--r--tex/context/base/mult-mps.lua5
-rw-r--r--tex/context/base/status-files.pdfbin24569 -> 24544 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin198842 -> 198958 bytes
-rw-r--r--tex/context/base/status-mkiv.lua12
-rw-r--r--tex/context/base/task-ini.lua8
-rw-r--r--tex/context/base/trac-jus.lua138
-rw-r--r--tex/context/base/trac-jus.mkiv25
-rw-r--r--tex/context/base/util-sql.lua34
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
17 files changed, 228 insertions, 28 deletions
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
index f8855c59a..42384dd98 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index db92e1e14..6224e84c5 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index 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
index ddafd2831..80d982a9e 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index fac4e063e..f060b4e6f 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
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