summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-10 02:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-10 02:15:05 +0100
commitef78ab8a5c18ea5f94f4e271e8e5f5416708f7a9 (patch)
tree1893bf5b83cda21ff1f84292e3e41a73967066b0 /tex
parent365919ac0f7cfb96d914de12bb6e213db4f64057 (diff)
downloadcontext-ef78ab8a5c18ea5f94f4e271e8e5f5416708f7a9.tar.gz
2015-01-10 00:46:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4385 -> 4383 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/lxml-lpt.lua5
-rw-r--r--tex/context/base/page-mix.mkiv2
-rw-r--r--tex/context/base/spac-chr.lua4
-rw-r--r--tex/context/base/status-files.pdfbin24922 -> 24909 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin333147 -> 333199 bytes
-rw-r--r--tex/context/base/tabl-ntb.mkiv3
-rw-r--r--tex/context/base/typo-inj.mkiv4
-rw-r--r--tex/context/base/typo-sus.lua285
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
12 files changed, 198 insertions, 111 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 4504cef0f..fe4223739 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2015.01.09 10:43}
+\newcontextversion{2015.01.10 00:44}
%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 30da9e238..4f788b0c7 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index c502cb58b..06dd636bd 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2015.01.09 10:43}
+\edef\contextversion{2015.01.10 00:44}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua
index a914c43ca..a38a7a8e2 100644
--- a/tex/context/base/lxml-lpt.lua
+++ b/tex/context/base/lxml-lpt.lua
@@ -1134,7 +1134,6 @@ expressions.print = function(...)
return true
end
-expressions.contains = find
expressions.find = find
expressions.upper = upper
expressions.lower = lower
@@ -1158,6 +1157,10 @@ function expressions.contains(str,pattern)
return false
end
+function xml.expressions.idstring(str)
+ return type(str) == "string" and gsub(str,"^#","") or ""
+end
+
-- user interface
local function traverse(root,pattern,handle)
diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv
index fd72a6b49..ece93c948 100644
--- a/tex/context/base/page-mix.mkiv
+++ b/tex/context/base/page-mix.mkiv
@@ -367,7 +367,7 @@
{\edef\currentmixedcolumns{#1}%
\firstargumentfalse}%
\edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}%
- \mixedcolumnsparameter\c!before\relax % so, it doesn't list to local settings !
+ \mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings !
\csname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax
\begingroup
\iffirstargument
diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua
index 0cdec4b8f..81c0ce98b 100644
--- a/tex/context/base/spac-chr.lua
+++ b/tex/context/base/spac-chr.lua
@@ -112,8 +112,8 @@ local function inject_char_space(unicode,head,current,parent)
end
local function inject_nobreak_space(unicode,head,current,space,spacestretch,spaceshrink)
- local attr = getfield(current,"attr")
- local glue = new_glue(space,spacestretch,spaceshrink)
+ local attr = getfield(current,"attr")
+ local glue = new_glue(space,spacestretch,spaceshrink)
local penalty = new_penalty(10000)
setfield(glue,"attr",attr)
setfield(current,"attr",nil)
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index f65c1abf4..94c0faf0f 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 7fe933655..2ead08753 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv
index 2a36581b5..02fa82835 100644
--- a/tex/context/base/tabl-ntb.mkiv
+++ b/tex/context/base/tabl-ntb.mkiv
@@ -1264,7 +1264,8 @@
\fi}
\unexpanded\def\tabl_ntb_row_align_stop_inject
- {\nointerlineskip
+ {\par
+ \nointerlineskip
\ifenableTBLbreak
\tabl_ntb_after_page
\fi
diff --git a/tex/context/base/typo-inj.mkiv b/tex/context/base/typo-inj.mkiv
index 3ac1c6623..0293f12fa 100644
--- a/tex/context/base/typo-inj.mkiv
+++ b/tex/context/base/typo-inj.mkiv
@@ -69,5 +69,9 @@
{\setuxvalue{typo_injectors_mark_#1}{\dontleavehmode\noexpand\ctxcommand{markinjector("#1")}}%
\setuxvalue{typo_injectors_check_#1}{\noexpand\ctxcommand{checkinjector("#1")}}}
+\unexpanded\def\dotestinjector#1% only for testing outside unprotect
+ {\csname typo_injectors_check_#1\endcsname
+ \csname typo_injectors_mark_#1\endcsname}
+
\protect \endinput
diff --git a/tex/context/base/typo-sus.lua b/tex/context/base/typo-sus.lua
index 6f4947b1f..9eef6196b 100644
--- a/tex/context/base/typo-sus.lua
+++ b/tex/context/base/typo-sus.lua
@@ -20,43 +20,53 @@ local closequote = {
pf = true,
}
-local categories = characters.categories
+local categories = characters.categories
-local nodecodes = nodes.nodecodes
+local nodecodes = nodes.nodecodes
-local glyph_code = nodecodes.glyph
-local kern_code = nodecodes.kern
-local penalty_code = nodecodes.penalty
-local glue_code = nodecodes.glue
-local math_code = nodecodes.math
-local hlist_code = nodecodes.hlist
+local glyph_code = nodecodes.glyph
+local kern_code = nodecodes.kern
+local penalty_code = nodecodes.penalty
+local glue_code = nodecodes.glue
+local math_code = nodecodes.math
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-local tonode = nodes.tonode
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local tonode = nodes.tonode
-local getid = nuts.getid
-local getchar = nuts.getchar
-local getprev = nuts.getprev
-local getnext = nuts.getnext
-local getfield = nuts.getfield
-local getattr = nuts.getattr
-local getfont = nuts.getfont
+local getid = nuts.getid
+local getchar = nuts.getchar
+local getprev = nuts.getprev
+local getnext = nuts.getnext
+local getfield = nuts.getfield
+local getattr = nuts.getattr
+local getfont = nuts.getfont
+local getlist = nuts.getlist
-local setcolor = nodes.tracers.colors.set
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local setfield = nuts.setfield
+local setattr = nuts.setattr
-local nodepool = nuts.pool
+local setcolor = nodes.tracers.colors.set
+local insert_before = nuts.insert_before
+local insert_after = nuts.insert_after
+local end_of_math = nuts.end_of_math
-local new_rule = nodepool.rule
-local new_kern = nodepool.kern
-local new_penalty = nodepool.penalty
+local nodepool = nuts.pool
-local a_characters = attributes.private("characters")
+local new_rule = nodepool.rule
+local new_kern = nodepool.kern
+local new_hlist = nodepool.hlist
+----- new_penalty = nodepool.penalty
-local threshold = 65536 / 4
+local a_characters = attributes.private("characters")
+local a_suspecting = attributes.private('suspecting')
+local a_suspect = attributes.private('suspect')
+local texsetattribute = tex.setattribute
+local enabled = false
+
+local threshold = 65536 / 4
local function special(n)
if n then
@@ -108,19 +118,19 @@ local function mark(head,current,id,color)
head = insert_before(head,current,rule)
head = insert_before(head,current,kern)
setcolor(rule,color)
- elseif id == kern_code then
- local width = getfield(current,"kern")
- local rule = new_rule(width)
- local kern = new_kern(-width)
- head = insert_before(head,current,rule)
- head = insert_before(head,current,kern)
- setcolor(rule,color)
+ -- elseif id == kern_code then
+ -- local width = getfield(current,"kern")
+ -- local rule = new_rule(width)
+ -- local kern = new_kern(-width)
+ -- head = insert_before(head,current,rule)
+ -- head = insert_before(head,current,kern)
+ -- setcolor(rule,color)
else
local width = getfield(current,"width")
- local rule = new_rule(width,getfield(current,"height"),getfield(current,"depth"))
- local kern = new_kern(-width)
- head = insert_before(head,current,rule)
- head = insert_before(head,current,kern)
+ local extra = fonts.hashes.xheights[getfont(current)] / 2
+ local rule = new_rule(width,getfield(current,"height")+extra,getfield(current,"depth")+extra)
+ local hlist = new_hlist(rule)
+ head = insert_before(head,current,hlist)
setcolor(rule,color)
setcolor(current,"white")
end
@@ -131,95 +141,164 @@ end
-- save enough time and it makes the code looks bad too ... after
-- all, we seldom use this
-function typesetters.showsuspects(head)
+local colors = {
+ "darkred",
+ "darkgreen",
+ "darkblue",
+ "darkcyan",
+ "darkmagenta",
+ "darkyellow",
+ "darkgray",
+ "orange",
+}
+
+local found = 0
+
+function typesetters.marksuspects(head)
local head = tonut(head)
local current = head
local lastdone = nil
while current do
- local id = getid(current)
- if id == glyph_code then
- local char = getchar(current)
- local code = categories[char]
- local done = false
- if punctuation[code] then
- local prev, pid = goback(current)
- if prev and pid == glue_code then
- done = "darkblue"
- elseif prev and pid == math_code then
- done = "darkgray"
- else
- local next, nid = goforward(current)
- if next and nid ~= glue_code then
- done = "darkblue"
- end
- end
- elseif openquote[code] then
- local next, nid = goforward(current)
- if next and nid == glue_code then
- done = "darkred"
- end
- elseif closequote[code] then
- local prev, pid = goback(current)
- if prev and pid == glue_code then
- done = "darkred"
- end
- else
- local prev, pid = goback(current)
- if prev then
- if pid == math_code then
- done = "darkgray"
- elseif pid == glyph_code and getfont(current) ~= getfont(prev) then
- if lastdone ~= prev then
- done = "darkgreen"
+ if getattr(current,a_suspecting) then
+ local id = getid(current)
+ if id == glyph_code then
+ local char = getchar(current)
+ local code = categories[char]
+ local done = false
+ if punctuation[code] then
+ local prev, pid = goback(current)
+ if prev and pid == glue_code then
+ done = 3 -- darkblue
+ elseif prev and pid == math_code then
+ done = 3 -- darkblue
+ else
+ local next, nid = goforward(current)
+ if next and nid ~= glue_code then
+ done = 3 -- darkblue
end
end
- end
- if not done then
+ elseif openquote[code] then
local next, nid = goforward(current)
- if next then
- if nid == math_code then
- done = "darkgray"
- elseif nid == glyph_code and getfont(current) ~= getfont(next) then
+ if next and nid == glue_code then
+ done = 1 -- darkred
+ end
+ elseif closequote[code] then
+ local prev, pid = goback(current)
+ if prev and pid == glue_code then
+ done = 1 -- darkred
+ end
+ else
+ local prev, pid = goback(current)
+ if prev then
+ if pid == math_code then
+ done = 7-- darkgray
+ elseif pid == glyph_code and getfont(current) ~= getfont(prev) then
if lastdone ~= prev then
- done = "darkgreen"
+ done = 2 -- darkgreen
+ end
+ end
+ end
+ if not done then
+ local next, nid = goforward(current)
+ if next then
+ if nid == math_code then
+ done = 7 -- darkgray
+ elseif nid == glyph_code and getfont(current) ~= getfont(next) then
+ if lastdone ~= prev then
+ done = 2 -- darkgreen
+ end
end
end
end
end
+ if done then
+ setattr(current,a_suspect,done)
+ lastdone = current
+ found = found + 1
+ end
+ current = getnext(current)
+ elseif id == math_code then
+ current = getnext(end_of_math(current))
+ elseif id == glue_code then
+ local a = getattr(current,a_characters)
+ if a then
+ local prev = getprev(current)
+ local prid = prev and getid(prev)
+ local done = false
+ if prid == penalty_code and getfield(prev,"penalty") == 10000 then
+ done = 8 -- orange
+ else
+ done = 5 -- darkmagenta
+ end
+ if done then
+ setattr(current,a_suspect,done)
+ -- lastdone = current
+ found = found + 1
+ end
+ end
+ current = getnext(current)
+ else
+ current = getnext(current)
end
- if done then
- head = mark(head,current,id,done)
- lastdone = current
- end
+ else
current = getnext(current)
- elseif id == math_code then
- current = getnext(end_of_math(current))
+ end
+ end
+ return tonode(head), found > 0
+end
+
+local function showsuspects(head)
+ local current = head
+ while current do
+ local id = getid(current)
+ if id == glyph_code then
+ local a = getattr(current,a_suspect)
+ if a then
+ head, current = mark(head,current,id,colors[a])
+ end
elseif id == glue_code then
- local a = getattr(current,a_characters)
+ local a = getattr(current,a_suspect)
if a then
- local prev = getprev(current)
- local prid = prev and getid(prev)
- if prid == penalty_code and getfield(prev,"penalty") == 10000 then
- head = mark(head,current,id,"orange")
- head = insert_before(head,current,new_penalty(10000))
- else
- head = mark(head,current,id,"darkmagenta")
+ head, current = mark(head,current,id,colors[a])
+ end
+ elseif id == math_code then
+ current = end_of_math(current)
+ elseif id == hlist_code or id == vlist_code then
+ local list = getlist(current)
+ if list then
+ local l = showsuspects(list)
+ if l ~= list then
+ setfield(current,"list",l)
end
end
- current = getnext(current)
- else
- current = getnext(current)
end
+ current = getnext(current)
end
- return tonode(head), false
+ return head
end
-nodes.tasks.appendaction("processors","after","typesetters.showsuspects")
-nodes.tasks.disableaction("processors","typesetters.showsuspects")
+function typesetters.showsuspects(head)
+ if found > 0 then
+ return tonode(showsuspects(tonut(head))), true
+ else
+ return head, false
+ end
+end
+
+nodes.tasks.appendaction ("processors","after", "typesetters.marksuspects")
+nodes.tasks.prependaction("shipouts", "normalizers","typesetters.showsuspects")
+
+nodes.tasks.disableaction("processors","typesetters.marksuspects")
+nodes.tasks.disableaction("shipouts", "typesetters.showsuspects")
-- or maybe a directive
trackers.register("typesetters.suspects",function(v)
- nodes.tasks.setaction("processors","typesetters.showsuspects",v)
+ texsetattribute(a_suspecting,v and 1 or unsetvalue)
+ if v and not enabled then
+ nodes.tasks.enableaction("processors","typesetters.marksuspects")
+ nodes.tasks.enableaction("shipouts", "typesetters.showsuspects")
+ enabled = true
+ end
end)
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 737aca4f9..3fff3ee0b 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 : 01/09/15 10:43:31
+-- merge date : 01/10/15 00:44:31
do -- begin closure to overcome local limits and interference