diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-07-30 22:18:52 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-07-30 22:18:52 +0200 |
commit | 4afd5f6ad89594e3d8387b2acebefb6f37cb0cad (patch) | |
tree | 9abee55308a1442c61d3fd47f6f04549cebb06fd /tex | |
parent | 488dc02c27841eced466d9b6594666c923fef649 (diff) | |
download | context-4afd5f6ad89594e3d8387b2acebefb6f37cb0cad.tar.gz |
2017-07-30 19:35:00
Diffstat (limited to 'tex')
66 files changed, 136 insertions, 202 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 270ec5086..e16fe93de 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.07.29 23:08} +\newcontextversion{2017.07.30 19:30} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index a6d1ac5d8..ab6dfc97f 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2017.07.29 23:08} +\edef\contextversion{2017.07.30 19:30} %D For those who want to use this: diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua index 2ba9e2420..16ecf7990 100644 --- a/tex/context/base/mkiv/anch-pos.lua +++ b/tex/context/base/mkiv/anch-pos.lua @@ -56,8 +56,6 @@ local setmetatablenewindex = table.setmetatablenewindex local nuts = nodes.nuts -local getfield = nuts.getfield -local setfield = nuts.setfield local setlink = nuts.setlink local getlist = nuts.getlist local setlist = nuts.setlist diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua index 0b27b0541..8210a2a20 100644 --- a/tex/context/base/mkiv/back-exp.lua +++ b/tex/context/base/mkiv/back-exp.lua @@ -121,7 +121,6 @@ local getdisc = nuts.getdisc local getcomponents = nuts.getcomponents local getlist = nuts.getlist local getid = nuts.getid -local getfield = nuts.getfield local getattr = nuts.getattr local setattr = nuts.setattr -- maybe use properties local isglyph = nuts.isglyph diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 8db3813cb..8bf5e895c 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.07.29 23:08} +\newcontextversion{2017.07.30 19:30} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 4685eef17..945fb9c27 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -41,7 +41,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.07.29 23:08} +\edef\contextversion{2017.07.30 19:30} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-chk.lua b/tex/context/base/mkiv/font-chk.lua index 5630892fe..3126a8fe8 100644 --- a/tex/context/base/mkiv/font-chk.lua +++ b/tex/context/base/mkiv/font-chk.lua @@ -62,7 +62,6 @@ local tonode = nuts.tonode local getfont = nuts.getfont local getchar = nuts.getchar -local setfield = nuts.setfield local setchar = nuts.setchar local traverse_id = nuts.traverse_id diff --git a/tex/context/base/mkiv/font-col.lua b/tex/context/base/mkiv/font-col.lua index 8c96202ec..ff49ef854 100644 --- a/tex/context/base/mkiv/font-col.lua +++ b/tex/context/base/mkiv/font-col.lua @@ -23,7 +23,6 @@ local tonut = nuts.tonut local getfont = nuts.getfont local getchar = nuts.getchar -local setfield = nuts.setfield local setfont = nuts.setfont local traverse_id = nuts.traverse_id diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index eabd1d435..53683c491 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -75,8 +75,6 @@ local aglunicodes = nil -- delayed loading local nuts = nodes.nuts local tonut = nuts.tonut -local getfield = nuts.getfield -local setfield = nuts.setfield local getattr = nuts.getattr local setattr = nuts.setattr local getprop = nuts.getprop diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua index c70763e6b..0df121a31 100644 --- a/tex/context/base/mkiv/font-nod.lua +++ b/tex/context/base/mkiv/font-nod.lua @@ -69,7 +69,6 @@ local getkern = nuts.getkern local getdir = nuts.getdir local getwidth = nuts.getwidth -local setfield = nuts.setfield local setbox = nuts.setbox local setchar = nuts.setchar local setsubtype = nuts.setsubtype diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua index e11fbd4bd..5ab9dd12b 100644 --- a/tex/context/base/mkiv/font-otj.lua +++ b/tex/context/base/mkiv/font-otj.lua @@ -68,7 +68,6 @@ local nodepool = nuts.pool local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua index fa779a6af..92c6b96bf 100644 --- a/tex/context/base/mkiv/font-ots.lua +++ b/tex/context/base/mkiv/font-ots.lua @@ -175,7 +175,6 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local setnext = nuts.setnext local getprev = nuts.getprev @@ -1951,6 +1950,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipped) done = true if n and n > 1 and i + n > nofchainlookups then -- this is a safeguard, we just ignore the rest of the lookups +i = size -- prevents an advance break end end @@ -2333,7 +2333,7 @@ end -- tests because they have many steps with one context (having multiple contexts makes more sense) -- also because we (can) reduce them. -local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) +local function traditional_handle_contextchain(head,start,dataset,sequence,contexts,rlmode) local sweepnode = sweepnode local sweeptype = sweeptype local currentfont = currentfont @@ -3336,18 +3336,22 @@ local function optimized_handle_contextchain(head,start,dataset,sequence,context return head, start, done end +------------------------------ + +local handle_contextchain = traditional_handle_contextchain + directives.register("otf.optimizechains",function(v) if v then report_chain() report_chain("using experimental optimized code") report_chain() end - local handle = v and optimized_handle_contextchain or handle_contextchain - handlers.gsub_context = handle - handlers.gsub_contextchain = handle - handlers.gsub_reversecontextchain = handle - handlers.gpos_contextchain = handle - handlers.gpos_context = handle + handle_contextchain = v and optimized_handle_contextchain or traditional_handle_contextchain + handlers.gsub_context = handle_contextchain + handlers.gsub_contextchain = handle_contextchain + handlers.gsub_reversecontextchain = handle_contextchain + handlers.gpos_contextchain = handle_contextchain + handlers.gpos_context = handle_contextchain end) ------------------------------ @@ -3375,6 +3379,8 @@ chainprocs.gsub_reversecontextchain = chained_contextchain chainprocs.gpos_contextchain = chained_contextchain chainprocs.gpos_context = chained_contextchain +------------------------------ + -- experiment (needs no handler in font-otc so not now): -- -- function otf.registerchainproc(name,f) diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua index 50150d9e2..0dfb1ce08 100644 --- a/tex/context/base/mkiv/lang-dis.lua +++ b/tex/context/base/mkiv/lang-dis.lua @@ -19,7 +19,6 @@ local setaction = tasks.setaction local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev diff --git a/tex/context/base/mkiv/lang-rep.lua b/tex/context/base/mkiv/lang-rep.lua index 6fde353f7..f7eeefdba 100644 --- a/tex/context/base/mkiv/lang-rep.lua +++ b/tex/context/base/mkiv/lang-rep.lua @@ -51,8 +51,6 @@ local getid = nuts.getid local getchar = nuts.getchar local isglyph = nuts.isglyph -local setfield = nuts.setfield -local getfield = nuts.getfield local setattr = nuts.setattr local setlink = nuts.setlink local setnext = nuts.setnext diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua index 9d33df6f3..163e50b48 100644 --- a/tex/context/base/mkiv/lpdf-tag.lua +++ b/tex/context/base/mkiv/lpdf-tag.lua @@ -64,7 +64,6 @@ local getprev = nuts.getprev local getnext = nuts.getnext local getlist = nuts.getlist -local setfield = nuts.setfield local setlink = nuts.setlink local setlist = nuts.setlist diff --git a/tex/context/base/mkiv/math-dir.lua b/tex/context/base/mkiv/math-dir.lua index cba991b84..759f1e797 100644 --- a/tex/context/base/mkiv/math-dir.lua +++ b/tex/context/base/mkiv/math-dir.lua @@ -33,7 +33,6 @@ local getid = nuts.getid local getlist = nuts.getlist local getattr = nuts.getattr -local setfield = nuts.setfield local setchar = nuts.setchar local setlist = nuts.setlist diff --git a/tex/context/base/mkiv/math-tag.lua b/tex/context/base/mkiv/math-tag.lua index 9bb1f1428..a967ed3e8 100644 --- a/tex/context/base/mkiv/math-tag.lua +++ b/tex/context/base/mkiv/math-tag.lua @@ -33,6 +33,10 @@ local setattr = nuts.setattr local getcomponents = nuts.getcomponents local getwidth = nuts.getwidth +local getnucleus = nuts.getnucleus +local getsub = nuts.getsub +local getsup = nuts.getsup + local set_attributes = nuts.setattributes local traverse_nodes = nuts.traverse @@ -100,9 +104,9 @@ local function processsubsup(start) -- At some point we might need to add an attribute signaling the -- super- and subscripts because TeX and MathML use a different -- order. The mrows are needed to keep mn's separated. - local nucleus = getfield(start,"nucleus") - local sup = getfield(start,"sup") - local sub = getfield(start,"sub") + local nucleus = getnucleus(start) + local sup = getsup(start) + local sub = getsub(start) if sub then if sup then setattr(start,a_tagged,start_tagged("msubsup")) diff --git a/tex/context/base/mkiv/node-acc.lua b/tex/context/base/mkiv/node-acc.lua index c3400c752..1cbf82b70 100644 --- a/tex/context/base/mkiv/node-acc.lua +++ b/tex/context/base/mkiv/node-acc.lua @@ -22,7 +22,6 @@ local getlist = nuts.getlist local getchar = nuts.getchar local getnext = nuts.getnext -local setfield = nuts.setfield local setattr = nuts.setattr local setlink = nuts.setlink local setchar = nuts.setchar diff --git a/tex/context/base/mkiv/node-bck.lua b/tex/context/base/mkiv/node-bck.lua index abb025b74..4ed5abe5e 100644 --- a/tex/context/base/mkiv/node-bck.lua +++ b/tex/context/base/mkiv/node-bck.lua @@ -26,7 +26,6 @@ local nodepool = nuts.pool local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua index 5d01f6e5a..330d2fe31 100644 --- a/tex/context/base/mkiv/node-fin.lua +++ b/tex/context/base/mkiv/node-fin.lua @@ -19,7 +19,6 @@ local nuts = nodes.nuts local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid @@ -395,7 +394,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes if leader then -- begin nested if nstrigger and getattr(stack,nstrigger) then - local outer = getatribute(stack,attribute) + local outer = getattr(stack,attribute) if outer ~= inheritance then local list, ok = selective(attribute,leader,inheritance,outer) if leader ~= list then diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua index c0d7eecc8..888e61cdb 100644 --- a/tex/context/base/mkiv/node-fnt.lua +++ b/tex/context/base/mkiv/node-fnt.lua @@ -57,7 +57,6 @@ local getfield = nuts.getfield local setchar = nuts.setchar local setlink = nuts.setlink local setnext = nuts.setnext -local setfield = nuts.setfield local setprev = nuts.setprev local isglyph = nuts.isglyph -- unchecked diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua index 87df5d5b2..54c3c7f9f 100644 --- a/tex/context/base/mkiv/node-nut.lua +++ b/tex/context/base/mkiv/node-nut.lua @@ -117,99 +117,85 @@ nodes.tonut = tonut -- getters -if not direct.getwhd then - local getfield = direct.getfield - function direct.getwhd(n) - return getfield(n,"width"), getfield(n,"height"), getfield(n,"depth") - end -end - -if not direct.setwhd then - local setfield = direct.setfield - function direct.setwhd(n,w,h,d) - setfield(n,"width",w or 0) - setfield(n,"height",h or 0) - setfield(n,"depth",d or 0) - end -end - -if not direct.getcomponents then - - local getfield = direct.getfield - local setfield = direct.setfield - local setsubtype = direct.setsubtype - - local attributelist_code = nodecodes.attributelist - - function direct.getcomponents(n) return getfield(n,"components") end - function direct.setcomponents(n,c) setfield(n,"components",c) end - function direct.getkern(n) return getfield(n,"kern") end - function direct.getwidth(n) return getfield(n,"width") end - function direct.setwidth(n,w) return setfield(n,"width",w) end - function direct.getheight(n) return getfield(n,"height") end - function direct.setheight(n,h) return setfield(n,"height",h) end - function direct.getdepth(n) return getfield(n,"depth") end - function direct.setdepth(n,d) return setfield(n,"depth",d) end - function direct.getshift(n) return getfield(n,"shift") end - function direct.setshift(n,s) return setfield(n,"shift",s) end - function direct.getpenalty(n) return getfield(n,"penalty") end - function direct.setpenalty(n,p) setfield(n,"penalty",p) end - function direct.getdir(n) return getfield(n,"dir") end - function direct.setdir(n,p) setfield(n,"dir",p) end - function direct.getlanguage(n) return getfield(n,"lang") end - function direct.setlanguage(n,l) return setfield(n,"lang",l) end - function direct.getattributelist(n) getfield(n,"attr") end - - function direct.getnucleus(n) return getfield(n,"nucleus") end - function direct.setnucleus(n,p) return setfield(n,"nucleus",p) end - function direct.getsup(n) return getfield(n,"sup") end - function direct.setsup(n,p) return setfield(n,"sup",p) end - function direct.getsub(n) return getfield(n,"sub") end - function direct.setsub(n,p) return setfield(n,"sub",p) end - - function direct.setattributelist(n,a) - if a and type(a) ~= attributelist_code then - a = getfield(a,"attr") - end - setfield(n,"attr",a) - end - - function direct.setkern(n,k,s) - setfield(n,"kern",k) - if s then - setsubtype(n,s) - end - end - - function direct.setfont(n,f,c) - setfield(n,"font",f) - if c then - setfield(n,"char",f) - end - end - - function direct.getoffsets(n) - return getfield(n,"xoffset"), getfield(n,"yoffset") - end - - function direct.setoffsets(n,x,y) - if x then - setfield(n,"xoffset",x) - end - if y then - setfield(n,"yoffset",y) - end - end - -end - -if LUATEXVERSION < 1.005 then - local getfield = direct.getfield - function direct.getnucleus(n) return getfield(n,"nucleus") end - function direct.getsub (n) return getfield(n,"sub") end - function direct.getsup (n) return getfield(n,"sup") end -end +-- if not direct.getcomponents then +-- +-- local getfield = direct.getfield +-- local setfield = direct.setfield +-- local setsubtype = direct.setsubtype +-- +-- local attributelist_code = nodecodes.attributelist +-- +-- function direct.getcomponents(n) return getfield(n,"components") end +-- function direct.setcomponents(n,c) setfield(n,"components",c) end +-- function direct.getkern(n) return getfield(n,"kern") end +-- function direct.getwidth(n) return getfield(n,"width") end +-- function direct.setwidth(n,w) return setfield(n,"width",w) end +-- function direct.getheight(n) return getfield(n,"height") end +-- function direct.setheight(n,h) return setfield(n,"height",h) end +-- function direct.getdepth(n) return getfield(n,"depth") end +-- function direct.setdepth(n,d) return setfield(n,"depth",d) end +-- function direct.getshift(n) return getfield(n,"shift") end +-- function direct.setshift(n,s) return setfield(n,"shift",s) end +-- function direct.getpenalty(n) return getfield(n,"penalty") end +-- function direct.setpenalty(n,p) setfield(n,"penalty",p) end +-- function direct.getdir(n) return getfield(n,"dir") end +-- function direct.setdir(n,p) setfield(n,"dir",p) end +-- function direct.getlanguage(n) return getfield(n,"lang") end +-- function direct.setlanguage(n,l) return setfield(n,"lang",l) end +-- function direct.getattributelist(n) getfield(n,"attr") end +-- +-- function direct.getnucleus(n) return getfield(n,"nucleus") end +-- function direct.setnucleus(n,p) return setfield(n,"nucleus",p) end +-- function direct.getsup(n) return getfield(n,"sup") end +-- function direct.setsup(n,p) return setfield(n,"sup",p) end +-- function direct.getsub(n) return getfield(n,"sub") end +-- function direct.setsub(n,p) return setfield(n,"sub",p) end +-- +-- function direct.setattributelist(n,a) +-- if a and type(a) ~= attributelist_code then +-- a = getfield(a,"attr") +-- end +-- setfield(n,"attr",a) +-- end +-- +-- function direct.setkern(n,k,s) +-- setfield(n,"kern",k) +-- if s then +-- setsubtype(n,s) +-- end +-- end +-- +-- function direct.setfont(n,f,c) +-- setfield(n,"font",f) +-- if c then +-- setfield(n,"char",f) +-- end +-- end +-- +-- function direct.getoffsets(n) +-- return getfield(n,"xoffset"), getfield(n,"yoffset") +-- end +-- +-- function direct.setoffsets(n,x,y) +-- if x then +-- setfield(n,"xoffset",x) +-- end +-- if y then +-- setfield(n,"yoffset",y) +-- end +-- end +-- +-- end +-- +-- if LUATEXVERSION < 1.005 then +-- local getfield = direct.getfield +-- function direct.getnucleus(n) return getfield(n,"nucleus") end +-- function direct.getsub (n) return getfield(n,"sub") end +-- function direct.getsup (n) return getfield(n,"sup") end +-- end +-- -- some tracing: +-- -- local hash = table.setmetatableindex("number") -- local ga = direct.get_attribute -- function direct.get_attribute(n,a) @@ -219,7 +205,7 @@ end -- function nuts.reportattr() -- inspect(hash) -- end - +-- -- local function track(name) -- local n = 0 -- local f = nuts[name] diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua index f2f660e67..a0dc7e793 100644 --- a/tex/context/base/mkiv/node-ref.lua +++ b/tex/context/base/mkiv/node-ref.lua @@ -51,7 +51,6 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local setlink = nuts.setlink local setnext = nuts.setnext local setprev = nuts.setprev diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua index 316c3fded..ad0a1d706 100644 --- a/tex/context/base/mkiv/node-rul.lua +++ b/tex/context/base/mkiv/node-rul.lua @@ -28,7 +28,6 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local setnext = nuts.setnext local setprev = nuts.setprev local setlink = nuts.setlink diff --git a/tex/context/base/mkiv/node-shp.lua b/tex/context/base/mkiv/node-shp.lua index 216e6462a..86d08098d 100644 --- a/tex/context/base/mkiv/node-shp.lua +++ b/tex/context/base/mkiv/node-shp.lua @@ -37,7 +37,6 @@ local tonode = nuts.tonode local remove_node = nuts.remove local traverse_nodes = nuts.traverse -local getfield = nuts.getfield local setfield = nuts.setfield local setlink = nuts.setlink local setprev = nuts.setprev diff --git a/tex/context/base/mkiv/node-tra.lua b/tex/context/base/mkiv/node-tra.lua index 8c79e0ab8..d5165c50b 100644 --- a/tex/context/base/mkiv/node-tra.lua +++ b/tex/context/base/mkiv/node-tra.lua @@ -38,7 +38,6 @@ local nuts = nodes.nuts local tonut = nuts.tonut local tonode = nuts.tonode -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid @@ -376,8 +375,7 @@ local f_z_f = formatters["%0.5Fpt minus %0.5F%s"] local f_z_m = formatters["%0.5Fpt minus %0.5Fpt"] local f_z_z = formatters["%0.5Fpt"] -local tonut = nodes.tonut -local getfield = nodes.nuts.getfield +local tonut = nodes.tonut local function nodetodimen(n) n = tonut(n) diff --git a/tex/context/base/mkiv/node-tst.lua b/tex/context/base/mkiv/node-tst.lua index 1109f28a3..7ad35bd71 100644 --- a/tex/context/base/mkiv/node-tst.lua +++ b/tex/context/base/mkiv/node-tst.lua @@ -26,7 +26,6 @@ local belowdisplayshortskip_code = skipcodes.belowdisplayshortskip local nuts = nodes.nuts -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/node-typ.lua b/tex/context/base/mkiv/node-typ.lua index dea48cda8..021bfefc2 100644 --- a/tex/context/base/mkiv/node-typ.lua +++ b/tex/context/base/mkiv/node-typ.lua @@ -15,12 +15,10 @@ local nuts = nodes.nuts local tonode = nuts.tonode local tonut = nuts.tonut -local setfield = nuts.setfield local setlink = nuts.setlink local setchar = nuts.setchar local setattrlist = nuts.setattrlist -local getfield = nuts.getfield local getfont = nuts.getfont local getattrlist = nuts.getattrlist diff --git a/tex/context/base/mkiv/page-cst.lua b/tex/context/base/mkiv/page-cst.lua index 03707a312..3fa7f9d96 100644 --- a/tex/context/base/mkiv/page-cst.lua +++ b/tex/context/base/mkiv/page-cst.lua @@ -42,8 +42,6 @@ local vpack = nuts.vpack local flushlist = nuts.flush_list ----- removenode = nuts.remove -local getfield = nuts.getfield -local setfield = nuts.setfield local setlink = nuts.setlink local setlist = nuts.setlist local setnext = nuts.setnext @@ -768,7 +766,8 @@ end -- while head do -- local id = getid(head) -- if id == hlist_code or id == vlist_code or id == rule_code then -- <= rule_code --- used = used + getfield(head,"height") + getfield(head,"depth") +-- local wd, ht, dp = getwhd(head) +-- used = used + ht + dp -- line = true -- elseif id == glue_code then -- if line then @@ -860,7 +859,8 @@ end -- local id = getid(head) -- local hd = 0 -- if id == hlist_code or id == vlist_code or id == rule_code then -- <= rule_code --- hd = getfield(head,"height") + getfield(head,"depth") +-- local wd, ht, dp = getwhd(head) +-- hd = ht + dp -- elseif id == glue_code then -- hd = getwidth(head) -- elseif id == kern_code then diff --git a/tex/context/base/mkiv/page-lin.lua b/tex/context/base/mkiv/page-lin.lua index 8ec4ba5df..a6b6a12c4 100644 --- a/tex/context/base/mkiv/page-lin.lua +++ b/tex/context/base/mkiv/page-lin.lua @@ -71,7 +71,6 @@ local getattr = nuts.getattr local setattr = nuts.setattr local getlist = nuts.getlist local getbox = nuts.getbox -local getfield = nuts.getfield ----- getdir = nuts.getdir ----- getwidth = nuts.getwidth local getheight = nuts.getheight @@ -80,8 +79,6 @@ local getdepth = nuts.getdepth local setprop = nuts.setprop local getprop = nuts.getprop -local setfield = nuts.setfield - local traverse_id = nuts.traverse_id local traverse = nuts.traverse local copy_node = nuts.copy diff --git a/tex/context/base/mkiv/page-mix.lua b/tex/context/base/mkiv/page-mix.lua index 524181c8e..88e804abb 100644 --- a/tex/context/base/mkiv/page-mix.lua +++ b/tex/context/base/mkiv/page-mix.lua @@ -8,8 +8,6 @@ if not modules then modules = { } end modules ["page-mix"] = { -- inserts.getname(name) --- getfield(l,"head") -> getlist - -- local node, tex = node, tex -- local nodes, interfaces, utilities = nodes, interfaces, utilities -- local trackers, logs, storage = trackers, logs, storage @@ -47,7 +45,6 @@ local flushnode = nuts.flush local concatnodes = nuts.concat local slidenodes = nuts.slide -- ok here as we mess with prev links intermediately -local setfield = nuts.setfield local setlink = nuts.setlink local setlist = nuts.setlist local setnext = nuts.setnext @@ -57,7 +54,6 @@ local setwhd = nuts.setwhd local setheight = nuts.setheight local setdepth = nuts.setdepth -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/scrp-cjk.lua b/tex/context/base/mkiv/scrp-cjk.lua index d2ec201ca..b31dc335a 100644 --- a/tex/context/base/mkiv/scrp-cjk.lua +++ b/tex/context/base/mkiv/scrp-cjk.lua @@ -32,7 +32,6 @@ local getid = nuts.getid local getattr = nuts.getattr local getsubtype = nuts.getsubtype local getwidth = nuts.getwidth -local getfield = nuts.getfield local setchar = nuts.setchar diff --git a/tex/context/base/mkiv/spac-ali.lua b/tex/context/base/mkiv/spac-ali.lua index bc77090cf..640478d34 100644 --- a/tex/context/base/mkiv/spac-ali.lua +++ b/tex/context/base/mkiv/spac-ali.lua @@ -18,7 +18,6 @@ local nodepool = nuts.pool local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua index b8a53d2a1..76e3e14f2 100644 --- a/tex/context/base/mkiv/spac-chr.lua +++ b/tex/context/base/mkiv/spac-chr.lua @@ -30,8 +30,6 @@ local nuts = nodes.nuts local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev local getattr = nuts.getattr diff --git a/tex/context/base/mkiv/spac-prf.lua b/tex/context/base/mkiv/spac-prf.lua index 841e5d271..130407edf 100644 --- a/tex/context/base/mkiv/spac-prf.lua +++ b/tex/context/base/mkiv/spac-prf.lua @@ -58,7 +58,6 @@ local getwidth = nuts.getwidth local getheight = nuts.getheight local getdepth = nuts.getdepth -local setfield = nuts.setfield local setlink = nuts.setlink local setlist = nuts.setlist local setattr = nuts.setattr diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua index d7c1a2cbb..f461e7ab9 100644 --- a/tex/context/base/mkiv/spac-ver.lua +++ b/tex/context/base/mkiv/spac-ver.lua @@ -30,8 +30,6 @@ if not modules then modules = { } end modules ['spac-ver'] = { -- todo: strip baselineskip around display math --- todo: getglue(n,false) instead of getfield - local next, type, tonumber = next, type, tonumber local gmatch, concat = string.gmatch, table.concat local ceil, floor = math.ceil, math.floor @@ -119,7 +117,6 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local setlink = nuts.setlink local getprev = nuts.getprev diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 8d8045647..1af2dbc5f 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 3caa8ff2c..54431abc7 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-mar.lua b/tex/context/base/mkiv/strc-mar.lua index 624972af4..80fcf126a 100644 --- a/tex/context/base/mkiv/strc-mar.lua +++ b/tex/context/base/mkiv/strc-mar.lua @@ -24,8 +24,6 @@ local setmetatableindex = table.setmetatableindex local nuts = nodes.nuts local tonut = nuts.tonut -local getfield = nuts.getfield -local setfield = nuts.setfield local getid = nuts.getid local getlist = nuts.getlist local getattr = nuts.getattr diff --git a/tex/context/base/mkiv/supp-box.lua b/tex/context/base/mkiv/supp-box.lua index fc206b6d2..4d9ec6e3e 100644 --- a/tex/context/base/mkiv/supp-box.lua +++ b/tex/context/base/mkiv/supp-box.lua @@ -30,7 +30,7 @@ local nuts = nodes.nuts local tonut = nuts.tonut local tonode = nuts.tonode -local getfield = nuts.getfield +----- getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getdisc = nuts.getdisc @@ -42,7 +42,7 @@ local getdir = nuts.getdir local getwidth = nuts.getwidth local takebox = nuts.takebox -local setfield = nuts.setfield +----- setfield = nuts.setfield local setlink = nuts.setlink local setboth = nuts.setboth local setnext = nuts.setnext diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua index dade345fc..1f4ba4a14 100644 --- a/tex/context/base/mkiv/tabl-xtb.lua +++ b/tex/context/base/mkiv/tabl-xtb.lua @@ -65,11 +65,11 @@ local tonode = nuts.tonode local getnext = nuts.getnext local getprev = nuts.getprev local getlist = nuts.getlist +local getwidth = nuts.getwidth local getfield = nuts.getfield local getbox = nuts.getbox local getwhd = nuts.getwhd -local setfield = nuts.setfield local setlink = nuts.setlink local setdir = nuts.setdir local setshift = nuts.setshift @@ -909,7 +909,7 @@ function xtables.construct() texsetdimen("global","d_tabl_x_final_width",0) else texsetcount("global","c_tabl_x_state",1) - texsetdimen("global","d_tabl_x_final_width",getfield(body[1][1],"width")) + texsetdimen("global","d_tabl_x_final_width",getfield(body[1][1],"width")) -- why not: getfield(body[1][1]) end end diff --git a/tex/context/base/mkiv/trac-jus.lua b/tex/context/base/mkiv/trac-jus.lua index 6d00bf19e..e7a030257 100644 --- a/tex/context/base/mkiv/trac-jus.lua +++ b/tex/context/base/mkiv/trac-jus.lua @@ -18,7 +18,6 @@ local nuts = nodes.nuts local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local getlist = nuts.getlist local getattr = nuts.getattr local setattr = nuts.setattr diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua index 0dccc8d89..42098f3f8 100644 --- a/tex/context/base/mkiv/trac-vis.lua +++ b/tex/context/base/mkiv/trac-vis.lua @@ -36,7 +36,7 @@ local nuts = nodes.nuts local tonut = nuts.tonut local tonode = nuts.tonode -local setfield = nuts.setfield +----- setfield = nuts.setfield local setboth = nuts.setboth local setlink = nuts.setlink local setdisc = nuts.setdisc diff --git a/tex/context/base/mkiv/typo-brk.lua b/tex/context/base/mkiv/typo-brk.lua index 84eff0654..40d1faa4c 100644 --- a/tex/context/base/mkiv/typo-brk.lua +++ b/tex/context/base/mkiv/typo-brk.lua @@ -31,14 +31,12 @@ local getboth = nuts.getboth local getsubtype = nuts.getsubtype local getfont = nuts.getfont local getid = nuts.getid -local getfield = nuts.getfield ----- getattr = nuts.getattr local getattrlist = nuts.getattrlist local takeattr = nuts.takeattr local getlang = nuts.getlang local isglyph = nuts.isglyph -local setfield = nuts.setfield local setattr = nuts.setattr local setattrlist = nuts.setattrlist local setlink = nuts.setlink diff --git a/tex/context/base/mkiv/typo-cap.lua b/tex/context/base/mkiv/typo-cap.lua index e10b9df9c..65357e233 100644 --- a/tex/context/base/mkiv/typo-cap.lua +++ b/tex/context/base/mkiv/typo-cap.lua @@ -21,7 +21,6 @@ local nuts = nodes.nuts local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid @@ -32,7 +31,6 @@ local getsubtype = nuts.getsubtype local getchar = nuts.getchar local getdisc = nuts.getdisc -local setfield = nuts.setfield local setattr = nuts.setattr local setchar = nuts.setchar local setfont = nuts.setfont diff --git a/tex/context/base/mkiv/typo-cln.lua b/tex/context/base/mkiv/typo-cln.lua index 53452f838..ecfdd8ff3 100644 --- a/tex/context/base/mkiv/typo-cln.lua +++ b/tex/context/base/mkiv/typo-cln.lua @@ -36,7 +36,6 @@ local getchar = nuts.getchar local getattr = nuts.getattr local setattr = nuts.setattr -local setfield = nuts.setfield local setchar = nuts.setchar local traverse_id = nuts.traverse_id diff --git a/tex/context/base/mkiv/typo-dha.lua b/tex/context/base/mkiv/typo-dha.lua index a32f72e46..c75fdbc3f 100644 --- a/tex/context/base/mkiv/typo-dha.lua +++ b/tex/context/base/mkiv/typo-dha.lua @@ -55,13 +55,11 @@ local getchar = nuts.getchar local getid = nuts.getid local getsubtype = nuts.getsubtype local getlist = nuts.getlist -local getfield = nuts.getfield local getattr = nuts.getattr local getprop = nuts.getprop local getdir = nuts.getdir local isglyph = nuts.isglyph -- or ischar -local setfield = nuts.setfield local setprop = nuts.setprop local setchar = nuts.setchar diff --git a/tex/context/base/mkiv/typo-dig.lua b/tex/context/base/mkiv/typo-dig.lua index 3d60131c7..cc9a91cd5 100644 --- a/tex/context/base/mkiv/typo-dig.lua +++ b/tex/context/base/mkiv/typo-dig.lua @@ -29,7 +29,6 @@ local getfont = nuts.getfont local getchar = nuts.getchar local getid = nuts.getid local getwidth = nuts.getwidth -local getfield = nuts.getfield local takeattr = nuts.takeattr local setlink = nuts.setlink diff --git a/tex/context/base/mkiv/typo-drp.lua b/tex/context/base/mkiv/typo-drp.lua index e27ad75f3..1e142280f 100644 --- a/tex/context/base/mkiv/typo-drp.lua +++ b/tex/context/base/mkiv/typo-drp.lua @@ -36,11 +36,9 @@ local getprev = nuts.getprev local getchar = nuts.getchar local getid = nuts.getid local getsubtype = nuts.getsubtype -local getfield = nuts.getfield local getattr = nuts.getattr local getwhd = nuts.getwhd -local setfield = nuts.setfield local setattr = nuts.setattr local setlink = nuts.setlink local setprev = nuts.setprev diff --git a/tex/context/base/mkiv/typo-dua.lua b/tex/context/base/mkiv/typo-dua.lua index c2f3c2763..3a23f97f1 100644 --- a/tex/context/base/mkiv/typo-dua.lua +++ b/tex/context/base/mkiv/typo-dua.lua @@ -75,11 +75,9 @@ local getid = nuts.getid local getsubtype = nuts.getsubtype local getlist = nuts.getlist local getchar = nuts.getchar -local getfield = nuts.getfield local getprop = nuts.getprop local getdir = nuts.getdir -local setfield = nuts.setfield local setprop = nuts.setprop local setchar = nuts.setchar local setdir = nuts.setdir diff --git a/tex/context/base/mkiv/typo-dub.lua b/tex/context/base/mkiv/typo-dub.lua index eea743c6d..a914b63ba 100644 --- a/tex/context/base/mkiv/typo-dub.lua +++ b/tex/context/base/mkiv/typo-dub.lua @@ -64,11 +64,9 @@ local getsubtype = nuts.getsubtype local getlist = nuts.getlist local getchar = nuts.getchar local getattr = nuts.getattr -local getfield = nuts.getfield local getprop = nuts.getprop local getdir = nuts.getdir -local setfield = nuts.setfield local setprop = nuts.setprop local setchar = nuts.setchar local setdir = nuts.setdir diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua index 7fd49e54e..c1b4d66cb 100644 --- a/tex/context/base/mkiv/typo-duc.lua +++ b/tex/context/base/mkiv/typo-duc.lua @@ -65,11 +65,9 @@ local getsubtype = nuts.getsubtype local getchar = nuts.getchar local getlist = nuts.getlist local getattr = nuts.getattr -local getfield = nuts.getfield local getprop = nuts.getprop local getdir = nuts.getdir -local setfield = nuts.setfield local setprop = nuts.setprop local setchar = nuts.setchar local setdir = nuts.setdir diff --git a/tex/context/base/mkiv/typo-fln.lua b/tex/context/base/mkiv/typo-fln.lua index cef77cea1..0cebd4b37 100644 --- a/tex/context/base/mkiv/typo-fln.lua +++ b/tex/context/base/mkiv/typo-fln.lua @@ -39,7 +39,6 @@ local getboth = nuts.getboth local setboth = nuts.setboth local getid = nuts.getid local getfield = nuts.getfield -local setfield = nuts.setfield local getlist = nuts.getlist local setlist = nuts.setlist local getattr = nuts.getattr diff --git a/tex/context/base/mkiv/typo-itc.lua b/tex/context/base/mkiv/typo-itc.lua index 781d44d30..6afec9816 100644 --- a/tex/context/base/mkiv/typo-itc.lua +++ b/tex/context/base/mkiv/typo-itc.lua @@ -31,7 +31,6 @@ local nodepool = nuts.pool local tonode = nuts.tonode local tonut = nuts.tonut -local getfield = nuts.getfield local getprev = nuts.getprev local getnext = nuts.getnext local getid = nuts.getid @@ -42,7 +41,6 @@ local getattr = nuts.getattr local setattr = nuts.setattr local getattrlist = nuts.getattrlist local setattrlist = nuts.setattrlist -local setfield = nuts.setfield local setdisc = nuts.setdisc local isglyph = nuts.isglyph local setkern = nuts.setkern diff --git a/tex/context/base/mkiv/typo-krn.lua b/tex/context/base/mkiv/typo-krn.lua index 8806a99b5..95b84993b 100644 --- a/tex/context/base/mkiv/typo-krn.lua +++ b/tex/context/base/mkiv/typo-krn.lua @@ -33,7 +33,6 @@ local insert_node_after = nuts.insert_after local end_of_math = nuts.end_of_math local use_components = nuts.use_components -local getfield = nuts.getfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/typo-lin.lua b/tex/context/base/mkiv/typo-lin.lua index d702bcb8c..ebf748a82 100644 --- a/tex/context/base/mkiv/typo-lin.lua +++ b/tex/context/base/mkiv/typo-lin.lua @@ -87,8 +87,6 @@ local getid = nuts.getid local getnext = nuts.getnext local getprev = nuts.getprev local getboth = nuts.getboth -local getfield = nuts.getfield -local setfield = nuts.setfield local setlink = nuts.setlink local setkern = nuts.setkern local getkern = nuts.getkern diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua index a5d607cd7..6014260d9 100644 --- a/tex/context/base/mkiv/typo-mar.lua +++ b/tex/context/base/mkiv/typo-mar.lua @@ -66,7 +66,6 @@ local traverse_id = nuts.traverse_id local flush_node_list = nuts.flush_list local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid @@ -165,7 +164,7 @@ setmetatable(displaystore,mt2) local defaults = { __index = { location = v_left, - align = v_normal, + align = v_normal, -- not used method = "", name = "", threshold = 0, -- .25ex diff --git a/tex/context/base/mkiv/typo-pag.lua b/tex/context/base/mkiv/typo-pag.lua index d6f71c8cc..b5759a097 100644 --- a/tex/context/base/mkiv/typo-pag.lua +++ b/tex/context/base/mkiv/typo-pag.lua @@ -28,8 +28,6 @@ local a_keeptogether = attributes.private("keeptogether") local nuts = nodes.nuts local tonut = nuts.tonut -local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid diff --git a/tex/context/base/mkiv/typo-rub.lua b/tex/context/base/mkiv/typo-rub.lua index 9621a6218..abe34731b 100644 --- a/tex/context/base/mkiv/typo-rub.lua +++ b/tex/context/base/mkiv/typo-rub.lua @@ -39,8 +39,6 @@ local getid = nuts.getid local getsubtype = nuts.getsubtype local getattr = nuts.getattr local setattr = nuts.setattr -local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local setnext = nuts.setnext local getprev = nuts.getprev diff --git a/tex/context/base/mkiv/typo-sus.lua b/tex/context/base/mkiv/typo-sus.lua index f728993f6..502c90417 100644 --- a/tex/context/base/mkiv/typo-sus.lua +++ b/tex/context/base/mkiv/typo-sus.lua @@ -44,7 +44,6 @@ local tonode = nodes.tonode local getid = nuts.getid local getprev = nuts.getprev local getnext = nuts.getnext -local getfield = nuts.getfield local getattr = nuts.getattr local getfont = nuts.getfont local getlist = nuts.getlist diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex d1f8f2779..66ccb3842 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 96fcd18d2..7f6e7a87c 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/sample/common/klein.tex b/tex/context/sample/common/klein.tex new file mode 100644 index 000000000..7b145abd4 --- /dev/null +++ b/tex/context/sample/common/klein.tex @@ -0,0 +1,6 @@ +We don't go into a state of shock when something big and bad happens; it has to +be something big and bad {\em that we do not yet understand}. A state of shock is +what results when a gap opens up between events and our initial ability to +explain them. When we find ourselves in that position, without a story, without +our moorings, a great many people become vulnerable to authority figures telling +us to fear one another and relinguish our rights for the greater good. diff --git a/tex/context/sample/common/samples.tex b/tex/context/sample/common/samples.tex index 72bec863c..a02e64e24 100644 --- a/tex/context/sample/common/samples.tex +++ b/tex/context/sample/common/samples.tex @@ -53,6 +53,8 @@ used in testing bibliographic references and citations. \NC mcnish.tex \NC Hollie McNish \NC Poetry versus Orchestra, Hollie McNish and Metropole Orkest, conducted by Jules Buckley, MO Black, fall 2016. \NC \NR +\NC klein.tex \NC Naomi Klein \NC No is not enough, defeating the new shock politics, + Allen Lane, 2017. \NC \NR \stoptabulate % Tufte: This quote will always produce hyphenated text, apart from the content, diff --git a/tex/generic/context/luatex/luatex-basics-nod.lua b/tex/generic/context/luatex/luatex-basics-nod.lua index e2d91af41..40fb9ee4e 100644 --- a/tex/generic/context/luatex/luatex-basics-nod.lua +++ b/tex/generic/context/luatex/luatex-basics-nod.lua @@ -201,6 +201,7 @@ nuts.setchar = direct.setchar nuts.getdisc = direct.getdisc nuts.setdisc = direct.setdisc nuts.setlink = direct.setlink +nuts.setsplit = direct.setsplit nuts.getlist = direct.getlist nuts.setlist = direct.setlist diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e43baa5c0..803b31082 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 07/29/17 23:08:35 +-- merge date : 07/30/17 19:30:11 do -- begin closure to overcome local limits and interference @@ -5118,6 +5118,7 @@ nuts.setchar=direct.setchar nuts.getdisc=direct.getdisc nuts.setdisc=direct.setdisc nuts.setlink=direct.setlink +nuts.setsplit=direct.setsplit nuts.getlist=direct.getlist nuts.setlist=direct.setlist nuts.getoffsets=direct.getoffsets or @@ -20732,7 +20733,6 @@ local nuts=nodes.nuts local nodepool=nuts.pool local tonode=nuts.tonode local tonut=nuts.tonut -local getfield=nuts.getfield local setfield=nuts.setfield local getnext=nuts.getnext local getprev=nuts.getprev @@ -22557,7 +22557,6 @@ local nuts=nodes.nuts local tonode=nuts.tonode local tonut=nuts.tonut local getfield=nuts.getfield -local setfield=nuts.setfield local getnext=nuts.getnext local setnext=nuts.setnext local getprev=nuts.getprev @@ -24048,6 +24047,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,ck,skipped) if ok then done=true if n and n>1 and i+n>nofchainlookups then +i=size break end end @@ -24396,7 +24396,7 @@ local function chaintrac(head,start,dataset,sequence,rlmode,ck,skipped,match) logwarning("%s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a", cref(dataset,sequence),rule,match and "matches" or "nomatch",gref(char),first-1,last-first+1,nofseq-last,lookuptype) end -local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode) +local function traditional_handle_contextchain(head,start,dataset,sequence,contexts,rlmode) local sweepnode=sweepnode local sweeptype=sweeptype local currentfont=currentfont @@ -25327,18 +25327,19 @@ local function optimized_handle_contextchain(head,start,dataset,sequence,context end return head,start,done end +local handle_contextchain=traditional_handle_contextchain directives.register("otf.optimizechains",function(v) if v then report_chain() report_chain("using experimental optimized code") report_chain() end - local handle=v and optimized_handle_contextchain or handle_contextchain - handlers.gsub_context=handle - handlers.gsub_contextchain=handle - handlers.gsub_reversecontextchain=handle - handlers.gpos_contextchain=handle - handlers.gpos_context=handle + handle_contextchain=v and optimized_handle_contextchain or traditional_handle_contextchain + handlers.gsub_context=handle_contextchain + handlers.gsub_contextchain=handle_contextchain + handlers.gsub_reversecontextchain=handle_contextchain + handlers.gpos_contextchain=handle_contextchain + handlers.gpos_context=handle_contextchain end) handlers.gsub_context=handle_contextchain handlers.gsub_contextchain=handle_contextchain |