summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-04-29 23:51:45 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-04-29 23:51:45 +0200
commit6addefa380c1008fbc164890e8e95dd855a361c5 (patch)
treeec10a53afe218fba3b917a07caca414f2d165044 /tex/context/base/mkiv
parentb79e123941f1d1b3cc13d05ee4d4d37c72c6a253 (diff)
downloadcontext-6addefa380c1008fbc164890e8e95dd855a361c5.tar.gz
2021-04-29 23:07:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/anch-snc.lua4
-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-ots.lua83
-rw-r--r--tex/context/base/mkiv/font-txt.lua532
-rw-r--r--tex/context/base/mkiv/node-dir.lua114
-rw-r--r--tex/context/base/mkiv/node-ini.mkiv1
-rw-r--r--tex/context/base/mkiv/node-tst.lua44
-rw-r--r--tex/context/base/mkiv/node-typ.lua2
-rw-r--r--tex/context/base/mkiv/page-lin.lua1
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin23961 -> 23968 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin224975 -> 225146 bytes
-rw-r--r--tex/context/base/mkiv/task-ini.lua25
13 files changed, 324 insertions, 486 deletions
diff --git a/tex/context/base/mkiv/anch-snc.lua b/tex/context/base/mkiv/anch-snc.lua
index ee13adca3..e7520f88d 100644
--- a/tex/context/base/mkiv/anch-snc.lua
+++ b/tex/context/base/mkiv/anch-snc.lua
@@ -24,8 +24,8 @@ local mpnumeric = mp.numeric
local mppoints = mp.points
local texgetdimen = tex.getdimen
-local p_number = patterns.cardinal/tonumber
-local p_space = patterns.whitespace^0
+local p_number = lpegpatterns.cardinal/tonumber
+local p_space = lpegpatterns.whitespace^0
local p_tag = P("syncpos:") * p_number * P(":") * p_number
local p_option = p_number * ((P(",") * p_space * P("reset") * Cc(true)) + Cc(false)) -- for now
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index cd7b5e90c..18ec52a17 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.04.28 18:34}
+\newcontextversion{2021.04.29 23:04}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 4dd68dcd4..06ea3e597 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.04.28 18:34}
+\edef\contextversion{2021.04.29 23:04}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 56a91dbbb..47e2e93d4 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -4161,49 +4161,60 @@ end
-- so far
-local plugins = { }
-otf.plugins = plugins
-
-local report = logs.reporter("fonts")
-
-function otf.registerplugin(name,f)
- if type(name) == "string" and type(f) == "function" then
- plugins[name] = { name, f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+do
+
+ local plugins = { }
+ otf.plugins = plugins
+
+ local report = logs.reporter("fonts")
+ local warned = false
+ local okay = { text = true }
+
+ function otf.registerplugin(name,f)
+ if type(name) == "string" and type(f) == "function" then
+ plugins[name] = { name, f }
+ if okay[name] then
+ -- no warning (e.g. the diagnostic text plugin)
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned = true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value) == "string" then
- tfmdata.shared.plugin = plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value) == "string" then
+ tfmdata.shared.plugin = plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,attr,direction) -- n
- local s = fontdata[font].shared
- local p = s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction) -- n
+ local s = fontdata[font].shared
+ local p = s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head, false
end
- return p[2](head,font,attr,direction)
- else
- return head, false
end
+
end
function otf.featuresinitializer(tfmdata,value)
diff --git a/tex/context/base/mkiv/font-txt.lua b/tex/context/base/mkiv/font-txt.lua
index 20f290ddb..c52878ca7 100644
--- a/tex/context/base/mkiv/font-txt.lua
+++ b/tex/context/base/mkiv/font-txt.lua
@@ -247,303 +247,307 @@ end
-- users do that. On the other hand, we do support longer glyph runs in both modes
-- so there we gain a bit.
-local function texthandler(head,font,attr,rlmode,handler,startspacing,stopspacing,nesting)
- if not head then
- return
- end
- if startspacing == nil then
- startspacing = false
- end
- if stopspacing == nil then
- stopspacing = false
- end
+do
- if getid(head) == par_code and start_of_par(head) then
- rlmode = pardirstate(head)
- elseif rlmode == righttoleft_code then
- rlmode = -1
- else
- rlmode = 0
- end
-
- local dirstack = { }
- local rlparmode = 0
- local topstack = 0
- local text = { }
- local size = 0
- local current = head
- local start = nil
- local stop = nil
- local startrlmode = rlmode
+ local function texthandler(head,font,dynamic,rlmode,handler,startspacing,stopspacing,nesting)
+ if not head then
+ return
+ end
+ if startspacing == nil then
+ startspacing = false
+ end
+ if stopspacing == nil then
+ stopspacing = false
+ end
- local function handle(leading,trailing) -- what gets passed can become configureable: e.g. utf 8
- local stop = current or start -- hm, what with outer stop
- if getid(stop) ~= glyph_code then
- stop = getprev(stop)
+ if getid(head) == par_code and start_of_par(head) then
+ rlmode = pardirstate(head)
+ elseif rlmode == righttoleft_code then
+ rlmode = -1
+ else
+ rlmode = 0
end
- head = handler(head,font,attr,rlmode,start,stop,text,leading,trailing) -- handler can adapt text
- size = 0
- text = { }
- start = nil
- end
- while current do
- local char, id = ischar(current,font)
- if char then
- if not start then
- start = current
- startrlmode = rlmode
- end
- local char = getchar(current)
- size = size + 1
- text[size] = char
- current = getnext(current)
- elseif char == false then
- -- so a mixed font
- if start and size > 0 then
- handle(startspacing,false)
+ local dirstack = { }
+ local rlparmode = 0
+ local topstack = 0
+ local text = { }
+ local size = 0
+ local current = head
+ local start = nil
+ local stop = nil
+ local startrlmode = rlmode
+
+ local function handle(leading,trailing) -- what gets passed can become configureable: e.g. utf 8
+ local stop = current or start -- hm, what with outer stop
+ if getid(stop) ~= glyph_code then
+ stop = getprev(stop)
end
- startspacing = false
- current = getnext(current)
- elseif id == glue_code then
- -- making this branch optional i.e. always use the else doesn't really
- -- make a difference in performance (in hb) .. tricky anyway as we can
- local width = getwidth(current)
- if width > 0 then
- if start and size > 0 then
- handle(startspacing,true)
+ head = handler(head,font,dynamic,rlmode,start,stop,text,leading,trailing) -- handler can adapt text
+ size = 0
+ text = { }
+ start = nil
+ end
+
+ while current do
+ local char, id = ischar(current,font)
+ if char then
+ if not start then
+ start = current
+ startrlmode = rlmode
end
- startspacing = true
- stopspacing = false
- else
+ local char = getchar(current)
+ size = size + 1
+ text[size] = char
+ current = getnext(current)
+ elseif char == false then
+ -- so a mixed font
if start and size > 0 then
- head = handle(startspacing)
+ handle(startspacing,false)
end
startspacing = false
- stopspacing = false
- end
- current = getnext(current)
- elseif id == disc_code and usesfont(current,font) then -- foo|-|bar : has hbox
- -- This looks much like the original code but I don't see a need to optimize
- -- for e.g. deva or r2l fonts. If there are no disc nodes then we won't see
- -- this branch anyway and if there are, we should just deal with them.
- --
- -- There is still some weird code here ... start/stop and such. When I'm in
- -- the mood (or see a need) I'll rewrite this bit.
+ current = getnext(current)
+ elseif id == glue_code then
+ -- making this branch optional i.e. always use the else doesn't really
+ -- make a difference in performance (in hb) .. tricky anyway as we can
+ local width = getwidth(current)
+ if width > 0 then
+ if start and size > 0 then
+ handle(startspacing,true)
+ end
+ startspacing = true
+ stopspacing = false
+ else
+ if start and size > 0 then
+ head = handle(startspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ end
+ current = getnext(current)
+ elseif id == disc_code and usesfont(current,font) then -- foo|-|bar : has hbox
+ -- This looks much like the original code but I don't see a need to optimize
+ -- for e.g. deva or r2l fonts. If there are no disc nodes then we won't see
+ -- this branch anyway and if there are, we should just deal with them.
+ --
+ -- There is still some weird code here ... start/stop and such. When I'm in
+ -- the mood (or see a need) I'll rewrite this bit.
- -- bug: disc in last word moves to end (in practice not an issue as one
- -- doesn't want a break there)
+ -- bug: disc in last word moves to end (in practice not an issue as one
+ -- doesn't want a break there)
- local pre = nil
- local post = nil
- local currentnext = getnext(current)
- local current_pre, current_post, current_replace = getdisc(current)
- setdisc(current) -- why, we set it later
- if start then
- pre = copy_node_list(start,current)
- stop = getprev(current)
- -- why also current and not:
- -- pre = copy_node_list(start,stop)
- if start == head then
- head = current
+ local pre = nil
+ local post = nil
+ local currentnext = getnext(current)
+ local current_pre, current_post, current_replace = getdisc(current)
+ setdisc(current) -- why, we set it later
+ if start then
+ pre = copy_node_list(start,current)
+ stop = getprev(current)
+ -- why also current and not:
+ -- pre = copy_node_list(start,stop)
+ if start == head then
+ head = current
+ end
+ setlink(getprev(start),current)
+ setlink(stop,current_pre)
+ current_pre = start
+ setprev(current_pre)
+ start = nil
+ stop = nil
+ startrlmode = rlmode
end
- setlink(getprev(start),current)
- setlink(stop,current_pre)
- current_pre = start
- setprev(current_pre)
- start = nil
- stop = nil
- startrlmode = rlmode
- end
- while currentnext do
- local char, id = ischar(currentnext,font)
- if char or id == disc_code then
- stop = currentnext
- currentnext = getnext(currentnext)
- elseif id == glue_code then
- local width = getwidth(currentnext)
- if width and width > 0 then
- stopspacing = true
+ while currentnext do
+ local char, id = ischar(currentnext,font)
+ if char or id == disc_code then
+ stop = currentnext
+ currentnext = getnext(currentnext)
+ elseif id == glue_code then
+ local width = getwidth(currentnext)
+ if width and width > 0 then
+ stopspacing = true
+ else
+ stopspacing = false
+ end
+ break
else
- stopspacing = false
+ break
end
- break
- else
- break
end
- end
- if stop then
- local currentnext = getnext(current)
- local stopnext = getnext(stop)
- post = copy_node_list(currentnext,stopnext)
- if current_post then
- setlink(find_node_tail(current_post),currentnext)
- else
- setprev(currentnext)
- current_post = currentnext
+ if stop then
+ local currentnext = getnext(current)
+ local stopnext = getnext(stop)
+ post = copy_node_list(currentnext,stopnext)
+ if current_post then
+ setlink(find_node_tail(current_post),currentnext)
+ else
+ setprev(currentnext)
+ current_post = currentnext
+ end
+ setlink(current,stopnext)
+ setnext(stop)
+ stop = nil
end
- setlink(current,stopnext)
- setnext(stop)
- stop = nil
- end
- if pre then
- setlink(find_node_tail(pre),current_replace)
- current_replace = pre
- pre = nil
- end
- if post then
- if current_replace then
- setlink(find_node_tail(current_replace),post)
- else
- current_replace = post
+ if pre then
+ setlink(find_node_tail(pre),current_replace)
+ current_replace = pre
+ pre = nil
end
- post = nil
- end
- size = 0 -- hm, ok, start is also nil now
- text = { }
- if current_pre then
- current_pre = texthandler(current_pre,font,attr,rlmode,handler,startspacing,false,"pre")
- end
- if current_post then
- current_post = texthandler(current_post,font,attr,rlmode,handler,false,stopspacing,"post")
- end
- if current_replace then
- current_replace = texthandler(current_replace,font,attr,rlmode,handler,startspacing,stopspacing,"replace")
- end
- startspacing = false
- stopspacing = false
- local cpost = current_post and find_node_tail(current_post)
- local creplace = current_replace and find_node_tail(current_replace)
- local cpostnew = nil
- local creplacenew = nil
- local newcurrent = nil
- while cpost and equalnode(cpost,creplace) do
- cpostnew = cpost
- creplacenew = creplace
- if creplace then
- creplace = getprev(creplace)
+ if post then
+ if current_replace then
+ setlink(find_node_tail(current_replace),post)
+ else
+ current_replace = post
+ end
+ post = nil
end
- cpost = getprev(cpost)
- end
- if cpostnew then
- if cpostnew == current_post then
- current_post = nil
- else
- setnext(getprev(cpostnew))
+ size = 0 -- hm, ok, start is also nil now
+ text = { }
+ if current_pre then
+ current_pre = texthandler(current_pre,font,dynamic,rlmode,handler,startspacing,false,"pre")
end
- flush_list(cpostnew)
- if creplacenew == current_replace then
- current_replace = nil
- else
- setnext(getprev(creplacenew))
+ if current_post then
+ current_post = texthandler(current_post,font,dynamic,rlmode,handler,false,stopspacing,"post")
end
- local c = getnext(current)
- setlink(current,creplacenew)
- local creplacenewtail = find_node_tail(creplacenew)
- setlink(creplacenewtail,c)
- newcurrent = creplacenewtail
- end
- current_post = current_post and deletedisc(current_post)
- current_replace = current_replace and deletedisc(current_replace)
- local cpre = current_pre
- local creplace = current_replace
- local cprenew = nil
- local creplacenew = nil
- while cpre and equalnode(cpre, creplace) do
- cprenew = cpre
- creplacenew = creplace
- if creplace then
- creplace = getnext(creplace)
+ if current_replace then
+ current_replace = texthandler(current_replace,font,dynamic,rlmode,handler,startspacing,stopspacing,"replace")
end
- cpre = getnext(cpre)
- end
- if cprenew then
- cpre = current_pre
- current_pre = getnext(cprenew)
- if current_pre then
- setprev(current_pre)
+ startspacing = false
+ stopspacing = false
+ local cpost = current_post and find_node_tail(current_post)
+ local creplace = current_replace and find_node_tail(current_replace)
+ local cpostnew = nil
+ local creplacenew = nil
+ local newcurrent = nil
+ while cpost and equalnode(cpost,creplace) do
+ cpostnew = cpost
+ creplacenew = creplace
+ if creplace then
+ creplace = getprev(creplace)
+ end
+ cpost = getprev(cpost)
end
- setnext(cprenew)
- flush_list(cpre)
- creplace = current_replace
- current_replace = getnext(creplacenew)
- if current_replace then
- setprev(current_replace)
+ if cpostnew then
+ if cpostnew == current_post then
+ current_post = nil
+ else
+ setnext(getprev(cpostnew))
+ end
+ flush_list(cpostnew)
+ if creplacenew == current_replace then
+ current_replace = nil
+ else
+ setnext(getprev(creplacenew))
+ end
+ local c = getnext(current)
+ setlink(current,creplacenew)
+ local creplacenewtail = find_node_tail(creplacenew)
+ setlink(creplacenewtail,c)
+ newcurrent = creplacenewtail
end
- setlink(getprev(current),creplace)
- if current == head then
- head = creplace
+ current_post = current_post and deletedisc(current_post)
+ current_replace = current_replace and deletedisc(current_replace)
+ local cpre = current_pre
+ local creplace = current_replace
+ local cprenew = nil
+ local creplacenew = nil
+ while cpre and equalnode(cpre, creplace) do
+ cprenew = cpre
+ creplacenew = creplace
+ if creplace then
+ creplace = getnext(creplace)
+ end
+ cpre = getnext(cpre)
end
- setlink(creplacenew,current)
- end
- setdisc(current,current_pre,current_post,current_replace)
- current = currentnext
- else
- if start and size > 0 then
- handle(startspacing,stopspacing)
- end
- startspacing = false
- stopspacing = false
- if id == math_code then
- current = getnext(end_of_math(current))
- elseif id == dir_code then
- startspacing = false
- topstack, rlmode = txtdirstate(current,dirstack,topstack,rlparmode)
- current = getnext(current)
- -- elseif id == par_code and start_of_par(current) then
- -- startspacing = false
- -- rlparmode, rlmode = pardirstate(current)
- -- current = getnext(current)
+ if cprenew then
+ cpre = current_pre
+ current_pre = getnext(cprenew)
+ if current_pre then
+ setprev(current_pre)
+ end
+ setnext(cprenew)
+ flush_list(cpre)
+ creplace = current_replace
+ current_replace = getnext(creplacenew)
+ if current_replace then
+ setprev(current_replace)
+ end
+ setlink(getprev(current),creplace)
+ if current == head then
+ head = creplace
+ end
+ setlink(creplacenew,current)
+ end
+ setdisc(current,current_pre,current_post,current_replace)
+ current = currentnext
else
- current = getnext(current)
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ if id == math_code then
+ current = getnext(end_of_math(current))
+ elseif id == dir_code then
+ startspacing = false
+ topstack, rlmode = txtdirstate(current,dirstack,topstack,rlparmode)
+ current = getnext(current)
+ -- elseif id == par_code and start_of_par(current) then
+ -- startspacing = false
+ -- rlparmode, rlmode = pardirstate(current)
+ -- current = getnext(current)
+ else
+ current = getnext(current)
+ end
end
end
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ return head, true
end
- if start and size > 0 then
- handle(startspacing,stopspacing)
- end
- return head, true
-end
-function fonts.handlers.otf.texthandler(head,font,attr,direction,action)
- if action then
- return texthandler(head,font,attr,direction == righttoleft_code and -1 or 0,action)
- else
- return head, false
+ function fonts.handlers.otf.texthandler(head,font,dynamic,direction,action)
+ if action then
+ return texthandler(head,font,dynamic,direction == righttoleft_code and -1 or 0,action)
+ else
+ return head, false
+ end
end
-end
--- Next comes a tracer plug into context.
+ -- Next comes a tracer plug into context.
-local texthandler = fonts.handlers.otf.texthandler
-local report_text = logs.reporter("otf plugin","text")
-local nofruns = 0
-local nofsnippets = 0
-local f_unicode = string.formatters["%U"]
+ ----- texthandler = fonts.handlers.otf.texthandler
+ local report_text = logs.reporter("otf plugin","text")
+ local nofruns = 0
+ local nofsnippets = 0
+ local f_unicode = string.formatters["%U"]
-local function showtext(head,font,attr,rlmode,start,stop,list,before,after)
- if list then
- nofsnippets = nofsnippets + 1
- local plus = { }
- for i=1,#list do
- local u = list[i]
- list[i] = utfchar(u)
- plus[i] = f_unicode(u)
+ local function showtext(head,font,dynamic,rlmode,start,stop,list,before,after)
+ if list then
+ nofsnippets = nofsnippets + 1
+ local plus = { }
+ for i=1,#list do
+ local u = list[i]
+ list[i] = utfchar(u)
+ plus[i] = f_unicode(u)
+ end
+ report_text("%03i : [%s] %t [%s]-> % t", nofsnippets, before and "+" or "-", list, after and "+" or "-", plus)
+ else
+ report_text()
+ report_text("invalid list")
+ report_text()
end
- report_text("%03i : [%s] %t [%s]-> % t", nofsnippets, before and "+" or "-", list, after and "+" or "-", plus)
- else
- report_text()
- report_text("invalid list")
- report_text()
+ return head, false
end
- return head, false
-end
-fonts.handlers.otf.registerplugin("text",function(head,font,attr,direction)
- nofruns = nofruns + 1
- nofsnippets = 0
- report_text("start run %i",nofruns)
- local h, d = texthandler(head,font,attr,direction,showtext)
- report_text("stop run %i",nofruns)
- return h, d
-end)
+ fonts.handlers.otf.registerplugin("text",function(head,font,dynamic,direction)
+ nofruns = nofruns + 1
+ nofsnippets = 0
+ report_text("start run %i",nofruns)
+ local h, d = texthandler(head,font,dynamic,direction,showtext)
+ report_text("stop run %i",nofruns)
+ return h, d
+ end)
+
+end
diff --git a/tex/context/base/mkiv/node-dir.lua b/tex/context/base/mkiv/node-dir.lua
deleted file mode 100644
index 762f20739..000000000
--- a/tex/context/base/mkiv/node-dir.lua
+++ /dev/null
@@ -1,114 +0,0 @@
-if not modules then modules = { } end modules ['node-dir'] = {
- version = 1.001,
- comment = "companion to node-ini.mkiv",
- author = "Hans Hagen",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local nodes = nodes
-local nuts = nodes.nuts
-
-local normaldir_code = nodes.dircodes.normal
-local line_code = nodes.listcodes.line
-local lefttoright_code = nodes.dirvalues.lefttoright
-
-local getnext = nuts.getnext
-local getlist = nuts.getlist
-local getwhd = nuts.getwhd
-local getdirection = nuts.getdirection
-
-local setlist = nuts.setlist
-
-local nextdir = nuts.traversers.dir
-local nexthlist = nuts.traversers.hlist
-
-local rangedimensions = nuts.rangedimensions
-local insert_before = nuts.insert_before
-
-local new_rule = nuts.pool.rule
-local new_kern = nuts.pool.kern
-
-local setcolor = nodes.tracers.colors.set
-local settransparency = nodes.tracers.transparencies.set
-
--- local function dirdimensions(parent,begindir) -- can be a helper
--- local level = 1
--- local enddir = begindir
--- local width = 0
--- for current, subtype in nextdir, getnext(begindir) do
--- if subtype == normaldir_code then -- todo
--- level = level + 1
--- else
--- level = level - 1
--- end
--- if level == 0 then -- does the type matter
--- enddir = current
--- width = rangedimensions(parent,begindir,enddir)
--- return width, enddir
--- end
--- end
--- if enddir == begindir then
--- width = rangedimensions(parent,begindir)
--- end
--- return width, enddir
--- end
-
-local function dirdimensions(parent,begindir) -- can be a helper
- local level = 1
- local lastdir = nil
- local width = 0
- for current, subtype in nextdir, getnext(begindir) do
- if subtype == normaldir_code then -- todo
- level = level + 1
- else
- level = level - 1
- end
- if level == 0 then -- does the type matter
- return (rangedimensions(parent,begindir,current)), current
- end
- end
- return (rangedimensions(parent,begindir)), begindir
-end
-
-nuts.dirdimensions = dirdimensions
-
-local function colorit(list,current,dir,w,h,d)
- local rule = new_rule(w,h,d)
- local kern = new_kern(-w)
- local color = dir == lefttoright_code and "trace:s" or "trace:o"
- setcolor(rule,color)
- settransparency(rule,color)
- list, current = insert_before(list,current,kern)
- list, current = insert_before(list,current,rule)
- return list, current
-end
-
-function nodes.tracers.directions(head)
- for hlist, subtype in nexthlist, head do
- if subtype == line_code then
- local list = getlist(hlist)
- local w, h, d = getwhd(hlist)
- list = colorit(list,list,getdirection(hlist),w,h,d)
- for current in nextdir, list do
- local dir, cancel = getdirection(current)
- if not cancel then
- local width = dirdimensions(hlist,current)
- list = colorit(list,current,dir,width,h,d)
- end
- end
- setlist(hlist,list)
- end
- end
- return head
-end
-
-local enabled = false
-
-trackers.register("nodes.directions", function(v)
- if not enabled then
- enabled = true
- nodes.tasks.appendaction("finalizers","after","nodes.tracers.directions",nil,"nut","enabled")
- end
- nodes.tasks.setaction(v)
-end)
diff --git a/tex/context/base/mkiv/node-ini.mkiv b/tex/context/base/mkiv/node-ini.mkiv
index 072cb319a..38ec753cd 100644
--- a/tex/context/base/mkiv/node-ini.mkiv
+++ b/tex/context/base/mkiv/node-ini.mkiv
@@ -29,7 +29,6 @@
\registerctxluafile{node-snp}{}
\registerctxluafile{node-tsk}{}
\registerctxluafile{node-tex}{}
-\registerctxluafile{node-dir}{} % experimental, not yet (and maybe never) used
\registerctxluafile{node-pro}{}
\registerctxluafile{node-ser}{}
%registerctxluafile{node-ext}{}
diff --git a/tex/context/base/mkiv/node-tst.lua b/tex/context/base/mkiv/node-tst.lua
index 0dacff375..c28086f81 100644
--- a/tex/context/base/mkiv/node-tst.lua
+++ b/tex/context/base/mkiv/node-tst.lua
@@ -16,11 +16,7 @@ local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
local kern_code = nodecodes.kern
local glyph_code = nodecodes.glyph
-local whatsit_code = nodecodes.whatsit
-local hlist_code = nodecodes.hlist
-local leftskip_code = gluecodes.leftskip
-local rightskip_code = gluecodes.rightskip
local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip
local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip
@@ -35,52 +31,16 @@ local getkern = nuts.getkern
local getpenalty = nuts.getpenalty
local getwidth = nuts.getwidth
-local find_node_tail = nuts.tail
-
-function nuts.leftmarginwidth(n) -- todo: three values
- while n do
- local id = getid(n)
- if id == glue_code then
- return getsubtype(n) == leftskip_code and getwidth(n) or 0
- elseif id == whatsit_code then
- n = getnext(n)
- elseif id == hlist_code then
- return getwidth(n)
- else
- break
- end
- end
- return 0
-end
-
-function nuts.rightmarginwidth(n)
- if n then
- n = find_node_tail(n)
- while n do
- local id = getid(n)
- if id == glue_code then
- return getsubtype(n) == rightskip_code and getwidth(n) or 0
- elseif id == whatsit_code then
- n = getprev(n)
- else
- break
- end
- end
- end
- return false
-end
-
function nuts.somespace(n,all)
if n then
local id = getid(n)
if id == glue_code then
return (all or (getwidth(n) ~= 0)) and glue_code -- temp: or 0
elseif id == kern_code then
- return (all or (getkern(n) ~= 0)) and kern
+ return (all or (getkern(n) ~= 0)) and kern_code
elseif id == glyph_code then
- local category = chardata[getchar(n)].category
-- maybe more category checks are needed
- return (category == "zs") and glyph_code
+ return (chardata[getchar(n)].category == "zs") and glyph_code
end
end
return false
diff --git a/tex/context/base/mkiv/node-typ.lua b/tex/context/base/mkiv/node-typ.lua
index adf0d18c0..2f00c9413 100644
--- a/tex/context/base/mkiv/node-typ.lua
+++ b/tex/context/base/mkiv/node-typ.lua
@@ -107,7 +107,7 @@ local function tohbox(str,fontid,spacing)
end
local function tovpack(str,fontid,spacing)
- -- vpack is just a hack, and a proper implemtation is on the agenda
+ -- vpack is just a hack, and a proper implementation is on the agenda
-- as it needs more info etc than currently available
return vpack_node_list(tonodes(str,fontid,spacing))
end
diff --git a/tex/context/base/mkiv/page-lin.lua b/tex/context/base/mkiv/page-lin.lua
index 06983ef5c..d3ff2cdad 100644
--- a/tex/context/base/mkiv/page-lin.lua
+++ b/tex/context/base/mkiv/page-lin.lua
@@ -84,7 +84,6 @@ local nextvlist = nuts.traversers.vlist
local copy_node = nuts.copy
----- hpack_nodes = nuts.hpack
local is_display_math = nuts.is_display_math
-local leftmarginwidth = nuts.leftmarginwidth
----- nodepool = nuts.pool
----- new_kern = nodepool.kern
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 54187bc87..88bc8d7fb 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 e12630a56..e02a4f376 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/task-ini.lua b/tex/context/base/mkiv/task-ini.lua
index 82149ef02..4e94648e3 100644
--- a/tex/context/base/mkiv/task-ini.lua
+++ b/tex/context/base/mkiv/task-ini.lua
@@ -26,12 +26,6 @@ local freezecallbacks = callbacks.freeze
------------("processors", "before", "nodes.properties.attach", nil, "nut", "enabled" )
-if CONTEXTLMTXMODE > 0 then
-
-appendaction("processors", "normalizers", "builders.kernel.collapsing", nil, "nut", "enabled" )
-
-end
-
appendaction("processors", "normalizers", "typesetters.periodkerns.handler", nil, "nut", "disabled" )
appendaction("processors", "normalizers", "languages.replacements.handler", nil, "nut", "disabled" )
appendaction("processors", "normalizers", "typesetters.wrappers.handler", nil, "nut", "disabled" )
@@ -71,13 +65,8 @@ appendaction("processors", "lists", "typesetters.kerns.handler",
appendaction("processors", "lists", "typesetters.digits.handler", nil, "nut", "disabled" )
appendaction("processors", "lists", "typesetters.italics.handler", nil, "nut", "disabled" )
appendaction("processors", "lists", "languages.visualizediscretionaries", nil, "nut", "disabled" )
-
-if CONTEXTLMTXMODE == 0 then
-
appendaction("processors", "lists", "nodes.handlers.migrate", nil, "nut", "disabled" )
-end
-
appendaction("processors", "after", "typesetters.marksuspects", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "nodes.handlers.cleanuppage", nil, "nut", "production")
@@ -131,14 +120,9 @@ appendaction("math", "builders", "typesetters.directions.processmath"
appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
appendaction("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
-if CONTEXTLMTXMODE == 0 then
-
appendaction("finalizers", "lists", "typesetters.paragraphs.normalize", nil, "nut", "enabled" ) -- "disabled"
-
-end
-
-appendaction("finalizers", "lists", "nodes.handlers.showhyphenation", nil, "nut", "disabled" )
-appendaction("finalizers", "lists", "nodes.handlers.visualizehyphenation", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "nodes.handlers.showhyphenation", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "nodes.handlers.visualizehyphenation", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "typesetters.margins.localhandler", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "builders.paragraphs.keeptogether", nil, "nut", "disabled" )
@@ -150,11 +134,6 @@ appendaction("finalizers", "lists", "nodes.linefillers.handler",
appendaction("contributers", "normalizers", "nodes.handlers.flattenline", nil, "nut", "disabled" )
appendaction("contributers", "normalizers", "nodes.handlers.textbackgrounds", nil, "nut", "disabled" )
-if CONTEXTLMTXMODE > 0 then
-
-appendaction("contributers", "normalizers", "nodes.handlers.wipe", nil, "nut", "disabled" )
-
-end
appendaction("vboxbuilders", "normalizers", "nodes.handlers.backgroundsvbox", nil, "nut", "disabled" )
------------("vboxbuilders", "normalizers", "typesetters.margins.localhandler", nil, "nut", "disabled" )