summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-21 02:52:16 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-21 02:52:16 +0200
commita36f9abf1e0fd7de609dd1840d75bea56ec9e926 (patch)
treeb14349d1a44df698533aa324f6c17d2922bb4b59
parentaf172a8db5f7583d0117635edde17eba5619d883 (diff)
downloadcontext-a36f9abf1e0fd7de609dd1840d75bea56ec9e926.tar.gz
2016-05-20 18:46:00
-rw-r--r--doc/context/documents/general/manuals/luatex.pdfbin994871 -> 995323 bytes
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-nodes.tex16
-rw-r--r--scripts/context/lua/mtx-context.lua2
-rw-r--r--scripts/context/lua/mtxrun.lua33
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua33
-rw-r--r--scripts/context/stubs/unix/mtxrun33
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua33
-rw-r--r--tex/context/base/context-version.pdfbin4251 -> 4250 bytes
-rw-r--r--tex/context/base/mkiv/anch-pos.lua4
-rw-r--r--tex/context/base/mkiv/attr-ini.lua1
-rw-r--r--tex/context/base/mkiv/attr-lay.lua2
-rw-r--r--tex/context/base/mkiv/back-exp.lua2
-rw-r--r--tex/context/base/mkiv/back-pdf.lua2
-rw-r--r--tex/context/base/mkiv/blob-ini.lua2
-rw-r--r--tex/context/base/mkiv/buff-ini.lua5
-rw-r--r--tex/context/base/mkiv/buff-ver.lua1
-rw-r--r--tex/context/base/mkiv/char-cjk.lua1
-rw-r--r--tex/context/base/mkiv/char-tex.lua1
-rw-r--r--tex/context/base/mkiv/chem-str.lua1
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua8
-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/core-env.lua1
-rw-r--r--tex/context/base/mkiv/data-exp.lua2
-rw-r--r--tex/context/base/mkiv/data-lua.lua8
-rw-r--r--tex/context/base/mkiv/data-met.lua1
-rw-r--r--tex/context/base/mkiv/data-res.lua1
-rw-r--r--tex/context/base/mkiv/file-job.lua3
-rw-r--r--tex/context/base/mkiv/file-lib.lua1
-rw-r--r--tex/context/base/mkiv/file-syn.lua2
-rw-r--r--tex/context/base/mkiv/font-col.lua2
-rw-r--r--tex/context/base/mkiv/font-con.lua2
-rw-r--r--tex/context/base/mkiv/font-ctx.lua2
-rw-r--r--tex/context/base/mkiv/font-dsp.lua1
-rw-r--r--tex/context/base/mkiv/font-enh.lua4
-rw-r--r--tex/context/base/mkiv/font-ext.lua5
-rw-r--r--tex/context/base/mkiv/font-gbn.lua1
-rw-r--r--tex/context/base/mkiv/font-gds.lua1
-rw-r--r--tex/context/base/mkiv/font-ini.lua2
-rw-r--r--tex/context/base/mkiv/font-inj.lua1
-rw-r--r--tex/context/base/mkiv/font-map.lua1
-rw-r--r--tex/context/base/mkiv/font-mps.lua2
-rw-r--r--tex/context/base/mkiv/font-nod.lua4
-rw-r--r--tex/context/base/mkiv/font-off.lua6
-rw-r--r--tex/context/base/mkiv/font-one.lua14
-rw-r--r--tex/context/base/mkiv/font-onr.lua38
-rw-r--r--tex/context/base/mkiv/font-osd.lua3
-rw-r--r--tex/context/base/mkiv/font-ota.lua1
-rw-r--r--tex/context/base/mkiv/font-otb.lua2
-rw-r--r--tex/context/base/mkiv/font-otd.lua3
-rw-r--r--tex/context/base/mkiv/font-otf.lua1
-rw-r--r--tex/context/base/mkiv/font-otj.lua2
-rw-r--r--tex/context/base/mkiv/font-otn.lua40
-rw-r--r--tex/context/base/mkiv/font-oto.lua2
-rw-r--r--tex/context/base/mkiv/font-otr.lua4
-rw-r--r--tex/context/base/mkiv/font-ots.lua35
-rw-r--r--tex/context/base/mkiv/font-ott.lua1
-rw-r--r--tex/context/base/mkiv/font-sel.lua1354
-rw-r--r--tex/context/base/mkiv/font-sel.mkvi243
-rw-r--r--tex/context/base/mkiv/font-sol.lua3
-rw-r--r--tex/context/base/mkiv/font-syn.lua1
-rw-r--r--tex/context/base/mkiv/font-tfm.lua2
-rw-r--r--tex/context/base/mkiv/font-tmp.lua2
-rw-r--r--tex/context/base/mkiv/grph-rul.lua15
-rw-r--r--tex/context/base/mkiv/lang-dis.lua3
-rw-r--r--tex/context/base/mkiv/lang-hyp.lua5
-rw-r--r--tex/context/base/mkiv/lang-rep.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-col.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-fld.lua2
-rw-r--r--tex/context/base/mkiv/lpdf-grp.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua4
-rw-r--r--tex/context/base/mkiv/lpdf-mis.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-swf.lua25
-rw-r--r--tex/context/base/mkiv/lpdf-tag.lua6
-rw-r--r--tex/context/base/mkiv/lpdf-wid.lua3
-rw-r--r--tex/context/base/mkiv/lxml-aux.lua1
-rw-r--r--tex/context/base/mkiv/lxml-ent.lua2
-rw-r--r--tex/context/base/mkiv/lxml-tab.lua1
-rw-r--r--tex/context/base/mkiv/lxml-tex.lua1
-rw-r--r--tex/context/base/mkiv/math-act.lua2
-rw-r--r--tex/context/base/mkiv/math-noa.lua8
-rw-r--r--tex/context/base/mkiv/math-tag.lua2
-rw-r--r--tex/context/base/mkiv/math-vfu.lua1
-rw-r--r--tex/context/base/mkiv/mlib-int.lua4
-rw-r--r--tex/context/base/mkiv/mlib-pps.lua18
-rw-r--r--tex/context/base/mkiv/mlib-run.lua8
-rw-r--r--tex/context/base/mkiv/node-acc.lua4
-rw-r--r--tex/context/base/mkiv/node-aux.lua100
-rw-r--r--tex/context/base/mkiv/node-bck.lua1
-rw-r--r--tex/context/base/mkiv/node-fin.lua12
-rw-r--r--tex/context/base/mkiv/node-fnt.lua2
-rw-r--r--tex/context/base/mkiv/node-ini.lua27
-rw-r--r--tex/context/base/mkiv/node-ltp.lua37
-rw-r--r--tex/context/base/mkiv/node-met.lua1
-rw-r--r--tex/context/base/mkiv/node-nut.lua2
-rw-r--r--tex/context/base/mkiv/node-ppt.lua6
-rw-r--r--tex/context/base/mkiv/node-pro.lua5
-rw-r--r--tex/context/base/mkiv/node-ref.lua2
-rw-r--r--tex/context/base/mkiv/node-res.lua111
-rw-r--r--tex/context/base/mkiv/node-rul.lua78
-rw-r--r--tex/context/base/mkiv/node-rul.mkiv18
-rw-r--r--tex/context/base/mkiv/node-shp.lua10
-rw-r--r--tex/context/base/mkiv/node-tra.lua1
-rw-r--r--tex/context/base/mkiv/node-typ.lua9
-rw-r--r--tex/context/base/mkiv/pack-mrl.mkiv37
-rw-r--r--tex/context/base/mkiv/pack-obj.lua1
-rw-r--r--tex/context/base/mkiv/page-cst.lua17
-rw-r--r--tex/context/base/mkiv/page-flt.lua3
-rw-r--r--tex/context/base/mkiv/page-inj.lua1
-rw-r--r--tex/context/base/mkiv/page-ins.lua6
-rw-r--r--tex/context/base/mkiv/page-lin.lua13
-rw-r--r--tex/context/base/mkiv/page-mix.lua17
-rw-r--r--tex/context/base/mkiv/page-str.lua19
-rw-r--r--tex/context/base/mkiv/publ-aut.lua3
-rw-r--r--tex/context/base/mkiv/publ-dat.lua8
-rw-r--r--tex/context/base/mkiv/publ-ini.lua11
-rw-r--r--tex/context/base/mkiv/publ-reg.lua2
-rw-r--r--tex/context/base/mkiv/publ-tra.lua4
-rw-r--r--tex/context/base/mkiv/scrp-cjk.lua3
-rw-r--r--tex/context/base/mkiv/spac-adj.lua1
-rw-r--r--tex/context/base/mkiv/spac-chr.lua2
-rw-r--r--tex/context/base/mkiv/spac-hor.lua1
-rw-r--r--tex/context/base/mkiv/spac-prf.lua27
-rw-r--r--tex/context/base/mkiv/spac-ver.lua5
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin9208 -> 9124 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin266761 -> 268230 bytes
-rw-r--r--tex/context/base/mkiv/strc-bkm.lua1
-rw-r--r--tex/context/base/mkiv/strc-doc.lua5
-rw-r--r--tex/context/base/mkiv/strc-lev.lua1
-rw-r--r--tex/context/base/mkiv/strc-lst.lua2
-rw-r--r--tex/context/base/mkiv/strc-num.lua3
-rw-r--r--tex/context/base/mkiv/strc-ref.lua34
-rw-r--r--tex/context/base/mkiv/strc-reg.lua5
-rw-r--r--tex/context/base/mkiv/strc-syn.lua1
-rw-r--r--tex/context/base/mkiv/supp-box.lua6
-rw-r--r--tex/context/base/mkiv/syst-lua.lua22
-rw-r--r--tex/context/base/mkiv/tabl-xtb.lua3
-rw-r--r--tex/context/base/mkiv/trac-jus.lua2
-rw-r--r--tex/context/base/mkiv/trac-log.lua2
-rw-r--r--tex/context/base/mkiv/trac-par.lua1
-rw-r--r--tex/context/base/mkiv/trac-set.lua1
-rw-r--r--tex/context/base/mkiv/trac-tex.lua2
-rw-r--r--tex/context/base/mkiv/trac-vis.lua19
-rw-r--r--tex/context/base/mkiv/typo-brk.lua2
-rw-r--r--tex/context/base/mkiv/typo-cap.lua2
-rw-r--r--tex/context/base/mkiv/typo-chr.lua1
-rw-r--r--tex/context/base/mkiv/typo-dha.lua5
-rw-r--r--tex/context/base/mkiv/typo-dig.lua2
-rw-r--r--tex/context/base/mkiv/typo-dir.lua3
-rw-r--r--tex/context/base/mkiv/typo-drp.lua1
-rw-r--r--tex/context/base/mkiv/typo-dua.lua1
-rw-r--r--tex/context/base/mkiv/typo-dub.lua7
-rw-r--r--tex/context/base/mkiv/typo-duc.lua7
-rw-r--r--tex/context/base/mkiv/typo-fln.lua1
-rw-r--r--tex/context/base/mkiv/typo-itc.lua2
-rw-r--r--tex/context/base/mkiv/typo-krn.lua2
-rw-r--r--tex/context/base/mkiv/typo-lin.lua12
-rw-r--r--tex/context/base/mkiv/typo-mar.lua254
-rw-r--r--tex/context/base/mkiv/typo-mar.mkiv2
-rw-r--r--tex/context/base/mkiv/typo-rep.lua2
-rw-r--r--tex/context/base/mkiv/typo-spa.lua3
-rw-r--r--tex/context/base/mkiv/util-sql-imp-swiglib.lua50
-rw-r--r--tex/context/base/mkiv/util-sql-tickets.lua2
-rw-r--r--tex/context/base/mkiv/util-sql.lua2
-rw-r--r--tex/context/base/mkiv/util-tab.lua2
-rw-r--r--tex/context/interface/mkiv/i-blackrule.xml10
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin820896 -> 820584 bytes
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60791 -> 60793 bytes
-rw-r--r--tex/context/modules/mkiv/m-scite.mkiv11
-rw-r--r--tex/context/modules/mkiv/x-setups-basics.mkiv9
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua83
171 files changed, 1445 insertions, 1853 deletions
diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf
index 8b746b0f2..3f3825252 100644
--- a/doc/context/documents/general/manuals/luatex.pdf
+++ b/doc/context/documents/general/manuals/luatex.pdf
Binary files differ
diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
index e90813c33..b7b81b5a6 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
@@ -646,14 +646,14 @@ The \type {type} can have one of six distinct values. The number is the \ASCII\
value if the first character if the type name (so you can use string.byte("l")
instead of \type {108}).
-\starttabulate[|lT|p|]
-\NC \rmbf value \NC \bf meaning \NC \bf explanation \NC \NR
-\NC 97 \NC a \NC list of attributes (a node list) \NC \NR
-\NC 100 \NC d \NC a \LUA\ number \NC \NR
-\NC 108 \NC l \NC a \LUA\ value (table, number, boolean, etc) \NC \NR
-\NC 110 \NC n \NC a node list \NC \NR
-\NC 115 \NC s \NC a \LUA\ string \NC \NR
-\NC 116 \NC t \NC a \LUA\ token list in \LUA\ table form (a list of triplets) \NC \NR
+\starttabulate[|lT|lT|p|]
+\NC \rmbf value \NC \bf meaning \NC \bf explanation \NC \NR
+\NC 97 \NC a \NC list of attributes (a node list) \NC \NR
+\NC 100 \NC d \NC a \LUA\ number \NC \NR
+\NC 108 \NC l \NC a \LUA\ value (table, number, boolean, etc) \NC \NR
+\NC 110 \NC n \NC a node list \NC \NR
+\NC 115 \NC s \NC a \LUA\ string \NC \NR
+\NC 116 \NC t \NC a \LUA\ token list in \LUA\ table form (a list of triplets) \NC \NR
\stoptabulate
\subsubsubsection{save_pos whatsits}
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index a5f01cebc..84254d570 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -108,7 +108,7 @@ local function restart(engine_old,engine_new)
local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline())
report(format("redirect %s -> %s: %s",engine_old,engine_new,command))
local result = os.execute(command)
- os.exit(result)
+ os.exit(result == 0 and 0 or 1)
end
if getargument("redirected") then
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 7b711a88d..bba8fcf65 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -5909,7 +5909,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tab"] = package.loaded["util-tab"] or true
--- original size: 28680, stripped down to: 18636
+-- original size: 28690, stripped down to: 18636
if not modules then modules={} end modules ['util-tab']={
version=1.001,
@@ -6552,7 +6552,7 @@ local function serialize(root,name,specification)
end
if root then
if getmetatable(root) then
- local dummy=root._w_h_a_t_e_v_e_r_
+ local dummy=root._w_h_a_t_e_v_e_r_
root._w_h_a_t_e_v_e_r_=nil
end
if next(root)~=nil then
@@ -7668,7 +7668,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-set"] = package.loaded["trac-set"] or true
--- original size: 12862, stripped down to: 9104
+-- original size: 12833, stripped down to: 9079
if not modules then modules={} end modules ['trac-set']={
version=1.001,
@@ -7854,7 +7854,6 @@ function setters.list(t)
return user,system
end
function setters.show(t)
- local category=t.name
local list=setters.list(t)
t.report()
for k=1,#list do
@@ -7981,7 +7980,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30767, stripped down to: 21355
+-- original size: 30767, stripped down to: 21312
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8612,7 +8611,6 @@ function logs.stop_page_number()
end
logs.flush()
end
-local report_files=logs.reporter("files")
local nesting=0
local verbose=false
local hasscheme=url.hasscheme
@@ -9998,7 +9996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
--- original size: 56973, stripped down to: 35872
+-- original size: 56926, stripped down to: 35829
if not modules then modules={} end modules ['lxml-tab']={
version=1.001,
@@ -10285,7 +10283,6 @@ do
end
local p_rest=(1-P(";"))^0
local p_many=P(1)^0
- local p_char=lpegpatterns.utf8character
local parsedentity=P("&#")*(P("x")*(p_rest/fromhex)+(p_rest/fromdec))*P(";")*P(-1)+P ("#")*(P("x")*(p_many/fromhex)+(p_many/fromdec))
xml.parsedentitylpeg=parsedentity
local predefined_unified={
@@ -12518,7 +12515,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30566, stripped down to: 21741
+-- original size: 30536, stripped down to: 21713
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -12534,7 +12531,6 @@ local xml=xml
local xmlcopy,xmlname=xml.copy,xml.name
local xmlinheritedconvert=xml.inheritedconvert
local xmlapplylpath=xml.applylpath
-local xmlfilter=xml.filter
local type,next,setmetatable,getmetatable=type,next,setmetatable,getmetatable
local insert,remove,fastcopy,concat=table.insert,table.remove,table.fastcopy,table.concat
local gmatch,gsub,format,find,strip=string.gmatch,string.gsub,string.format,string.find,string.strip
@@ -14183,7 +14179,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 18619, stripped down to: 11042
+-- original size: 18508, stripped down to: 11020
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -14199,7 +14195,6 @@ local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
local isdir=lfs.isdir
-local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
local trace_expansions=false trackers.register("resolvers.expansions",function(v) trace_expansions=v end)
@@ -15228,7 +15223,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-met"] = package.loaded["data-met"] or true
--- original size: 5488, stripped down to: 4101
+-- original size: 5450, stripped down to: 4065
if not modules then modules={} end modules ['data-met']={
version=1.100,
@@ -15240,7 +15235,6 @@ if not modules then modules={} end modules ['data-met']={
local find,format=string.find,string.format
local sequenced=table.sequenced
local addurlscheme,urlhashed=url.addscheme,url.hashed
-local getcurrentdir=lfs.currentdir
local trace_locating=false
local trace_methods=false
trackers.register("resolvers.locating",function(v) trace_methods=v end)
@@ -15347,7 +15341,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 67241, stripped down to: 46427
+-- original size: 67192, stripped down to: 46380
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -15444,7 +15438,6 @@ local function resolvevariable(k)
end
local dollarstripper=lpeg.stripper("$")
local inhibitstripper=P("!")^0*Cs(P(1)^0)
-local backslashswapper=lpeg.replacer("\\","/")
local somevariable=P("$")/""
local somekey=C(R("az","AZ","09","__","--")^1)
local somethingelse=P(";")*((1-S("!{}/\\"))^1*P(";")/"")+P(";")*(P(";")/"")+P(1)
@@ -18003,7 +17996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-lua"] = package.loaded["data-lua"] or true
--- original size: 4447, stripped down to: 3302
+-- original size: 4339, stripped down to: 3210
if not modules then modules={} end modules ['data-lua']={
version=1.001,
@@ -18045,8 +18038,6 @@ function helpers.cleanpath(path)
return resolveprefix(lpegmatch(pattern,path))
end
local loadedaslib=helpers.loadedaslib
-local getextraluapaths=package.extraluapaths
-local getextralibpaths=package.extralibpaths
local registerpath=helpers.registerpath
local lualibfile=helpers.lualibfile
local luaformatpaths
@@ -18752,8 +18743,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 797557
--- stripped bytes : 289197
+-- original bytes : 797155
+-- stripped bytes : 289131
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 7b711a88d..bba8fcf65 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -5909,7 +5909,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tab"] = package.loaded["util-tab"] or true
--- original size: 28680, stripped down to: 18636
+-- original size: 28690, stripped down to: 18636
if not modules then modules={} end modules ['util-tab']={
version=1.001,
@@ -6552,7 +6552,7 @@ local function serialize(root,name,specification)
end
if root then
if getmetatable(root) then
- local dummy=root._w_h_a_t_e_v_e_r_
+ local dummy=root._w_h_a_t_e_v_e_r_
root._w_h_a_t_e_v_e_r_=nil
end
if next(root)~=nil then
@@ -7668,7 +7668,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-set"] = package.loaded["trac-set"] or true
--- original size: 12862, stripped down to: 9104
+-- original size: 12833, stripped down to: 9079
if not modules then modules={} end modules ['trac-set']={
version=1.001,
@@ -7854,7 +7854,6 @@ function setters.list(t)
return user,system
end
function setters.show(t)
- local category=t.name
local list=setters.list(t)
t.report()
for k=1,#list do
@@ -7981,7 +7980,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30767, stripped down to: 21355
+-- original size: 30767, stripped down to: 21312
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8612,7 +8611,6 @@ function logs.stop_page_number()
end
logs.flush()
end
-local report_files=logs.reporter("files")
local nesting=0
local verbose=false
local hasscheme=url.hasscheme
@@ -9998,7 +9996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
--- original size: 56973, stripped down to: 35872
+-- original size: 56926, stripped down to: 35829
if not modules then modules={} end modules ['lxml-tab']={
version=1.001,
@@ -10285,7 +10283,6 @@ do
end
local p_rest=(1-P(";"))^0
local p_many=P(1)^0
- local p_char=lpegpatterns.utf8character
local parsedentity=P("&#")*(P("x")*(p_rest/fromhex)+(p_rest/fromdec))*P(";")*P(-1)+P ("#")*(P("x")*(p_many/fromhex)+(p_many/fromdec))
xml.parsedentitylpeg=parsedentity
local predefined_unified={
@@ -12518,7 +12515,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30566, stripped down to: 21741
+-- original size: 30536, stripped down to: 21713
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -12534,7 +12531,6 @@ local xml=xml
local xmlcopy,xmlname=xml.copy,xml.name
local xmlinheritedconvert=xml.inheritedconvert
local xmlapplylpath=xml.applylpath
-local xmlfilter=xml.filter
local type,next,setmetatable,getmetatable=type,next,setmetatable,getmetatable
local insert,remove,fastcopy,concat=table.insert,table.remove,table.fastcopy,table.concat
local gmatch,gsub,format,find,strip=string.gmatch,string.gsub,string.format,string.find,string.strip
@@ -14183,7 +14179,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 18619, stripped down to: 11042
+-- original size: 18508, stripped down to: 11020
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -14199,7 +14195,6 @@ local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
local isdir=lfs.isdir
-local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
local trace_expansions=false trackers.register("resolvers.expansions",function(v) trace_expansions=v end)
@@ -15228,7 +15223,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-met"] = package.loaded["data-met"] or true
--- original size: 5488, stripped down to: 4101
+-- original size: 5450, stripped down to: 4065
if not modules then modules={} end modules ['data-met']={
version=1.100,
@@ -15240,7 +15235,6 @@ if not modules then modules={} end modules ['data-met']={
local find,format=string.find,string.format
local sequenced=table.sequenced
local addurlscheme,urlhashed=url.addscheme,url.hashed
-local getcurrentdir=lfs.currentdir
local trace_locating=false
local trace_methods=false
trackers.register("resolvers.locating",function(v) trace_methods=v end)
@@ -15347,7 +15341,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 67241, stripped down to: 46427
+-- original size: 67192, stripped down to: 46380
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -15444,7 +15438,6 @@ local function resolvevariable(k)
end
local dollarstripper=lpeg.stripper("$")
local inhibitstripper=P("!")^0*Cs(P(1)^0)
-local backslashswapper=lpeg.replacer("\\","/")
local somevariable=P("$")/""
local somekey=C(R("az","AZ","09","__","--")^1)
local somethingelse=P(";")*((1-S("!{}/\\"))^1*P(";")/"")+P(";")*(P(";")/"")+P(1)
@@ -18003,7 +17996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-lua"] = package.loaded["data-lua"] or true
--- original size: 4447, stripped down to: 3302
+-- original size: 4339, stripped down to: 3210
if not modules then modules={} end modules ['data-lua']={
version=1.001,
@@ -18045,8 +18038,6 @@ function helpers.cleanpath(path)
return resolveprefix(lpegmatch(pattern,path))
end
local loadedaslib=helpers.loadedaslib
-local getextraluapaths=package.extraluapaths
-local getextralibpaths=package.extralibpaths
local registerpath=helpers.registerpath
local lualibfile=helpers.lualibfile
local luaformatpaths
@@ -18752,8 +18743,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 797557
--- stripped bytes : 289197
+-- original bytes : 797155
+-- stripped bytes : 289131
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 7b711a88d..bba8fcf65 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -5909,7 +5909,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tab"] = package.loaded["util-tab"] or true
--- original size: 28680, stripped down to: 18636
+-- original size: 28690, stripped down to: 18636
if not modules then modules={} end modules ['util-tab']={
version=1.001,
@@ -6552,7 +6552,7 @@ local function serialize(root,name,specification)
end
if root then
if getmetatable(root) then
- local dummy=root._w_h_a_t_e_v_e_r_
+ local dummy=root._w_h_a_t_e_v_e_r_
root._w_h_a_t_e_v_e_r_=nil
end
if next(root)~=nil then
@@ -7668,7 +7668,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-set"] = package.loaded["trac-set"] or true
--- original size: 12862, stripped down to: 9104
+-- original size: 12833, stripped down to: 9079
if not modules then modules={} end modules ['trac-set']={
version=1.001,
@@ -7854,7 +7854,6 @@ function setters.list(t)
return user,system
end
function setters.show(t)
- local category=t.name
local list=setters.list(t)
t.report()
for k=1,#list do
@@ -7981,7 +7980,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30767, stripped down to: 21355
+-- original size: 30767, stripped down to: 21312
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8612,7 +8611,6 @@ function logs.stop_page_number()
end
logs.flush()
end
-local report_files=logs.reporter("files")
local nesting=0
local verbose=false
local hasscheme=url.hasscheme
@@ -9998,7 +9996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
--- original size: 56973, stripped down to: 35872
+-- original size: 56926, stripped down to: 35829
if not modules then modules={} end modules ['lxml-tab']={
version=1.001,
@@ -10285,7 +10283,6 @@ do
end
local p_rest=(1-P(";"))^0
local p_many=P(1)^0
- local p_char=lpegpatterns.utf8character
local parsedentity=P("&#")*(P("x")*(p_rest/fromhex)+(p_rest/fromdec))*P(";")*P(-1)+P ("#")*(P("x")*(p_many/fromhex)+(p_many/fromdec))
xml.parsedentitylpeg=parsedentity
local predefined_unified={
@@ -12518,7 +12515,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30566, stripped down to: 21741
+-- original size: 30536, stripped down to: 21713
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -12534,7 +12531,6 @@ local xml=xml
local xmlcopy,xmlname=xml.copy,xml.name
local xmlinheritedconvert=xml.inheritedconvert
local xmlapplylpath=xml.applylpath
-local xmlfilter=xml.filter
local type,next,setmetatable,getmetatable=type,next,setmetatable,getmetatable
local insert,remove,fastcopy,concat=table.insert,table.remove,table.fastcopy,table.concat
local gmatch,gsub,format,find,strip=string.gmatch,string.gsub,string.format,string.find,string.strip
@@ -14183,7 +14179,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 18619, stripped down to: 11042
+-- original size: 18508, stripped down to: 11020
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -14199,7 +14195,6 @@ local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
local isdir=lfs.isdir
-local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
local trace_expansions=false trackers.register("resolvers.expansions",function(v) trace_expansions=v end)
@@ -15228,7 +15223,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-met"] = package.loaded["data-met"] or true
--- original size: 5488, stripped down to: 4101
+-- original size: 5450, stripped down to: 4065
if not modules then modules={} end modules ['data-met']={
version=1.100,
@@ -15240,7 +15235,6 @@ if not modules then modules={} end modules ['data-met']={
local find,format=string.find,string.format
local sequenced=table.sequenced
local addurlscheme,urlhashed=url.addscheme,url.hashed
-local getcurrentdir=lfs.currentdir
local trace_locating=false
local trace_methods=false
trackers.register("resolvers.locating",function(v) trace_methods=v end)
@@ -15347,7 +15341,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 67241, stripped down to: 46427
+-- original size: 67192, stripped down to: 46380
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -15444,7 +15438,6 @@ local function resolvevariable(k)
end
local dollarstripper=lpeg.stripper("$")
local inhibitstripper=P("!")^0*Cs(P(1)^0)
-local backslashswapper=lpeg.replacer("\\","/")
local somevariable=P("$")/""
local somekey=C(R("az","AZ","09","__","--")^1)
local somethingelse=P(";")*((1-S("!{}/\\"))^1*P(";")/"")+P(";")*(P(";")/"")+P(1)
@@ -18003,7 +17996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-lua"] = package.loaded["data-lua"] or true
--- original size: 4447, stripped down to: 3302
+-- original size: 4339, stripped down to: 3210
if not modules then modules={} end modules ['data-lua']={
version=1.001,
@@ -18045,8 +18038,6 @@ function helpers.cleanpath(path)
return resolveprefix(lpegmatch(pattern,path))
end
local loadedaslib=helpers.loadedaslib
-local getextraluapaths=package.extraluapaths
-local getextralibpaths=package.extralibpaths
local registerpath=helpers.registerpath
local lualibfile=helpers.lualibfile
local luaformatpaths
@@ -18752,8 +18743,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 797557
--- stripped bytes : 289197
+-- original bytes : 797155
+-- stripped bytes : 289131
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index 7b711a88d..bba8fcf65 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -5909,7 +5909,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-tab"] = package.loaded["util-tab"] or true
--- original size: 28680, stripped down to: 18636
+-- original size: 28690, stripped down to: 18636
if not modules then modules={} end modules ['util-tab']={
version=1.001,
@@ -6552,7 +6552,7 @@ local function serialize(root,name,specification)
end
if root then
if getmetatable(root) then
- local dummy=root._w_h_a_t_e_v_e_r_
+ local dummy=root._w_h_a_t_e_v_e_r_
root._w_h_a_t_e_v_e_r_=nil
end
if next(root)~=nil then
@@ -7668,7 +7668,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-set"] = package.loaded["trac-set"] or true
--- original size: 12862, stripped down to: 9104
+-- original size: 12833, stripped down to: 9079
if not modules then modules={} end modules ['trac-set']={
version=1.001,
@@ -7854,7 +7854,6 @@ function setters.list(t)
return user,system
end
function setters.show(t)
- local category=t.name
local list=setters.list(t)
t.report()
for k=1,#list do
@@ -7981,7 +7980,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 30767, stripped down to: 21355
+-- original size: 30767, stripped down to: 21312
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -8612,7 +8611,6 @@ function logs.stop_page_number()
end
logs.flush()
end
-local report_files=logs.reporter("files")
local nesting=0
local verbose=false
local hasscheme=url.hasscheme
@@ -9998,7 +9996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true
--- original size: 56973, stripped down to: 35872
+-- original size: 56926, stripped down to: 35829
if not modules then modules={} end modules ['lxml-tab']={
version=1.001,
@@ -10285,7 +10283,6 @@ do
end
local p_rest=(1-P(";"))^0
local p_many=P(1)^0
- local p_char=lpegpatterns.utf8character
local parsedentity=P("&#")*(P("x")*(p_rest/fromhex)+(p_rest/fromdec))*P(";")*P(-1)+P ("#")*(P("x")*(p_many/fromhex)+(p_many/fromdec))
xml.parsedentitylpeg=parsedentity
local predefined_unified={
@@ -12518,7 +12515,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30566, stripped down to: 21741
+-- original size: 30536, stripped down to: 21713
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -12534,7 +12531,6 @@ local xml=xml
local xmlcopy,xmlname=xml.copy,xml.name
local xmlinheritedconvert=xml.inheritedconvert
local xmlapplylpath=xml.applylpath
-local xmlfilter=xml.filter
local type,next,setmetatable,getmetatable=type,next,setmetatable,getmetatable
local insert,remove,fastcopy,concat=table.insert,table.remove,table.fastcopy,table.concat
local gmatch,gsub,format,find,strip=string.gmatch,string.gsub,string.format,string.find,string.strip
@@ -14183,7 +14179,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 18619, stripped down to: 11042
+-- original size: 18508, stripped down to: 11020
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -14199,7 +14195,6 @@ local lpegmatch,lpegpatterns=lpeg.match,lpeg.patterns
local Ct,Cs,Cc,Carg,P,C,S=lpeg.Ct,lpeg.Cs,lpeg.Cc,lpeg.Carg,lpeg.P,lpeg.C,lpeg.S
local type,next=type,next
local isdir=lfs.isdir
-local ostype=os.type
local collapsepath,joinpath,basename=file.collapsepath,file.join,file.basename
local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end)
local trace_expansions=false trackers.register("resolvers.expansions",function(v) trace_expansions=v end)
@@ -15228,7 +15223,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-met"] = package.loaded["data-met"] or true
--- original size: 5488, stripped down to: 4101
+-- original size: 5450, stripped down to: 4065
if not modules then modules={} end modules ['data-met']={
version=1.100,
@@ -15240,7 +15235,6 @@ if not modules then modules={} end modules ['data-met']={
local find,format=string.find,string.format
local sequenced=table.sequenced
local addurlscheme,urlhashed=url.addscheme,url.hashed
-local getcurrentdir=lfs.currentdir
local trace_locating=false
local trace_methods=false
trackers.register("resolvers.locating",function(v) trace_methods=v end)
@@ -15347,7 +15341,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-res"] = package.loaded["data-res"] or true
--- original size: 67241, stripped down to: 46427
+-- original size: 67192, stripped down to: 46380
if not modules then modules={} end modules ['data-res']={
version=1.001,
@@ -15444,7 +15438,6 @@ local function resolvevariable(k)
end
local dollarstripper=lpeg.stripper("$")
local inhibitstripper=P("!")^0*Cs(P(1)^0)
-local backslashswapper=lpeg.replacer("\\","/")
local somevariable=P("$")/""
local somekey=C(R("az","AZ","09","__","--")^1)
local somethingelse=P(";")*((1-S("!{}/\\"))^1*P(";")/"")+P(";")*(P(";")/"")+P(1)
@@ -18003,7 +17996,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-lua"] = package.loaded["data-lua"] or true
--- original size: 4447, stripped down to: 3302
+-- original size: 4339, stripped down to: 3210
if not modules then modules={} end modules ['data-lua']={
version=1.001,
@@ -18045,8 +18038,6 @@ function helpers.cleanpath(path)
return resolveprefix(lpegmatch(pattern,path))
end
local loadedaslib=helpers.loadedaslib
-local getextraluapaths=package.extraluapaths
-local getextralibpaths=package.extralibpaths
local registerpath=helpers.registerpath
local lualibfile=helpers.lualibfile
local luaformatpaths
@@ -18752,8 +18743,8 @@ end -- of closure
-- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 797557
--- stripped bytes : 289197
+-- original bytes : 797155
+-- stripped bytes : 289131
-- end library merge
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 85675dc81..44a38d269 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua
index 2d36c53e6..7109f2592 100644
--- a/tex/context/base/mkiv/anch-pos.lua
+++ b/tex/context/base/mkiv/anch-pos.lua
@@ -14,10 +14,6 @@ more efficient.</p>
-- plus (extra) is obsolete but we will keep it for a while
--- context(new_latelua_node(f_enhance(tag)))
--- =>
--- context.lateluafunction(function() f_enhance(tag) end)
-
-- maybe replace texsp by our own converter (stay at the lua end)
-- eventually mp will have large numbers so we can use sp there too
diff --git a/tex/context/base/mkiv/attr-ini.lua b/tex/context/base/mkiv/attr-ini.lua
index df7404d11..3f5b24692 100644
--- a/tex/context/base/mkiv/attr-ini.lua
+++ b/tex/context/base/mkiv/attr-ini.lua
@@ -25,7 +25,6 @@ local attributes = attributes
local sharedstorage = storage.shared
-local texgetcount = tex.getcount
local texsetattribute = tex.setattribute
attributes.names = attributes.names or { }
diff --git a/tex/context/base/mkiv/attr-lay.lua b/tex/context/base/mkiv/attr-lay.lua
index 0d43979c8..051ff6e10 100644
--- a/tex/context/base/mkiv/attr-lay.lua
+++ b/tex/context/base/mkiv/attr-lay.lua
@@ -71,8 +71,6 @@ local texgetattribute = tex.getattribute
local texsettokenlist = tex.settoks
local unsetvalue = attributes.unsetvalue
-local nodepool = nodes.pool
-
local data = viewerlayers.data
local values = viewerlayers.values
local listwise = viewerlayers.listwise
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index 681996d48..b12247546 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -89,7 +89,6 @@ local glyph_code = nodecodes.glyph
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local disc_code = nodecodes.disc
-local insert_code = nodecodes.insert
local userskip_code = skipcodes.userskip
local rightskip_code = skipcodes.rightskip
@@ -3315,7 +3314,6 @@ local htmltemplate = [[
-- ./jobname-export/styles/jobname-templates.css
local basename = file.basename(v)
- local corename = file.removesuffix(basename)
local basepath = basename .. "-export"
local imagepath = joinfile(basepath,"images")
local stylepath = joinfile(basepath,"styles")
diff --git a/tex/context/base/mkiv/back-pdf.lua b/tex/context/base/mkiv/back-pdf.lua
index 323f1d57f..b6633f091 100644
--- a/tex/context/base/mkiv/back-pdf.lua
+++ b/tex/context/base/mkiv/back-pdf.lua
@@ -17,9 +17,7 @@ local codeinjections = backends.pdf.codeinjections
local context = context
local scanners = tokens.scanners
-local scanstring = scanners.string
local scannumber = scanners.number
-local scaninteger = scanners.integer
local scankeyword = scanners.keyword
local scanners = interfaces.scanners
diff --git a/tex/context/base/mkiv/blob-ini.lua b/tex/context/base/mkiv/blob-ini.lua
index 106c10f4f..f825b7aa3 100644
--- a/tex/context/base/mkiv/blob-ini.lua
+++ b/tex/context/base/mkiv/blob-ini.lua
@@ -29,7 +29,7 @@ local report_blobs = logs.reporter("blobs")
local flush_node_list = node.flush_list
local hpack_node_list = node.hpack
-local vpack_node_list = node.vpack
+----- vpack_node_list = node.vpack
local write_node = node.write
local typesetters = nodes.typesetters
diff --git a/tex/context/base/mkiv/buff-ini.lua b/tex/context/base/mkiv/buff-ini.lua
index c41c51607..499e43f87 100644
--- a/tex/context/base/mkiv/buff-ini.lua
+++ b/tex/context/base/mkiv/buff-ini.lua
@@ -20,7 +20,7 @@ local trace_visualize = false trackers.register("buffers.visualize", function
local report_buffers = logs.reporter("buffers","usage")
local report_typeset = logs.reporter("buffers","typeset")
-local report_grabbing = logs.reporter("buffers","grabbing")
+----- report_grabbing = logs.reporter("buffers","grabbing")
local context = context
local commands = commands
@@ -32,12 +32,11 @@ local scanstring = scanners.string
local scaninteger = scanners.integer
local scanboolean = scanners.boolean
local scancode = scanners.code
-local scantoken = scanners.token
+----- scantoken = scanners.token
local getters = tokens.getters
local gettoken = getters.token
-local compilescanner = tokens.compile
local scanners = interfaces.scanners
local variables = interfaces.variables
diff --git a/tex/context/base/mkiv/buff-ver.lua b/tex/context/base/mkiv/buff-ver.lua
index 448d1a60c..a9d6696cb 100644
--- a/tex/context/base/mkiv/buff-ver.lua
+++ b/tex/context/base/mkiv/buff-ver.lua
@@ -40,7 +40,6 @@ local variables = interfaces.variables
local findfile = resolvers.findfile
local addsuffix = file.addsuffix
-local v_auto = variables.auto
local v_yes = variables.yes
local v_last = variables.last
local v_all = variables.all
diff --git a/tex/context/base/mkiv/char-cjk.lua b/tex/context/base/mkiv/char-cjk.lua
index 9d6b28a60..3db90386e 100644
--- a/tex/context/base/mkiv/char-cjk.lua
+++ b/tex/context/base/mkiv/char-cjk.lua
@@ -10,7 +10,6 @@ local setmetatable, next = setmetatable, next
local insert = table.insert
local floor = math.floor
local formatters = string.formatters
-local utfchar = utf.char
local setmetatableindex = table.setmetatableindex
diff --git a/tex/context/base/mkiv/char-tex.lua b/tex/context/base/mkiv/char-tex.lua
index 60f324be2..c1b04abfa 100644
--- a/tex/context/base/mkiv/char-tex.lua
+++ b/tex/context/base/mkiv/char-tex.lua
@@ -424,7 +424,6 @@ local implement = interfaces.implement
local tex = tex
local texsetlccode = tex.setlccode
-local texsetuccode = tex.setuccode
local texsetsfcode = tex.setsfcode
local texsetcatcode = tex.setcatcode
diff --git a/tex/context/base/mkiv/chem-str.lua b/tex/context/base/mkiv/chem-str.lua
index e90464ad2..0300aae02 100644
--- a/tex/context/base/mkiv/chem-str.lua
+++ b/tex/context/base/mkiv/chem-str.lua
@@ -47,7 +47,6 @@ local context = context
local implement = interfaces.implement
local formatters = string.formatters
-local texgetcount = tex.getcount
local v_default = variables.default
local v_small = variables.small
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index 0c39f72f5..353b02273 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -464,13 +464,6 @@ function context.trialtypesetting()
return texgetcount("@@trialtypesetting") ~= 0
end
--- local f_cldo = formatters["_cldo_(%i)"]
--- local latelua_node = nodes.pool.latelua
---
--- function context.lateluafunctionnnode(f)
--- return latelua_node(f_cldo(registerfunction(f)))
--- end
-
-- Should we keep the catcodes with the function?
local catcodestack = { }
@@ -977,7 +970,6 @@ local prtindexer = nil
--
-- local create = token.create
-- local twrite = token.write
--- local setmacro = token.set_macro
--
-- indexer = function(parent,k)
-- if type(k) == "string" then
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 92d617208..b62ba0717 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{2016.05.17 10:06}
+\newcontextversion{2016.05.20 18:42}
%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 eb9244d56..b607e53dd 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.05.17 10:06}
+\edef\contextversion{2016.05.20 18:42}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/core-env.lua b/tex/context/base/mkiv/core-env.lua
index 06c9708d6..34220fedf 100644
--- a/tex/context/base/mkiv/core-env.lua
+++ b/tex/context/base/mkiv/core-env.lua
@@ -16,7 +16,6 @@ local P, C, S, Cc, lpegmatch, patterns = lpeg.P, lpeg.C, lpeg.S, lpeg.Cc, lpeg.m
local context = context
local texgetcount = tex.getcount
-local texsetcount = tex.setcount
local allocate = utilities.storage.allocate
local setmetatableindex = table.setmetatableindex
diff --git a/tex/context/base/mkiv/data-exp.lua b/tex/context/base/mkiv/data-exp.lua
index 19ceb90c3..e34c52efb 100644
--- a/tex/context/base/mkiv/data-exp.lua
+++ b/tex/context/base/mkiv/data-exp.lua
@@ -14,7 +14,6 @@ local Ct, Cs, Cc, Carg, P, C, S = lpeg.Ct, lpeg.Cs, lpeg.Cc, lpeg.Carg, lpeg.P,
local type, next = type, next
local isdir = lfs.isdir
-local ostype = os.type
local collapsepath, joinpath, basename = file.collapsepath, file.join, file.basename
local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
@@ -244,7 +243,6 @@ end
local cache = { }
------ splitter = lpeg.tsplitat(S(ostype == "windows" and ";" or ":;")) -- maybe add ,
local splitter = lpeg.tsplitat(";") -- as we move towards urls, prefixes and use tables we no longer do :
local backslashswapper = lpeg.replacer("\\","/")
diff --git a/tex/context/base/mkiv/data-lua.lua b/tex/context/base/mkiv/data-lua.lua
index 7c12a5940..3022ae550 100644
--- a/tex/context/base/mkiv/data-lua.lua
+++ b/tex/context/base/mkiv/data-lua.lua
@@ -50,11 +50,9 @@ function helpers.cleanpath(path) -- hm, don't we have a helper for this?
return resolveprefix(lpegmatch(pattern,path))
end
-local loadedaslib = helpers.loadedaslib
-local getextraluapaths = package.extraluapaths
-local getextralibpaths = package.extralibpaths
-local registerpath = helpers.registerpath
-local lualibfile = helpers.lualibfile
+local loadedaslib = helpers.loadedaslib
+local registerpath = helpers.registerpath
+local lualibfile = helpers.lualibfile
local luaformatpaths
local libformatpaths
diff --git a/tex/context/base/mkiv/data-met.lua b/tex/context/base/mkiv/data-met.lua
index 4e8a48f50..bb8929577 100644
--- a/tex/context/base/mkiv/data-met.lua
+++ b/tex/context/base/mkiv/data-met.lua
@@ -9,7 +9,6 @@ if not modules then modules = { } end modules ['data-met'] = {
local find, format = string.find, string.format
local sequenced = table.sequenced
local addurlscheme, urlhashed = url.addscheme, url.hashed
-local getcurrentdir = lfs.currentdir
local trace_locating = false
local trace_methods = false
diff --git a/tex/context/base/mkiv/data-res.lua b/tex/context/base/mkiv/data-res.lua
index 831ad881c..24d53c343 100644
--- a/tex/context/base/mkiv/data-res.lua
+++ b/tex/context/base/mkiv/data-res.lua
@@ -198,7 +198,6 @@ end
local dollarstripper = lpeg.stripper("$")
local inhibitstripper = P("!")^0 * Cs(P(1)^0)
-local backslashswapper = lpeg.replacer("\\","/")
local somevariable = P("$") / ""
local somekey = C(R("az","AZ","09","__","--")^1)
diff --git a/tex/context/base/mkiv/file-job.lua b/tex/context/base/mkiv/file-job.lua
index 602c41a11..d8509eff1 100644
--- a/tex/context/base/mkiv/file-job.lua
+++ b/tex/context/base/mkiv/file-job.lua
@@ -44,7 +44,6 @@ local basename = file.basename
local addsuffix = file.addsuffix
local removesuffix = file.removesuffix
local dirname = file.dirname
-local joinpath = file.join
local is_qualified_path = file.is_qualified_path
local cleanpath = resolvers.cleanpath
@@ -60,7 +59,7 @@ local resetextrapath = resolvers.resetextrapath
local pushextrapath = resolvers.pushextrapath
local popextrapath = resolvers.popextrapath
-local v_outer = variables.outer
+----- v_outer = variables.outer
local v_text = variables.text
local v_project = variables.project
local v_environment = variables.environment
diff --git a/tex/context/base/mkiv/file-lib.lua b/tex/context/base/mkiv/file-lib.lua
index 361608ea3..b8ba69427 100644
--- a/tex/context/base/mkiv/file-lib.lua
+++ b/tex/context/base/mkiv/file-lib.lua
@@ -17,7 +17,6 @@ local trace_libraries = false trackers.register("resolvers.libraries", function
local report_library = logs.reporter("files","library")
----- report_files = logs.reporter("files","readfile")
-local suffixonly = file.suffix
local removesuffix = file.removesuffix
local getreadfilename = resolvers.getreadfilename
diff --git a/tex/context/base/mkiv/file-syn.lua b/tex/context/base/mkiv/file-syn.lua
index b6ad27c83..7b000f9ad 100644
--- a/tex/context/base/mkiv/file-syn.lua
+++ b/tex/context/base/mkiv/file-syn.lua
@@ -15,8 +15,6 @@ local findfile = resolvers.findfile
local implement = interfaces.implement
-local report_files = logs.reporter("files")
-
storage.register("environment/filesynonyms", filesynonyms, "environment.filesynonyms")
local function truefilename(name)
diff --git a/tex/context/base/mkiv/font-col.lua b/tex/context/base/mkiv/font-col.lua
index cf1b60bb9..b4c16c660 100644
--- a/tex/context/base/mkiv/font-col.lua
+++ b/tex/context/base/mkiv/font-col.lua
@@ -46,7 +46,6 @@ collections.vectors = vectors
local fontdata = fonts.hashes.identifiers
local chardata = fonts.hashes.characters
-local glyph_code = nodes.nodecodes.glyph
local currentfont = font.current
local fontpatternhassize = fonts.helpers.fontpatternhassize
@@ -257,7 +256,6 @@ end
function collections.process(head) -- this way we keep feature processing
local done = false
- -- for n in traverse_id(glyph_code,tonut(head)) do
for n in traverse_char(tonut(head)) do
local font = getfont(n)
local vector = vectors[font]
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index b11853533..45ecdd6c8 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -10,7 +10,6 @@ if not modules then modules = { } end modules ['font-con'] = {
local next, tostring, rawget = next, tostring, rawget
local format, match, lower, gsub = string.format, string.match, string.lower, string.gsub
-local utfbyte = utf.byte
local sort, insert, concat, sortedkeys, serialize, fastcopy = table.sort, table.insert, table.concat, table.sortedkeys, table.serialize, table.fastcopy
local derivetable = table.derive
@@ -1286,7 +1285,6 @@ function constructors.initializefeatures(what,tfmdata,features,trace,report)
local properties = tfmdata.properties or { } -- brrr
local whathandler = handlers[what]
local whatfeatures = whathandler.features
- local whatinitializers = whatfeatures.initializers
local whatmodechecker = whatfeatures.modechecker
-- properties.mode can be enforces (for instance in font-otd)
local mode = properties.mode or (whatmodechecker and whatmodechecker(tfmdata,features,features.mode)) or features.mode or "base"
diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua
index be233e570..d0cff32f8 100644
--- a/tex/context/base/mkiv/font-ctx.lua
+++ b/tex/context/base/mkiv/font-ctx.lua
@@ -109,8 +109,6 @@ local otffeatures = otf.features
local otftables = otf.tables
local registerotffeature = otffeatures.register
-local baseprocessors = otffeatures.processors.base
-local baseinitializers = otffeatures.initializers.base
local sequencers = utilities.sequencers
local appendgroup = sequencers.appendgroup
diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua
index 330a9400c..e35d6da11 100644
--- a/tex/context/base/mkiv/font-dsp.lua
+++ b/tex/context/base/mkiv/font-dsp.lua
@@ -69,7 +69,6 @@ local readers = fonts.handlers.otf.readers
local streamreader = readers.streamreader
local setposition = streamreader.setposition
-local skipbytes = streamreader.skip
local skipshort = streamreader.skipshort
local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
local readulong = streamreader.readcardinal4 -- 24-bit unsigned integer
diff --git a/tex/context/base/mkiv/font-enh.lua b/tex/context/base/mkiv/font-enh.lua
index f3209f5ee..02d5b2ddb 100644
--- a/tex/context/base/mkiv/font-enh.lua
+++ b/tex/context/base/mkiv/font-enh.lua
@@ -18,8 +18,8 @@ local report_unicoding = logs.reporter("fonts","unicoding")
local fonts = fonts
local constructors = fonts.constructors
-local tfmfeatures = constructors.newfeatures("tfm")
-local registertfmfeature = tfmfeatures.register
+----- tfmfeatures = constructors.newfeatures("tfm")
+----- registertfmfeature = tfmfeatures.register
local afmfeatures = fonts.constructors.newfeatures("afm")
local registerafmfeature = afmfeatures.register
diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua
index 98ad9e09e..61e8c8179 100644
--- a/tex/context/base/mkiv/font-ext.lua
+++ b/tex/context/base/mkiv/font-ext.lua
@@ -7,7 +7,6 @@ if not modules then modules = { } end modules ['font-ext'] = {
}
local next, type, byte = next, type, string.byte
-local utfbyte = utf.byte
local context = context
local fonts = fonts
@@ -18,7 +17,6 @@ local trace_expansion = false trackers.register("fonts.expansion", function
local report_expansions = logs.reporter("fonts","expansions")
local report_protrusions = logs.reporter("fonts","protrusions")
-local report_opbd = logs.reporter("fonts","otf opbd")
--[[ldx--
<p>When we implement functions that deal with features, most of them
@@ -823,6 +821,8 @@ registerotffeature {
--
-- local v_local = interfaces and interfaces.variables and interfaces.variables["local"] or "local"
--
+-- local utfbyte = utf.byte
+--
-- local function initialize(tfmdata,key,value)
-- local characters = tfmdata.characters
-- local parameters = tfmdata.parameters
@@ -970,7 +970,6 @@ local nodepool = nodes.pool
local new_special = nodepool.special
local new_glyph = nodepool.glyph
-local new_rule = nodepool.rule
local hpack_node = node.hpack
local helpers = fonts.helpers
diff --git a/tex/context/base/mkiv/font-gbn.lua b/tex/context/base/mkiv/font-gbn.lua
index a02406b75..1ae817ddb 100644
--- a/tex/context/base/mkiv/font-gbn.lua
+++ b/tex/context/base/mkiv/font-gbn.lua
@@ -19,7 +19,6 @@ local nodes = nodes
local nuts = nodes.nuts -- context abstraction of direct nodes
local traverse_id = nuts.traverse_id
-local remove_node = nuts.remove
local free_node = nuts.free
local glyph_code = nodes.nodecodes.glyph
diff --git a/tex/context/base/mkiv/font-gds.lua b/tex/context/base/mkiv/font-gds.lua
index 52bb9c983..184a002dd 100644
--- a/tex/context/base/mkiv/font-gds.lua
+++ b/tex/context/base/mkiv/font-gds.lua
@@ -175,7 +175,6 @@ fontgoodies.prepare_features = prepare_features
local function initialize(goodies,tfmdata)
local featuresets = goodies.featuresets
- local goodiesname = goodies.name
if featuresets then
if trace_goodies then
report_goodies("checking featuresets in %a",goodies.name)
diff --git a/tex/context/base/mkiv/font-ini.lua b/tex/context/base/mkiv/font-ini.lua
index c547f89ac..abc319484 100644
--- a/tex/context/base/mkiv/font-ini.lua
+++ b/tex/context/base/mkiv/font-ini.lua
@@ -12,8 +12,6 @@ if not modules then modules = { } end modules ['font-ini'] = {
local allocate = utilities.storage.allocate
-local report_defining = logs.reporter("fonts","defining")
-
fonts = fonts or { }
local fonts = fonts
diff --git a/tex/context/base/mkiv/font-inj.lua b/tex/context/base/mkiv/font-inj.lua
index 89370210d..a01496919 100644
--- a/tex/context/base/mkiv/font-inj.lua
+++ b/tex/context/base/mkiv/font-inj.lua
@@ -22,7 +22,6 @@ if not modules then modules = { } end modules ['font-inj'] = {
if not nodes.properties then return end
local next, rawget = next, rawget
-local utfchar = utf.char
local fastcopy = table.fastcopy
local trace_injections = false trackers.register("fonts.injections", function(v) trace_injections = v end)
diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua
index 838c74173..db4349563 100644
--- a/tex/context/base/mkiv/font-map.lua
+++ b/tex/context/base/mkiv/font-map.lua
@@ -10,7 +10,6 @@ local tonumber, next, type = tonumber, next, type
local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower
local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match
-local utfbyte = utf.byte
local floor = math.floor
local formatters = string.formatters
diff --git a/tex/context/base/mkiv/font-mps.lua b/tex/context/base/mkiv/font-mps.lua
index 7b7c859df..2f9fd1c1d 100644
--- a/tex/context/base/mkiv/font-mps.lua
+++ b/tex/context/base/mkiv/font-mps.lua
@@ -250,14 +250,12 @@ local glue_code = nodecodes.glue
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local rule_code = nodecodes.rule
-local penalty_code = nodecodes.penalty
local find_tail = nodes.tail
----- metapost = fonts.glyphs.metapost
local characters = fonts.hashes.characters
-local quaddata = fonts.hashes.emwidths
local shapes = fonts.hashes.shapes
local topaths = metapost.paths
diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua
index 7f30b6d5c..bfc8967dd 100644
--- a/tex/context/base/mkiv/font-nod.lua
+++ b/tex/context/base/mkiv/font-nod.lua
@@ -16,8 +16,6 @@ local utfchar = utf.char
local concat, fastcopy = table.concat, table.fastcopy
local match, rep = string.match, string.rep
-local report_nodes = logs.reporter("fonts","tracing")
-
fonts = fonts or { }
nodes = nodes or { }
@@ -49,7 +47,6 @@ local vlist_code = nodecodes.vlist
local disc_code = nodecodes.disc
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
-local rule_code = nodecodes.rule
local dir_code = nodecodes.dir
local localpar_code = nodecodes.localpar
@@ -100,7 +97,6 @@ local properties = nodes.properties.data
-- direct.set_properties_mode(true,true) -- default
local function freeze(h,where)
- -- report_nodes("freezing %s",where)
for n in traverse_nodes(tonut(h)) do -- todo: disc but not traced anyway
local p = properties[n]
if p then
diff --git a/tex/context/base/mkiv/font-off.lua b/tex/context/base/mkiv/font-off.lua
index 82426552e..b8fadb634 100644
--- a/tex/context/base/mkiv/font-off.lua
+++ b/tex/context/base/mkiv/font-off.lua
@@ -11,11 +11,11 @@ local round = math.round
local setmetatableindex = table.setmetatableindex
local fontloader = fontloader
-local font_to_table = fontloader.to_table
+----- font_to_table = fontloader.to_table
local open_font = fontloader.open
-local get_font_info = fontloader.info
+----- get_font_info = fontloader.info
local close_font = fontloader.close
-local font_fields = fontloader.fields
+----- font_fields = fontloader.fields
-- table={
-- ["familyname"]="TeXGyrePagella",
diff --git a/tex/context/base/mkiv/font-one.lua b/tex/context/base/mkiv/font-one.lua
index 77f2560f6..a9f78f4fb 100644
--- a/tex/context/base/mkiv/font-one.lua
+++ b/tex/context/base/mkiv/font-one.lua
@@ -812,7 +812,8 @@ local function check_afm(specification,fullname)
end
function readers.afm(specification,method)
- local fullname, tfmdata = specification.filename or "", nil
+ local fullname = specification.filename or ""
+ local tfmdata = nil
if fullname == "" then
local forced = specification.forced or ""
if forced ~= "" then
@@ -841,7 +842,16 @@ function readers.pfb(specification,method) -- only called when forced
if trace_defining then
report_afm("using afm reader for %a",original)
end
- specification.specification = file.replacesuffix(original,"afm")
specification.forced = "afm"
+ local function swap(name)
+ local value = specification[swap]
+ if value then
+ specification[swap] = gsub("%.pfb",".afm",1)
+ end
+ end
+ swap("filename")
+ swap("fullname")
+ swap("forcedname")
+ swap("specification")
return readers.afm(specification,method)
end
diff --git a/tex/context/base/mkiv/font-onr.lua b/tex/context/base/mkiv/font-onr.lua
index 2699f25bb..a4969ad73 100644
--- a/tex/context/base/mkiv/font-onr.lua
+++ b/tex/context/base/mkiv/font-onr.lua
@@ -33,6 +33,7 @@ local trace_indexing = false trackers.register("afm.indexing", function(v
local trace_loading = false trackers.register("afm.loading", function(v) trace_loading = v end)
local report_afm = logs.reporter("fonts","afm loading")
+local report_afm = logs.reporter("fonts","pfb loading")
fonts = fonts or { }
local handlers = fonts.handlers or { }
@@ -122,19 +123,19 @@ do
local data = io.loaddata(resolvers.findfile(filename))
if not data then
- print("no data",filename)
+ report_pfb("no data in %a",filename)
return
end
- if not find(data,"!PS%-AdobeFont%-") then
- print("no font",filename)
+ if not (find(data,"!PS%-AdobeFont%-") or find(data,"%%!FontType1")) then
+ report_pfb("no font in %a",filename)
return
end
local ascii, binary = match(data,"(.*)eexec%s+......(.*)")
if not binary then
- print("no binary",filename)
+ report_pfb("no binary data in %a",filename)
return
end
@@ -148,7 +149,7 @@ do
end
if not vector then
- print("no vector",filename)
+ report_pfb("no vector in %a",filename)
return
end
@@ -184,16 +185,18 @@ and <l n='otf'/> reader. We only need data that is relevant for our use. We don'
more complex arrangements like multiple master (obsolete), direction specific kerning, etc.</p>
--ldx]]--
-local spacing = patterns.whitespace
-local lineend = patterns.newline
-local number = spacing * S("+-")^-1 * (R("09") + S("."))^1 / tonumber
-local name = spacing * C((1-spacing)^1)
-local words = spacing * (1 - lineend)^1 / strip
-local rest = (1 - lineend)^0
-local fontdata = Carg(1)
-local semicolon = spacing * P(";")
-local plus = P("plus") * number
-local minus = P("minus") * number
+local spacer = patterns.spacer
+local whitespace = patterns.whitespace
+local lineend = patterns.newline
+local spacing = spacer^0
+local number = spacing * S("+-")^-1 * (R("09") + S("."))^1 / tonumber
+local name = spacing * C((1 - whitespace)^1)
+local words = spacing * ((1 - lineend)^1 / strip)
+local rest = (1 - lineend)^0
+local fontdata = Carg(1)
+local semicolon = spacing * P(";")
+local plus = spacing * P("plus") * number
+local minus = spacing * P("minus") * number
-- kern pairs
@@ -333,6 +336,10 @@ local fullparser = ( P("StartFontMetrics") * fontdata * name / start )
* ( p_charmetrics + p_kernpairs + p_parameters + (1-P("EndFontMetrics")) )^0
* ( P("EndFontMetrics") / stop )
+local fullparser = ( P("StartFontMetrics") * fontdata * name / start )
+ * ( p_charmetrics + p_kernpairs + p_parameters + (1-P("EndFontMetrics")) )^0
+ * ( P("EndFontMetrics") / stop )
+
local infoparser = ( P("StartFontMetrics") * fontdata * name / start )
* ( p_parameters + (1-P("EndFontMetrics")) )^0
* ( P("EndFontMetrics") / stop )
@@ -402,4 +409,3 @@ function readers.getinfo(filename)
return data.metadata
end
end
-
diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua
index 6ff2e38b6..d2bb2100f 100644
--- a/tex/context/base/mkiv/font-osd.lua
+++ b/tex/context/base/mkiv/font-osd.lua
@@ -79,9 +79,6 @@ fonts.analyzers.methods = fonts.analyzers.methods or { node = { otf = { } } }
local otf = fonts.handlers.otf
-local nodecodes = nodes.nodecodes
-local glyph_code = nodecodes.glyph
-
local handlers = otf.handlers
local methods = fonts.analyzers.methods
diff --git a/tex/context/base/mkiv/font-ota.lua b/tex/context/base/mkiv/font-ota.lua
index 6a3804a74..42566ebfd 100644
--- a/tex/context/base/mkiv/font-ota.lua
+++ b/tex/context/base/mkiv/font-ota.lua
@@ -44,7 +44,6 @@ local getchar = nuts.getchar
local ischar = nuts.is_char
local traverse_id = nuts.traverse_id
-local traverse_node_list = nuts.traverse
local end_of_math = nuts.end_of_math
local nodecodes = nodes.nodecodes
diff --git a/tex/context/base/mkiv/font-otb.lua b/tex/context/base/mkiv/font-otb.lua
index c9f5d4aca..a31079225 100644
--- a/tex/context/base/mkiv/font-otb.lua
+++ b/tex/context/base/mkiv/font-otb.lua
@@ -8,8 +8,6 @@ if not modules then modules = { } end modules ['font-otb'] = {
local concat = table.concat
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring, rawget = type, next, tonumber, tostring, rawget
-local lpegmatch = lpeg.match
-local utfchar = utf.char
local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end)
local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end)
diff --git a/tex/context/base/mkiv/font-otd.lua b/tex/context/base/mkiv/font-otd.lua
index 2257caa8c..fc5ba64c9 100644
--- a/tex/context/base/mkiv/font-otd.lua
+++ b/tex/context/base/mkiv/font-otd.lua
@@ -36,9 +36,6 @@ local contextmerged = specifiers.contextmerged
local setmetatableindex = table.setmetatableindex
-local otffeatures = fonts.constructors.newfeatures("otf")
-local registerotffeature = otffeatures.register
-
local a_to_script = { }
local a_to_language = { }
diff --git a/tex/context/base/mkiv/font-otf.lua b/tex/context/base/mkiv/font-otf.lua
index a1730aced..17d3b34ad 100644
--- a/tex/context/base/mkiv/font-otf.lua
+++ b/tex/context/base/mkiv/font-otf.lua
@@ -20,7 +20,6 @@ if not modules then modules = { } end modules ['font-otf'] = {
-- more checking against low level calls of functions
-local utfbyte = utf.byte
local gmatch, gsub, find, match, lower, strip = string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring = type, next, tonumber, tostring
local abs = math.abs
diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua
index b65a9db66..61baf931d 100644
--- a/tex/context/base/mkiv/font-otj.lua
+++ b/tex/context/base/mkiv/font-otj.lua
@@ -27,7 +27,6 @@ if not modules then modules = { } end modules ['font-otj'] = {
if not nodes.properties then return end
local next, rawget = next, rawget
-local utfchar = utf.char
local fastcopy = table.fastcopy
local registertracker = trackers.register
@@ -92,7 +91,6 @@ local traverse_id = nuts.traverse_id
local traverse_char = nuts.traverse_char
local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
-local find_tail = nuts.tail
local properties = nodes.properties.data
diff --git a/tex/context/base/mkiv/font-otn.lua b/tex/context/base/mkiv/font-otn.lua
index 7e701c4b4..50e0f532e 100644
--- a/tex/context/base/mkiv/font-otn.lua
+++ b/tex/context/base/mkiv/font-otn.lua
@@ -192,7 +192,6 @@ local report_subchain = logs.reporter("fonts","otf subchain")
local report_chain = logs.reporter("fonts","otf chain")
local report_process = logs.reporter("fonts","otf process")
local report_prepare = logs.reporter("fonts","otf prepare")
-local report_warning = logs.reporter("fonts","otf warning")
local report_run = logs.reporter("fonts","otf run")
registertracker("otf.verbose_chain", function(v) otf.setcontextchain(v and "verbose") end)
@@ -226,10 +225,7 @@ local setsubtype = nuts.setsubtype
local getchar = nuts.getchar
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
-local delete_node = nuts.delete
-local remove_node = nuts.remove
local copy_node = nuts.copy
local copy_node_list = nuts.copy_list
local find_node_tail = nuts.tail
@@ -251,7 +247,6 @@ local glyphcodes = nodes.glyphcodes
local disccodes = nodes.disccodes
local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
local disc_code = nodecodes.disc
local math_code = nodecodes.math
local dir_code = nodecodes.dir
@@ -1228,41 +1223,6 @@ example, the following is valid:</p>
<line>xxxabcdexxx [single a->A][multiple b->BCD][ligature cde->E] xxxABCDExxx</line>
</typing>
-<p>Therefore we we don't really do the replacement here already unless we have the
-single lookup case. The efficiency of the replacements can be improved by deleting
-as less as needed but that would also make the code even more messy.</p>
---ldx]]--
-
--- local function delete_till_stop(head,start,stop,ignoremarks) -- keeps start
--- local n = 1
--- if start == stop then
--- -- done
--- elseif ignoremarks then
--- repeat -- start x x m x x stop => start m
--- local next = getnext(start)
--- if not marks[getchar(next)] then
--- local components = getnext(next,"components")
--- if components then -- probably not needed
--- flush_node_list(components)
--- end
--- head = delete_node(head,next)
--- end
--- n = n + 1
--- until next == stop
--- else -- start x x x stop => start
--- repeat
--- local next = getnext(start)
--- local components = getfield(next,"components")
--- if components then -- probably not needed
--- flush_node_list(components)
--- end
--- head = delete_node(head,next)
--- n = n + 1
--- until next == stop
--- end
--- return head, n
--- end
-
--[[ldx--
<p>Here we replace start by a single variant.</p>
--ldx]]--
diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua
index 23beba787..119977835 100644
--- a/tex/context/base/mkiv/font-oto.lua
+++ b/tex/context/base/mkiv/font-oto.lua
@@ -14,8 +14,6 @@ local concat, unpack = table.concat, table.unpack
local insert, remove = table.insert, table.remove
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
local type, next, tonumber, tostring, rawget = type, next, tonumber, tostring, rawget
-local lpegmatch = lpeg.match
-local utfchar = utf.char
local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end)
local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end)
diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua
index c967e2411..659526297 100644
--- a/tex/context/base/mkiv/font-otr.lua
+++ b/tex/context/base/mkiv/font-otr.lua
@@ -99,7 +99,7 @@ readers.streamreader = streamreader
local openfile = streamreader.open
local closefile = streamreader.close
-local skipbytes = streamreader.skip
+----- skipbytes = streamreader.skip
local setposition = streamreader.setposition
local skipshort = streamreader.skipshort
local readbytes = streamreader.readbytes
@@ -108,7 +108,7 @@ local readbyte = streamreader.readcardinal1 -- 8-bit unsigned integer
local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
local readuint = streamreader.readcardinal3 -- 24-bit unsigned integer
local readulong = streamreader.readcardinal4 -- 24-bit unsigned integer
-local readchar = streamreader.readinteger1 -- 8-bit signed integer
+----- readchar = streamreader.readinteger1 -- 8-bit signed integer
local readshort = streamreader.readinteger2 -- 16-bit signed integer
local readlong = streamreader.readinteger4 -- 24-bit unsigned integer
local readfixed = streamreader.readfixed4
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index c173de2be..669668eb8 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -145,10 +145,8 @@ local report_direct = logs.reporter("fonts","otf direct")
local report_subchain = logs.reporter("fonts","otf subchain")
local report_chain = logs.reporter("fonts","otf chain")
local report_process = logs.reporter("fonts","otf process")
------ report_prepare = logs.reporter("fonts","otf prepare")
local report_warning = logs.reporter("fonts","otf warning")
local report_run = logs.reporter("fonts","otf run")
-local report_check = logs.reporter("fonts","otf check")
registertracker("otf.replacements", "otf.singles,otf.multiples,otf.alternatives,otf.ligatures")
registertracker("otf.positions","otf.marks,otf.kerns,otf.cursive")
@@ -185,10 +183,7 @@ local setlink = nuts.setlink
local ischar = nuts.is_char
-local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
-local delete_node = nuts.delete
-local remove_node = nuts.remove
local copy_node = nuts.copy
local copy_node_list = nuts.copy_list
local find_node_tail = nuts.tail
@@ -3064,7 +3059,7 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm
while start do
local char = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if not a or (a == attr) then
local lookupmatch = lookupcache[char]
if lookupmatch then
@@ -3097,7 +3092,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
while start ~= stop do
local char = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if not a or (a == attr) then
local lookupmatch = lookupcache[char]
if lookupmatch then -- hm, hyphens can match (tlig) so we need to really check
@@ -3132,7 +3127,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
end
-- local function d_run_single(prev,font,attr,lookupcache,step,dataset,sequence,rlmode,handler)
--- local a = getattr(prev,0)
+-- local a = attr and getattr(prev,0)
-- if not a or (a == attr) then
-- local char = ischar(prev) -- can be disc
-- if char then
@@ -3149,7 +3144,7 @@ end
-- end
local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,handler)
- local a = getattr(sub,0)
+ local a = attr and getattr(sub,0)
if not a or (a == attr) then
for n in traverse_nodes(sub) do -- only gpos
if n == last then
@@ -3181,7 +3176,7 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm
while start do
local char = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if not a or (a == attr) then
for i=1,nofsteps do
local step = steps[i]
@@ -3228,7 +3223,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
while start ~= stop do
local char = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if not a or (a == attr) then
for i=1,nofsteps do
local step = steps[i]
@@ -3271,7 +3266,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
end
-- local function d_run_multiple(prev,attr,steps,nofsteps,dataset,sequence,rlmode,handler)
--- local a = getattr(prev,0)
+-- local a = attr and getattr(prev,0)
-- if not a or (a == attr) then
-- local char = ischar(prev) -- can be disc
-- if char then
@@ -3297,7 +3292,7 @@ end
-- end
local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler)
- local a = getattr(sub,0)
+ local a = attr and getattr(sub,0)
if not a or (a == attr) then
for n in traverse_nodes(sub) do -- only gpos
if n == last then
@@ -3394,6 +3389,10 @@ local function featuresprocessor(head,font,attr)
end
+ if attr == 0 then
+ attr = false -- some 10% faster when no dynamics but hardly measureable on real runs
+ end
+
head = tonut(head)
if trace_steps then
@@ -3405,7 +3404,7 @@ local function featuresprocessor(head,font,attr)
local done = false
local datasets = otf.dataset(tfmdata,font,attr)
- local dirstack = { } -- could move outside function btu we can have local runss
+ local dirstack = { } -- could move outside function but we can have local runs
sweephead = { }
@@ -3451,7 +3450,7 @@ local function featuresprocessor(head,font,attr)
while start do
local char = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if not a or (a == attr) then
for i=1,nofsteps do
local step = steps[i]
@@ -3489,14 +3488,12 @@ local function featuresprocessor(head,font,attr)
local step = steps[1]
local lookupcache = step.coverage
if not lookupcache then
- -- can't happen, no check in loop either
report_missing_coverage(dataset,sequence)
else
-
while start do
local char, id = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if a then
a = (a == attr) and (not attribute or getprop(start,a_state) == attribute)
else
@@ -3553,7 +3550,7 @@ local function featuresprocessor(head,font,attr)
while start do
local char, id = ischar(start,font)
if char then
- local a = getattr(start,0)
+ local a = attr and getattr(start,0)
if a then
a = (a == attr) and (not attribute or getprop(start,a_state) == attribute)
else
diff --git a/tex/context/base/mkiv/font-ott.lua b/tex/context/base/mkiv/font-ott.lua
index f8d74a317..48d05d492 100644
--- a/tex/context/base/mkiv/font-ott.lua
+++ b/tex/context/base/mkiv/font-ott.lua
@@ -18,7 +18,6 @@ local allocate = utilities.storage.allocate
local fonts = fonts
local otf = fonts.handlers.otf
local otffeatures = otf.features
-local registerotffeature = otffeatures.register
local tables = otf.tables or { }
otf.tables = tables
diff --git a/tex/context/base/mkiv/font-sel.lua b/tex/context/base/mkiv/font-sel.lua
index c3431a213..a2323ad0b 100644
--- a/tex/context/base/mkiv/font-sel.lua
+++ b/tex/context/base/mkiv/font-sel.lua
@@ -9,15 +9,15 @@ if not modules then modules = { } end modules ['font-sel'] = {
local context = context
local cleanname = fonts.names.cleanname
local gsub, splitup, find = string.gsub, string.splitup, string.find
+local concat, sortedkeys = table.concat, table.sortedkeys
+local merge, remove = table.merge, table.remove
local splitbase, removesuffix = file.splitbase, file.removesuffix
local splitat, lpegmatch = lpeg.splitat, lpeg.match
local formatters = string.formatters
local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_hash = utilities.parsers.settings_to_hash
-local v_yes = interfaces.variables.yes
-local v_simplefonts = interfaces.variables.simplefonts
-local v_selectfont = interfaces.variables.selectfont
local v_default = interfaces.variables.default
local implement = interfaces.implement
@@ -34,293 +34,66 @@ selectfont.fallbacks = fallbacks
local methods = selectfont.methods or { }
selectfont.methods = methods
-local getlookups = fonts.names.getlookups
-local registerdesignsizes = fonts.goodies.designsizes.register
-
-local alternatives = {
- ["tf"] = "regular",
- ["it"] = "italic",
- ["sl"] = "slanted",
- ["bf"] = "bold",
- ["bi"] = "bolditalic",
- ["bs"] = "boldslanted",
- ["sc"] = "smallcaps",
-}
-
-local styles = {
- ["rm"] = "serif",
- ["ss"] = "sans",
- ["tt"] = "mono",
- ["hw"] = "handwriting",
- ["cg"] = "calligraphy",
- ["mm"] = "math",
-}
-
-local sizes = {
- ["default"] = {
- { 40, "4pt" },
- { 50, "5pt" },
- { 60, "6pt" },
- { 70, "7pt" },
- { 80, "8pt" },
- { 90, "9pt" },
- { 100, "10pt" },
- { 110, "11pt" },
- { 120, "12pt" },
- { 144, "14.4pt" },
- { 173, "17.3pt" },
- },
- ["dtp"] = {
- { 50, "5pt" },
- { 60, "6pt" },
- { 70, "7pt" },
- { 80, "8pt" },
- { 90, "9pt" },
- { 100, "10pt" },
- { 110, "11pt" },
- { 120, "12pt" },
- { 130, "13pt" },
- { 140, "14pt" },
- { 160, "16pt" },
- { 180, "18pt" },
- { 220, "22pt" },
- { 280, "28pt" },
- }
-}
-
-local synonyms = {
- ["rm"] = {
- ["tf"] = "Serif",
- ["it"] = "SerifItalic",
- ["sl"] = "SerifSlanted",
- ["bf"] = "SerifBold",
- ["bi"] = "SerifBoldItalic",
- ["bs"] = "SerifBoldSlanted",
- ["sc"] = "SerifCaps",
- },
- ["ss"] = {
- ["tf"] = "Sans",
- ["it"] = "SansItalic",
- ["sl"] = "SansSlanted",
- ["bf"] = "SansBold",
- ["bi"] = "SansBoldItalic",
- ["bs"] = "SansBoldSlanted",
- ["sc"] = "SansCaps",
- },
- ["tt"] = {
- ["tf"] = "Mono",
- ["it"] = "MonoItalic",
- ["sl"] = "MonoSlanted",
- ["bf"] = "MonoBold",
- ["bi"] = "MonoBoldItalic",
- ["bs"] = "MonoBoldSlanted",
- ["sc"] = "MonoCaps",
- },
- ["hw"] = {
- ["tf"] = "Handwriting",
- },
- ["cg"] = {
- ["tf"] = "Calligraphy",
- },
- ["mm"] = {
- ["tf"] = "MathRoman",
- ["bf"] = "MathBold",
- }
-}
+local extras = selectfont.extras or { }
+selectfont.extras = extras
-local replacement = {
- ["style"] = {
- ["it"] = "tf",
- ["sl"] = "it",
- ["bf"] = "tf",
- ["bi"] = "bf",
- ["bs"] = "bi",
- ["sc"] = "tf",
- },
- ["weight"] = {
- ["it"] = "tf",
- ["sl"] = "tf",
- ["bf"] = "tf",
- ["bi"] = "bf",
- ["bs"] = "bf",
- ["sc"] = "tf",
- },
-}
-
-local names = {
- ["selectfont"] = { -- weight, style, width, variant, italic
- ["regular"] = { weight = "normal", style = "normal", width = "normal", variant = "normal", italic = false },
- ["italic"] = { weight = "normal", style = "italic", width = "normal", variant = "normal", italic = true },
- ["slanted"] = { weight = "normal", style = "slanted", width = "normal", variant = "normal", italic = true },
- ["medium"] = { weight = "medium", style = "normal", width = "normal", variant = "normal", italic = false },
- ["mediumitalic"] = { weight = "medium", style = "italic", width = "normal", variant = "normal", italic = true },
- ["mediumcaps"] = { weight = "medium", style = "normal", width = "normal", variant = "smallcaps", italic = true },
- ["bold"] = { weight = "bold", style = "normal", width = "normal", variant = "normal", italic = false },
- ["bolditalic"] = { weight = "bold", style = "italic", width = "normal", variant = "normal", italic = true },
- ["boldslanted"] = { weight = "bold", style = "slanted", width = "normal", variant = "normal", italic = true },
- ["smallcaps"] = { weight = "normal", style = "normal", width = "normal", variant = "smallcaps", italic = false },
- },
- ["simplefonts"] = {
- ["light"] = { "lightregular", "light" },
- ["lightitalic"] = { "lightitalic", "lightit", "lightoblique" },
- ["lightcaps"] = { "smallcapslight" },
- ["regular"] = { "roman", "regular", "book", "" },
- ["italic"] = { "italic", "it", "oblique", "kursiv", "bookitalic", "bookit" },
- ["medium"] = { "mediumregular", "medregular", "medium" },
- ["mediumitalic"] = { "mediumitalic", "meditalic" },
- ["mediumcaps"] = { "mediumcaps" },
- ["bold"] = { "bold", "bd", "kraeftig", "mediumregular", "semibold", "demi" },
- ["bolditalic"] = { "bolditalic", "boldit", "bdit", "boldoblique", "mediumitalic", "semibolditalic", "demiitalic" },
- ["smallcaps"] = { "smallcaps", "capitals", "sc" },
- ["heavy"] = { "heavyregular", "heavy" },
- ["heavyitalic"] = { "heavyitalic" },
- },
- ["default"] = { -- weight, width, italic
- ["thin"] = { weight = { 100, 200, 300, 400, 500 }, width = 5, italic = false },
- ["thinitalic"] = { weight = { 100, 200, 300, 400, 500 }, width = 5, italic = true },
- ["extralight"] = { weight = { 200, 100, 300, 400, 500 }, width = 5, italic = false },
- ["extralightitalic"] = { weight = { 200, 100, 300, 400, 500 }, width = 5, italic = true },
- ["light"] = { weight = { 300, 200, 100, 400, 500 }, width = 5, italic = false },
- ["lightitalic"] = { weight = { 300, 200, 100, 400, 500 }, width = 5, italic = true },
- ["regular"] = { weight = { 400, 500, 300, 200, 100 }, width = 5, italic = false },
- ["italic"] = { weight = { 400, 500, 300, 200, 100 }, width = 5, italic = true },
- ["medium"] = { weight = { 500, 400, 300, 200, 100 }, width = 5, italic = false },
- ["mediumitalic"] = { weight = { 500, 400, 300, 200, 100 }, width = 5, italic = true },
- ["demibold"] = { weight = { 600, 700, 800, 900 }, width = 5, italic = false },
- ["demibolditalic"] = { weight = { 600, 700, 800, 900 }, width = 5, italic = true },
- ["bold"] = { weight = { 700, 600, 800, 900 }, width = 5, italic = false },
- ["bolditalic"] = { weight = { 700, 600, 800, 900 }, width = 5, italic = true },
- ["extrabold"] = { weight = { 800, 900, 700, 600 }, width = 5, italic = false },
- ["extrabolditalic"] = { weight = { 800, 900, 700, 600 }, width = 5, italic = true },
- ["heavy"] = { weight = { 900, 800, 700, 600 }, width = 5, italic = false },
- ["heavyitalic"] = { weight = { 900, 800, 700, 600 }, width = 5, italic = true },
- }
-}
-
--- simplefonts synonyms
-
-names.simplefonts.slanted = names.simplefonts.italic
-names.simplefonts.boldslanted = names.simplefonts.bolditalic
-
--- default synonyms
-
-names.default.ultralight = names.default.extralight
-names.default.semibold = names.default.demibold
-names.default.ultrabold = names.default.extrabold
-names.default.black = names.default.heavy
-
-names.default.ultralightitalic = names.default.extralightitalic
-names.default.semibolditalic = names.default.demibolditalic
-names.default.ultrabolditalic = names.default.extrabolditalic
-names.default.blackitalic = names.default.heavyitalic
-
-names.default.thinslanted = names.default.thinitalic
-names.default.extralightslanted = names.default.extralightitalic
-names.default.ultralightslanted = names.default.extralightitalic
-names.default.lightslanted = names.default.lightitalic
-names.default.slanted = names.default.italic
-names.default.demiboldslanted = names.default.demibolditalic
-names.default.semiboldslanted = names.default.demibolditalic
-names.default.boldslanted = names.default.bolditalic
-names.default.extraboldslanted = names.default.extrabolditalic
-names.default.ultraboldslanted = names.default.extrabolditalic
-names.default.heavyslanted = names.default.heavyitalic
-names.default.blackslanted = names.default.heavyitalic
-
-names.default.smallcaps = names.default.regular
-
-local mathsettings = {
- ["asanamath"] = {
- extras = "asana-math",
- goodies = {
- ["tf"] = "anana-math",
- },
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["cambriamath"] = {
- extras = "cambria-math",
- goodies = {
- ["tf"] = "cambria-math",
- },
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["neoeuler"] = {
- extras = "euler-math",
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["latinmodernmath"] = {
- extras = "lm,lm-math",
- goodies = {
- ["tf"] = "lm",
- },
- features = {
- ["tf"] = "math\\mathsizesuffix,lm-math",
- },
- },
- ["lucidabrightmathot"] = {
- extras = "lucida-opentype-math",
- goodies = {
- ["tf"] = "lucida-opentype-math",
- },
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["texgyrepagellamath"] = {
- extras = "texgyre",
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["texgyrebonummath"] = {
- extras = "texgyre",
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["texgyretermesmath"] = {
- extras = "texgyre",
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
- ["xitsmath"] = {
- extras = "xits-math",
- goodies = {
- ["tf"] = "xits-math",
- },
- features = {
- ["tf"] = "math\\mathsizesuffix",
- },
- },
-}
+local alternatives = selectfont.alternatives or { }
+selectfont.alternatives = alternatives
-function selectfont.define(settings)
- local index = #data + 1
- data[index] = settings
- selectfont.searchfiles(index)
- selectfont.filterinput(index)
- return index
-end
+local presets = selectfont.presets or { }
+selectfont.presets = presets
-local function savefont(data,alternative,entries)
- local f = data.fonts
- if not f then
- f = { }
- data.fonts = f
- end
- f[alternative] = entries
-end
+local defaults = selectfont.defaults or { }
+selectfont.defaults = defaults
-local function savefeatures(data,alternative,entries)
- local e = gsub(entries,"{(.*)}","%1")
+local getlookups = fonts.names.getlookups
+local registerdesignsizes = fonts.goodies.designsizes.register
+local bodyfontsizes = storage.shared.bodyfontsizes
+
+local ctx_definefontsynonym = context.definefontsynonym
+local ctx_resetfontfallback = context.resetfontfallback
+local ctx_startfontclass = context.startfontclass
+local ctx_stopfontclass = context.stopfontclass
+local ctx_loadfontgoodies = context.loadfontgoodies
+local ctx_definefontfallback = context.definefontfallback
+local ctx_definetypeface = context.definetypeface
+local ctx_definebodyfont = context.definebodyfont
+
+local trace_register = false trackers.register("selectfont.register", function(v) trace_register = v end)
+local trace_files = false trackers.register("selectfont.files", function(v) trace_files = v end)
+local trace_features = false trackers.register("selectfont.features", function(v) trace_features = v end)
+local trace_goodies = false trackers.register("selectfont.goodies", function(v) trace_goodies = v end)
+local trace_alternatives = false trackers.register("selectfont.alternatives", function(v) trace_alternatives = v end)
+local trace_typescript = false trackers.register("selectfont.typescripts", function(v) trace_typescript = v end)
+
+local report_selectfont = logs.reporter("selectfont")
+local report_files = logs.reporter("selectfont","files")
+local report_features = logs.reporter("selectfont","features")
+local report_goodies = logs.reporter("selectfont","goodies")
+local report_typescript = logs.reporter("selectfont","typescripts")
+
+defaults["rm"] = { features = { ["sc"] = "*,f:smallcaps" } }
+defaults["ss"] = { features = { ["sc"] = "*,f:smallcaps" } }
+
+defaults["asanamath"] = { options = { extras = "asana-math", features = "math\\mathsizesuffix", goodies = "anana-math" } }
+defaults["cambriamath"] = { options = { extras = "cambria-math", features = "math\\mathsizesuffix", goodies = "cambria-math" } }
+defaults["dejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix" } }
+defaults["neoeuler"] = { options = { extras = "euler-math", features = "math\\mathsizesuffix" } }
+defaults["latinmodernmath"] = { options = { extras = "lm,lm-math", features = "math\\mathsizesuffix,lm-math", goodies = "lm" } }
+defaults["lucidabrightmathot"] = { options = { extras = "lucida-opentype-math", features = "math\\mathsizesuffix", goodies = "lucida-opentype-math" } }
+defaults["texgyrepagellamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
+defaults["texgyrebonummath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
+defaults["texgyrescholamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
+defaults["texgyretermesmath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
+defaults["xitsmath"] = { options = { extras = "xits-math", features = "math\\mathsizesuffix", goodies = "xits-math" } }
+
+extras["features"] = function(data,alternative,features)
+ local d = data.options.features
+ local e = gsub(gsub(features,"*",d),"{(.*)}","%1")
local f = data.features
+ if trace_features then
+ report_features("Alternative '%s': Saving features '%s'",alternative,e)
+ end
if not f then
f = { }
data.features = f
@@ -328,443 +101,824 @@ local function savefeatures(data,alternative,entries)
f[alternative] = e
end
-local function savegoodies(data,alternative,entries)
- local e = gsub(entries,"{(.*)}","%1")
+extras["goodies"] = function(data,alternative,goodies)
+ local e = gsub(goodies,"{(.*)}","%1")
local g = data.goodies
- if not f then
+ if trace_goodies then
+ report_goodies("Alternative '%s': Saving goodies '%s'",alternative,e)
+ end
+ if not g then
g = { }
data.goodies = g
end
g[alternative] = e
end
-methods[v_simplefonts] = function(data,alternative,style)
- local family = data.metadata.family
- local names = names["simplefonts"][style] or names["simplefonts"]["regular"]
- for _, name in next, names do
- local filename = cleanname(formatters["%s%s"](family,name))
- local fullname = getlookups{ fullname = filename }
- local fontname = getlookups{ fontname = filename }
- local cleanfilename = getlookups{ cleanfilename = filename }
- if #fullname > 0 then
- savefont(data,alternative,fullname)
- break
- elseif #fontname > 0 then
- savefont(data,alternative,fontname)
- break
- elseif #cleanfilename > 0 then
- savefont(data,alternative,cleanfilename)
- break
- end
+local function selectfont_savefile(data,alternative,bodyfontsize,size,file)
+ local f = data.files
+ local p, n = splitbase(file["filename"])
+ local t = file["format"]
+ local r = file["rawname"]
+ if t == "ttc" then
+ n = formatters["%s(%s)"](n,r)
end
-end
-
-methods[v_default] = function(data,alternative,style)
- local family = data.metadata.family
- local spec = names["default"][style] or names["default"]["regular"]
- local weights = spec["weight"]
- for _, weight in next, weights do
- local pattern = getlookups{
- familyname = cleanname(family),
- pfmweight = weight,
- pfmwidth = spec["width"],
- }
- if #pattern > 0 then
- local fontfiles = { }
- for _, fontfile in next, pattern do
- if (fontfile["angle"] and spec["italic"] == true) or (not fontfile["angle"] and spec["italic"] == false) then
- fontfiles[#fontfiles + 1] = fontfile
- end
- end
- savefont(data,alternative,fontfiles)
- break
- end
+ if not f then
+ f = { }
+ data.files = f
end
-end
-
-methods[v_selectfont] = function(data,alternative,style)
- local family = data.metadata.family
- local spec = names["selectfont"][style] or names["selectfont"]["regular"]
- local pattern = getlookups{
- familyname = cleanname(family),
- weight = spec["weight"],
- style = spec["style"],
- width = spec["width"],
- variant = spec["variant"]
- }
- if #pattern > 0 then
- local fontfiles = { }
- for _, fontfile in next, pattern do
- if (fontfile["angle"] and spec["italic"] == true) or (not fontfile["angle"] and spec["italic"] == false) then
- fontfiles[#fontfiles + 1] = fontfile
- end
- end
- savefont(data,alternative,fontfiles)
+ local a = f[alternative]
+ if not a then
+ a = { }
+ f[alternative] = a
+ end
+ a[bodyfontsize] = { size, n }
+ if trace_files then
+ report_files("Alternative '%s': Saving file '%s' for size '%s'",alternative,n,size)
end
end
-methods["name"] = function(data,alternative,filename)
- local data = data
+methods["name"] = function(data,alternative,name)
local family = data.metadata.family
- local filename = cleanname(gsub(filename,"*",family))
- local fullname = getlookups{ fullname = filename }
+ local filename = cleanname(gsub(name,"*",family))
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': Using method 'name' with argument '%s'",alternative,filename)
+ end
local fontname = getlookups{ fontname = filename }
- if #fullname > 0 then
- savefont(data,alternative,fullname)
- elseif #fontname > 0 then
- savefont(data,alternative,fontname)
+ local fullname = getlookups{ fullname = filename }
+ if #fontname > 0 then
+ selectfont_savefile(data,alternative,0,"default",fullname[1])
+ elseif #fullname > 0 then
+ selectfont_savefile(data,alternative,0,"default",fontname[1])
+ else
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': No font was found for the requested name '%s'",alternative,filename)
+ end
end
end
-methods["file"] = function(data,alternative,filename)
- local data = data
+methods["file"] = function(data,alternative,file)
local family = data.metadata.family
- local filename = gsub(removesuffix(filename),"*",family)
+ local filename = cleanname(gsub(removesuffix(file),"*",family))
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': Using method 'file' with argument '%s'",alternative,filename)
+ end
local filename = getlookups{ cleanfilename = cleanname(filename) }
if #filename > 0 then
- savefont(data,alternative,filename)
+ selectfont_savefile(data,alternative,0,"default",filename[1])
+ else
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': No font was found for the requested file '%s'",alternative,cleanname(gsub(removesuffix(file),"*",family)))
+ end
end
end
-methods["spec"] = function(data,alternative,filename)
- local family = data.metadata.family
- local weight, style, width, variant = splitup(filename,"-")
- local pattern = getlookups{
- familyname = cleanname(family),
- weight = weight or "normal",
- style = style or "normal",
- width = width or "normal",
- variant = variant or "normal",
- }
- if #pattern > 0 then
- savefont(data,alternative,pattern)
- end
-end
+local m_weight = {
+ ["thin"] = 100,
+ ["extralight"] = 200,
+ ["light"] = 300,
+ ["regular"] = 400,
+ ["medium"] = 500,
+ ["semibold"] = 600,
+ ["bold"] = 700,
+ ["extrabold"] = 800,
+ ["black"] = 900
+}
-methods["style"] = function(data,alternative,style)
- local method = data.options.alternative or nil
- (methods[method] or methods[v_default])(data,alternative,style)
-end
+local m_width = {
+ ["ultracondensed"] = 1,
+ ["extracondensed"] = 2,
+ ["condensed"] = 3,
+ ["semicondensed"] = 4,
+ ["normal"] = 5,
+ ["semiexpanded"] = 6,
+ ["expanded"] = 7,
+ ["extraexpanded"] = 8,
+ ["ultraexpanded"] = 9,
+}
-methods["features"] = function(data,alternative,features)
- savefeatures(data,alternative,features)
-end
+local m_name = {
+ ["thin"] = { weight = "thin" },
+ ["thinitalic"] = { weight = "thin", style = "italic" },
+ ["extralight"] = { weight = "extralight" },
+ ["extralightitalic"] = { weight = "extralight", style = "italic" },
+ ["light"] = { weight = "light" },
+ ["lightitalic"] = { weight = "light", style = "italic" },
+ ["regular"] = { weight = { "regular", "medium" } },
+ ["italic"] = { weight = { "regular", "medium" }, style = "italic" },
+ ["medium"] = { weight = "medium" },
+ ["mediumitalic"] = { weight = "medium", style = "italic" },
+ ["semibold"] = { weight = "semibold" },
+ ["semibolditalic"] = { weight = "semibold", style = "italic" },
+ ["bold"] = { weight = { "bold", "semibold" } },
+ ["bolditalic"] = { weight = { "bold", "semibold" }, style = "italic" },
+ ["extrabold"] = { weight = "extrabold" },
+ ["extrabolditalic"] = { weight = "extrabold", style = "italic" },
+ ["black"] = { weight = "black" },
+ ["blackitalic"] = { weight = "black", style = "italic" },
+ ["smallcaps"] = { weight = "regular", variant = "smallcaps" },
+}
+
+local m_alternative = {
+ ["tf"] = "regular",
+ ["bf"] = "bold",
+ ["it"] = "italic",
+ ["sl"] = "italic",
+ ["bi"] = "bolditalic",
+ ["bs"] = "bolditalic",
+ ["sc"] = "regular"
+}
-methods["goodies"] = function(data,alternative,goodies)
- savegoodies(data,alternative,goodies)
+--~ methods["style"] = function(data,alternative,style)
+--~ local family = data.metadata.family
+--~ local style = m_alternative[style] or style
+--~ if trace_alternatives then
+--~ report_selectfont("Alternative '%s': Using method 'style' with argument '%s'",alternative,style)
+--~ end
+--~ local fontweight = m_name[style] and m_name[style]["weight"] or "regular"
+--~ local fontstyle = m_name[style] and m_name[style]["style"] or "normal"
+--~ local fontwidth = m_name[style] and m_name[style]["width"] or "normal"
+--~ local pattern = getlookups{
+--~ familyname = cleanname(family),
+--~ pfmweight = m_weight[fontweight],
+--~ style = fontstyle
+--~ }
+--~ if #pattern == 1 then
+--~ selectfont_savefile(data,alternative,0,"default",pattern[1])
+--~ elseif #pattern > 1 then
+--~ local bodyfontsize, minsize, maxsize, width = nil, nil, nil, nil
+--~ for patternindex, patternentry in next, pattern do
+--~ minsize = patternentry["minsize"]
+--~ maxsize = patternentry["maxsize"]
+--~ width = patternentry["pfmwidth"]
+--~ if minsize and maxsize then
+--~ for fontsize, fontstate in next, bodyfontsizes do
+--~ bodyfontsize, _ = number.splitdimen(fontsize)
+--~ bodyfontsize = bodyfontsize * 10
+--~ if minsize < bodyfontsize and bodyfontsize < maxsize then
+--~ if bodyfontsize == 100 then
+--~ selectfont_savefile(data,alternative,0,"default",patternentry)
+--~ end
+--~ selectfont_savefile(data,alternative,bodyfontsize,fontsize,patternentry)
+--~ end
+--~ end
+--~ else
+--~ if width == m_width[fontwidth] then
+--~ selectfont_savefile(data,alternative,0,"default",patternentry)
+--~ end
+--~ end
+--~ end
+--~ else
+--~ if trace_alternatives then
+--~ report_selectfont("Alternative '%s': No font was found for the requested style '%s' from '%s'",alternative,style,family)
+--~ end
+--~ end
+--~ end
+
+local function m_style_family(family)
+ local askedname = cleanname(family)
+ local familyname = getlookups{ familyname = askedname }
+ local family = getlookups{ family = askedname }
+ local fontname = getlookups{ fontname = askedname }
+ if #familyname > 0 then
+ return familyname
+ elseif #family > 0 then
+ return family
+ elseif #fontname > 0 then
+ local fontfamily = fontname[1]["familyname"]
+ report_selectfont("The name '%s' is not a proper family name, use '%s' instead.",askedname,fontfamily)
+ return nil
+ else
+ return nil
+ end
end
-function selectfont.searchfiles(index)
- local data = data[index]
- for alternative, _ in next, alternatives do
- local filename = data.files[alternative]
- local method = data.options.alternative
- local family = data.metadata.family
- local style = alternatives[alternative]
- if filename == "" then
- local pattern = getlookups{ familyname = cleanname(family) }
- if #pattern == 1 and alternative == "tf" then -- needs to be improved
- savefont(data,alternative,pattern)
- else
- (methods[method] or methods[v_default])(data,alternative,style)
+local function m_style_weight(entries,style)
+ local t = { }
+ local weight = m_name[style] and m_name[style]["weight"] or "regular"
+ if type(weight) == "table" then
+ for _, w in next, weight do
+ local found = false
+ local pfmweight = m_weight[w]
+ for index, entry in next, entries do
+ if entry["pfmweight"] == pfmweight then
+ found = true
+ t[#t+1] = entry
+ elseif entry["weight"] == w then
+ found = true
+ t[#t+1] = entry
+ end
end
- else
- method, filename = splitup(filename,":")
- if not filename then
- filename = method
- method = "name"
+ if found then break end
+ end
+ else
+ local pfmweight = m_weight[weight]
+ for index, entry in next, entries do
+ if entry["pfmweight"] == pfmweight then
+ t[#t+1] = entry
+ elseif entry["weight"] == weight then
+ t[#t+1] = entry
end
- (methods[method] or methods["name"])(data,alternative,filename)
end
end
+ return #t ~= 0 and t or nil
end
-function selectfont.filterinput(index)
- local data = data[index]
- local p = splitat(":",true)
- for alternative, _ in next, alternatives do
- local list = settings_to_array(data.alternatives[alternative])
- for _, entry in next, list do
- method, entries = lpegmatch(p,entry)
- if not entries then
- entries = method
- method = "name"
- end
- (methods[method] or methods["name"])(data,alternative,entries)
+local function m_style_style(entries,style)
+ local t = { }
+ local style = m_name[style] and m_name[style]["style"] or "normal"
+ for index, entry in next, entries do
+ if style == "italic" and entry["angle"] and entry["angle"] ~= 0 then
+ t[#t+1] = entry
+ elseif style == "normal" and entry["angle"] and entry["angle"] ~= 0 then
+ --~ Fix needed for fonts with wrong value for the style field
+ elseif entry["style"] == style then
+ t[#t+1] = entry
end
end
+ return #t ~= 0 and t or nil
end
-local ctx_definefontsynonym = context.definefontsynonym
-local ctx_resetfontfallback = context.resetfontfallback
-local ctx_startfontclass = context.startfontclass
-local ctx_stopfontclass = context.stopfontclass
-local ctx_loadfontgoodies = context.loadfontgoodies
-local ctx_definefontfallback = context.definefontfallback
-local ctx_definetypeface = context.definetypeface
-
-local function definefontsynonym(data,alternative,index,fallback)
- local fontdata = data.fonts and data.fonts[alternative]
- local style = data.metadata.style
- local typeface = data.metadata.typeface
- local mathsettings = mathsettings[cleanname(data.metadata.family)]
- local features = mathsettings and mathsettings["features"] and (mathsettings["features"][alternative] or mathsettings["features"]["tf"]) or data.features and data.features[alternative] or ""
- local goodies = mathsettings and mathsettings["goodies"] and (mathsettings["goodies"] [alternative] or mathsettings["goodies"] ["tf"]) or data.goodies and data.goodies [alternative] or ""
- local parent = replacement["style"][alternative] or ""
- local fontname, fontfile, fontparent
- if fallback then
- fontname = formatters["%s-%s-%s-fallback-%s"](typeface, style, alternative, index)
- fontfile = formatters["%s-%s-%s-%s"] (typeface, style, alternative, index)
- fontparent = formatters["%s-%s-%s-fallback-%s"](typeface, style, parent, index)
+local function m_style_variant(entries,style)
+ local t = { }
+ local variant = m_name[style] and m_name[style]["variant"] or "normal"
+ for index, entry in next, entries do
+ if entry["variant"] == variant then
+ t[#t+1] = entry
+ end
+ end
+ return #t ~= 0 and t or nil
+end
+
+local function m_style_width(entries,style)
+ local t = { }
+ local width = m_name[style] and m_name[style]["width"] or "normal"
+ local pfmwidth = m_width[width]
+ for index, entry in next, entries do
+ if entry["pfmwidth"] == pfmwidth then
+ t[#t+1] = entry
+ end
+ end
+ return #t ~= 0 and t or nil
+end
+
+local function m_style_size(data,alternative,entries)
+ if #entries == 1 then
+ selectfont_savefile(data,alternative,0,"default",entries[1])
else
- fontname = synonyms[style][alternative]
- fontfile = formatters["%s-%s-%s"](typeface, style, alternative)
- fontparent = formatters["%s-%s-%s"](typeface, style, parent)
- end
- if fontdata and #fontdata > 0 then
- for _, size in next, sizes["default"] do
- for _, entry in next, fontdata do
- if entry["minsize"] and entry["maxsize"] then
- if size[1] > entry["minsize"] and size[1] <= entry["maxsize"] then
- local filepath, filename = splitbase(entry["filename"])
- registerdesignsizes( fontfile, size[2], filename )
+ for index, entry in next, entries do
+ local minsize = entry["minsize"]
+ local maxsize = entry["maxsize"]
+ if minsize and maxsize then
+ for size, state in next, bodyfontsizes do
+ local bodyfontsize, _ = number.splitdimen(size)
+ bodyfontsize = bodyfontsize * 10
+ if minsize < bodyfontsize and bodyfontsize < maxsize then
+ if bodyfontsize == 100 then
+ selectfont_savefile(data,alternative,0,"default",entry)
+ end
+ selectfont_savefile(data,alternative,bodyfontsize,size,entry)
end
end
+ else
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': Multiple files are available for the requested style '%s' from '%s'",alternative,style,family)
+ end
end
end
- for _, entry in next, fontdata do
- local designsize = entry["designsize"] or 100
- if designsize == 100 or designsize == 110 or designsize == 120 or designsize == 0 or #fontdata == 1 then
- local filepath, filename = splitbase(entry["filename"])
- if entry["format"] == "ttc" or entry["format"] == "dfont" then
- filename = formatters["%s(%s)"](filename, entry["rawname"])
+ end
+end
+
+methods["style"] = function(data,alternative,style)
+ local fontfamily = data.metadata.family
+ local designsize = data.options.designsize
+ local fontstyle = m_alternative[style] or style
+ local entries = m_style_family(fontfamily)
+ if entries then
+ entries = m_style_weight(entries,fontstyle)
+ if entries then
+ entries = m_style_style(entries,fontstyle)
+ if entries then
+ entries = m_style_variant(entries,fontstyle)
+ if entries and #entries > 1 and designsize == "default" then
+ entries = m_style_width(entries,fontstyle)
end
- registerdesignsizes( fontfile, "default", filename )
- break
end
end
- if fallback then
- -- can we use
- ctx_definefontsynonym( { fontname }, { fontfile }, { features = features } )
- else
- ctx_definefontsynonym( { fontname }, { fontfile }, { features = features, fallbacks = fontfile, goodies = goodies } )
+ end
+ if entries then
+ m_style_size(data,alternative,entries)
+ else
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': No font was found for the requested style '%s' from '%s'",alternative,style,family)
+ end
+ end
+end
+
+methods[v_default] = function(data,alternative)
+ local family = data.metadata.family
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': Using method 'default'",alternative)
+ end
+ local result = getlookups{ familyname = cleanname(family) }
+ if #result == 1 and alternative == "tf" then
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': The family '%s' contains only one font",alternative,family)
end
+ selectfont_savefile(data,alternative,0,"default",result[1])
+ --~ if trace_alternatives then
+ --~ report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
+ --~ end
+ --~ methods["file"](data,alternative,result[1]["filename"])
else
- if fallback then
- ctx_definefontsynonym( { fontname }, { fontparent }, { features = features } )
- else
- ctx_definefontsynonym( { fontname }, { fontparent }, { features = features, fallbacks = fontfile, goodies = goodies } )
+ if trace_alternatives then
+ report_selectfont("Alternative '%s': Changing method 'default' to method 'style'",alternative)
end
+ methods["style"](data,alternative,alternative)
+ end
+end
+
+local function selectfont_savealternative(data,alternative,userdata)
+ local a = data.alternatives
+ local e = userdata[alternative]
+ if not a then
+ a = { }
+ data.alternatives = a
end
+ a[alternative] = e
end
-local function definetypescript(index)
- local data = data[index]
- local entry = data.fonts
- local mathsettings = mathsettings[cleanname(data.metadata.family)]
- local goodies = mathsettings and mathsettings.extras or data.options.goodies
- local typeface = data.metadata.typeface
- local style = data.metadata.style
- if entry and entry["tf"] then
- ctx_startfontclass( { typeface } )
- if goodies ~= "" then
- goodies = utilities.parsers.settings_to_array(goodies)
- for _, goodie in next, goodies do
- ctx_loadfontgoodies( { goodie } )
+function selectfont.fontdata(index)
+ local data = data[index]
+ local style = data.metadata.style
+ local defaults = defaults[style]
+ if defaults then
+ for category, argument in next, defaults do
+ local extra = extras[category]
+ if extra then
+ for alternative, entry in next, argument do
+ extra(data,alternative,entry)
+ end
end
end
- for alternative, _ in next, alternatives do
- if synonyms[style][alternative] then -- prevent unnecessary synonyms for handwriting, calligraphy and math
- definefontsynonym(data,alternative)
+ end
+end
+
+function selectfont.userdata(index)
+ local data = data[index]
+ local preset = data.options.preset
+ local presets = presets[preset]
+ local userdata = settings_to_hash(data.userdata)
+ if presets then
+ merge(userdata,presets)
+ end
+ for alternative, _ in next, alternatives do
+ selectfont_savealternative(data,alternative,userdata)
+ end
+end
+
+--~ function selectfont.registerfiles(index)
+--~ local data = data[index]
+--~ local colon = splitat(":",true)
+--~ for alternative, _ in next, alternatives do
+--~ local arguments = data.alternatives[alternative]
+--~ if arguments ~= "" then
+--~ local entries = settings_to_array(arguments)
+--~ local setmethod = false
+--~ for index, entry in next, entries do
+--~ method, argument = lpegmatch(colon,entry)
+--~ if not argument then
+--~ argument = method
+--~ method = "name"
+--~ end
+--~ if extras[method] then
+--~ extras[method](data,alternative,argument)
+--~ elseif methods[method] then
+--~ if not setmethod then
+--~ setmethod = true
+--~ methods[method](data,alternative,argument)
+--~ end
+--~ end
+--~ end
+--~ if not setmethod then
+--~ methods[v_default](data,alternative)
+--~ end
+--~ else
+--~ methods[v_default](data,alternative)
+--~ end
+--~ end
+--~ end
+
+function selectfont.registerfiles(index)
+ local data = data[index]
+ local colon = splitat(":",true)
+ for alternative, _ in next, alternatives do
+ local arguments = data.alternatives[alternative]
+ if arguments and arguments ~= "" then
+ local entries = settings_to_array(arguments)
+ for index, entry in next, entries do
+ method, argument = lpegmatch(colon,entry)
+ if not argument then
+ argument = method
+ method = "name"
+ end
+ (extras[method] or methods[method] or methods[v_default])(data,alternative,argument)
end
+ else
+ methods[v_default](data,alternative)
end
- ctx_stopfontclass()
+ end
+end
+
+function selectfont.registerfontalternative(alternative)
+ local a = alternatives[alternative]
+ if not a then
+ if trace_register then
+ report_selectfont("Register alternative '%s'",alternative)
+ end
+ a = true
+ alternatives[alternative] = a
+ end
+end
+
+function selectfont.registerfallback(index)
+ local data = data[index]
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local fallback = fallbacks[fontclass]
+ if not fallback then
+ fallback = { }
+ fallbacks[fontclass] = fallback
+ end
+ local entries = fallback[fontstyle]
+ if not entries then
+ entries = { }
+ fallback[fontstyle] = entries
+ end
+ entries[#entries+1] = index
+end
+
+function selectfont.registerfontfamily(settings)
+ local index = #data + 1
+ data[index] = settings
+ selectfont.fontdata (index)
+ selectfont.userdata (index)
+ selectfont.registerfiles(index)
+ return index
+end
+
+local m_synonym = {
+ ["rm"] = {
+ ["tf"] = "Serif",
+ ["bf"] = "SerifBold",
+ ["it"] = "SerifItalic",
+ ["sl"] = "SerifSlanted",
+ ["bi"] = "SerifBoldItalic",
+ ["bs"] = "SerifBoldSlanted",
+ ["sc"] = "SerifCaps",
+ },
+ ["ss"] = {
+ ["tf"] = "Sans",
+ ["bf"] = "SansBold",
+ ["it"] = "SansItalic",
+ ["sl"] = "SansSlanted",
+ ["bi"] = "SansBoldItalic",
+ ["bs"] = "SansBoldSlanted",
+ ["sc"] = "SansCaps",
+ },
+ ["tt"] = {
+ ["tf"] = "Mono",
+ ["bf"] = "MonoBold",
+ ["it"] = "MonoItalic",
+ ["sl"] = "MonoSlanted",
+ ["bi"] = "MonoBoldItalic",
+ ["bs"] = "MonoBoldSlanted",
+ ["sc"] = "MonoCaps",
+ },
+ ["mm"] = {
+ ["tf"] = "MathRoman",
+ ["bf"] = "MathBold",
+ },
+ ["hw"] = {
+ ["tf"] = "Handwriting",
+ },
+ ["cg"] = {
+ ["tf"] = "Calligraphy",
+ },
+}
+
+function selectfont.features(data,style,alternative)
+ local family = data.metadata.family
+ local features = data.features
+ local options = data.options
+ local defaults = defaults[cleanname(family)]
+ if features and features[alternative] then
+ return features[alternative]
+ elseif defaults and defaults.options and defaults.options.features then
+ return defaults.options.features
else
- -- regular style not available, loading aborted
+ return options.features
end
end
-function selectfont.registerfallback(typeface,style,index)
- local t = fallbacks[typeface]
- if not t then
- fallbacks[typeface] = { [style] = { index } }
+function selectfont.goodies(data,style,alternative)
+ local family = data.metadata.family
+ local goodies = data.goodies
+ local options = data.options
+ local defaults = defaults[cleanname(family)]
+ if goodies and goodies[alternative] then
+ return goodies[alternative]
+ elseif defaults and defaults.options and defaults.options.goodies then
+ return defaults.options.goodies
else
- local s = t[style]
- if not s then
- fallbacks[typeface][style] = { index }
- else
- fallbacks[typeface][style][#s+1] = index
+ return options.goodies
+ end
+end
+
+function selectfont.fontsynonym(data,class,style,alternative,index)
+ local fontfiles = data.files[alternative] or data.files["tf"]
+ local fontsizes = sortedkeys(fontfiles)
+ local fallback = index ~= 0
+ --~ local fontfeature = data.features and data.features[alternative] or data.options.features
+ --~ local fontgoodie = data.goodies and data.goodies [alternative] or data.options.goodies
+ local fontfeature = selectfont.features(data,style,alternative)
+ local fontgoodie = selectfont.goodies (data,style,alternative)
+ local synonym = m_synonym[style] and m_synonym[style][alternative]
+ local fontfile = formatters ["file-%s-%s-%s"](class,style,alternative)
+ local fontsynonym = formatters ["synonym-%s-%s-%s"](class,style,alternative)
+ if fallback then
+ fontfile = formatters ["file-%s-%s-%s-%s"](class,style,alternative,index)
+ fontsynonym = formatters ["synonym-%s-%s-%s-%s"](class,style,alternative,index)
+ end
+ local fontfallback = formatters["fallback-%s-%s-%s"](class,style,alternative)
+ for _, fontsize in next, fontsizes do
+ --~ if trace_typescript then
+ --~ report_typescript("Synonym: '%s', Size: '%s', File: '%s'",fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
+ --~ end
+ registerdesignsizes(fontfile,fontfiles[fontsize][1],fontfiles[fontsize][2])
+ end
+ if fallback then
+ --~ if trace_typescript then
+ --~ report_typescript("Synonym: '%s', File: '%s', Features: '%s'",fontsynonym,fontfile,fontfeature)
+ --~ end
+ ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature } )
+ else
+ --~ if trace_typescript then
+ --~ report_typescript("Synonym: '%s', File: '%s', Features: '%s', Goodies: '%s', Fallbacks: '%s'",fontsynonym,fontfile,fontfeature,fontgoodie,fontfallback)
+ --~ end
+ ctx_definefontsynonym( { fontsynonym }, { fontfile }, { features = fontfeature, goodies = fontgoodie, fallbacks = fontfallback } )
+ if synonym then
+ --~ if trace_typescript then
+ --~ report_typescript("Synonym: '%s', File: '%s'",synonym,fontsynonym)
+ --~ end
+ ctx_definefontsynonym( { synonym }, { fontsynonym } )
end
end
end
-local function definetextfontfallback(data,alternative,index)
- local typeface = data.metadata.typeface
- local style = data.metadata.style
- local features = data.features[alternative]
- local range = data.options.range
- local rscale = data.options.scale ~= "" and data.options.scale or 1
- local check = data.options.check ~= "" and data.options.check or "yes"
- local force = data.options.force ~= "" and data.options.force or "yes"
- local synonym = formatters["%s-%s-%s-fallback-%s"](typeface, style, alternative, index)
- local fallback = formatters["%s-%s-%s"] (typeface, style, alternative)
+function selectfont.fontfallback(data,class,style,alternative,index)
+ local range = data.options.range
+ local scale = data.options.rscale ~= "" and data.options.rscale or 1
+ local check = data.options.check ~= "" and data.options.check or "yes"
+ local force = data.options.force ~= "" and data.options.force or "no"
+ local fontfeature = data.features and data.features[alternative] or data.options.features
+ local fontsynonym = formatters["synonym-%s-%s-%s-%s"](class,style,alternative,index)
+ local fontfallback = formatters["fallback-%s-%s-%s"] (class,style,alternative)
if index == 1 then
- ctx_resetfontfallback( { fallback } )
+ ctx_resetfontfallback( { fontfallback } )
end
- ctx_definefontfallback( { fallback }, { synonym }, { range }, { rscale = rscale, check = check, force = force } )
+ --~ if trace_typescript then
+ --~ report_typescript("Fallback: '%s', Synonym: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s'",fontfallback,fontsynonym,range,scale,check,force)
+ --~ end
+ ctx_definefontfallback( { fontfallback }, { fontsynonym }, { range }, { rscale = scale, check = check, force = force } )
end
-local function definetextfallback(entry,index)
- local data = data[index]
- local typeface = data.metadata.typeface
- ctx_startfontclass( { typeface } )
- for alternative, _ in next, alternatives do
- definefontsynonym (data,alternative,entry,true)
- definetextfontfallback(data,alternative,entry)
+function selectfont.filefallback(data,class,style,alternative,index)
+ local range = data.options.range
+ local offset = data.options.offset
+ local scale = data.options.rscale ~= "" and data.options.rscale or 1
+ local check = data.options.check ~= "" and data.options.check or "yes"
+ local force = data.options.force ~= "" and data.options.force or "yes"
+ local fontfile = data.files[alternative] and data.files[alternative][0] or data.files["tf"][0]
+ local fontfeature = data.features and data.features[alternative] or data.options.features
+ local fontfallback = formatters["fallback-%s-%s-%s"](class,style,alternative)
+ if index == 1 then
+ ctx_resetfontfallback( { fontfallback } )
end
+ --~ if trace_typescript then
+ --~ report_typescript("Fallback: '%s', File: '%s', Features: '%s', Range: '%s', Scale: '%s', Check: '%s', Force: '%s', Offset: '%s'",fontfallback,fontfile[2],fontfeature,range,scale,check,force,offset)
+ --~ end
+ ctx_definefontfallback( { fontfallback }, { formatters["file:%s*%s"](fontfile[2],fontfeature) }, { range }, { rscale = scale, check = check, force = force, offset = offset } )
+end
+
+function selectfont.mathfallback(index,entry,class,style)
+ local data = data[entry]
+ ctx_startfontclass( { class } )
+ for alternative, _ in next, alternatives do
+ if alternative == "tf" or alternative == "bf" then
+ selectfont.filefallback(data,class,style,alternative,index)
+ end
+ end
ctx_stopfontclass()
- -- inspect(data)
end
-local function definemathfontfallback(data,alternative,index)
- local typeface = data.metadata.typeface
- local style = data.metadata.style
- local range = data.options.range
- local rscale = data.options.scale ~= "" and data.options.scale or 1
- local check = data.options.check ~= "" and data.options.check or "yes"
- local force = data.options.force ~= "" and data.options.force or "yes"
- local offset = data.options.offset
- local features = data.features[alternative]
- local fontdata = data.fonts and data.fonts[alternative]
- local fallback = formatters["%s-%s-%s"](typeface, style, alternative)
- if index == 1 then
- ctx_resetfontfallback( { fallback } )
- end
- if fontdata and #fontdata > 0 then
- for _, entry in next, fontdata do
- local filename = entry["filename"]
- local designsize = entry["designsize"] or 100
- if designsize == 100 or designsize == 110 or designsize == 120 or designsize == 0 or #fontdata == 1 then
- ctx_definefontfallback( { fallback }, { formatters["file:%s*%s"](filename,features) }, { range }, { rscale = rscale, check = check, force = force, offset = offset } )
- break
+function selectfont.textfallback(index,entry,class,style)
+ local data = data[entry]
+ ctx_startfontclass( { class } )
+ for alternative, _ in next, alternatives do
+ selectfont.fontsynonym (data,class,style,alternative,index)
+ selectfont.fontfallback(data,class,style,alternative,index)
+ end
+ ctx_stopfontclass()
+end
+
+function selectfont.fallback(data)
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local fallbacks = fallbacks[fontclass] and fallbacks[fontclass][fontstyle]
+ if fallbacks then
+ for index, entry in next, fallbacks do
+ --~ I need different fallback routines for math and text because
+ --~ font synonyms can’t be used with math fonts and I have to apply
+ --~ feature settings with the \definefontfallback command.
+ if fontstyle == "mm" then
+ selectfont.mathfallback(index,entry,fontclass,fontstyle)
+ else
+ selectfont.textfallback(index,entry,fontclass,fontstyle)
end
end
end
end
-local function definemathfallback(entry,index)
- local data = data[index]
- local typeface = data.metadata.typeface
+function selectfont.typescript(data)
+ local class = data.metadata.typeface
+ local family = data.metadata.family
local style = data.metadata.style
- ctx_startfontclass( { typeface } )
- for alternative, _ in next, alternatives do
- if synonyms[style][alternative] then
- definemathfontfallback(data,alternative,entry)
- end
+ local extras = data.options.extras
+ local defaults = defaults[cleanname(family)]
+ if extras == "" then
+ extras = defaults and defaults.options and defaults.options.extras or ""
end
- ctx_stopfontclass()
- -- inspect(data)
-end
-
-local function definefallbackfont(index)
- local data = data[index]
- local f = fallbacks[data.metadata.typeface]
- if f then
- local s = f[data.metadata.style]
- if s then
- for entry, fallback in next, s do
- if data.metadata.style == "mm" then
- definemathfallback(entry,fallback)
- else
- definetextfallback(entry,fallback)
+ ctx_startfontclass( { class } )
+ if extras ~= "" then
+ extras = settings_to_array(extras)
+ for _, extra in next, extras do
+ ctx_loadfontgoodies( { extra } )
+ end
+ end
+ for alternative, _ in next, alternatives do
+ if style == "mm" then -- Set math fonts only for upright and bold alternatives
+ if alternative == "tf" or alternative == "bf" then
+ selectfont.fontsynonym (data,class,style,alternative,0)
end
+ else
+ selectfont.fontsynonym (data,class,style,alternative,0)
end
end
+ ctx_stopfontclass()
+end
+
+function selectfont.bodyfont(data)
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local fontsizes = concat(sortedkeys(bodyfontsizes),",")
+ local fontsynonym = nil
+ local fontlist = { }
+ for alternative, _ in next, alternatives do
+ fontsynonym = formatters["synonym-%s-%s-%s"](fontclass,fontstyle,alternative)
+ fontlist[#fontlist+1] = formatters["%s=%s sa 1"] (alternative,fontsynonym)
+ --~ if trace_typescript then
+ --~ report_typescript("Alternative '%s': Synonym '%s'",alternative,fontsynonym)
+ --~ end
+ end
+ fontlist = concat(fontlist,",")
+ ctx_definebodyfont( { fontclass }, { fontsizes }, { fontstyle }, { fontlist } )
+end
+
+local m_style = {
+ ["rm"] = "serif",
+ ["ss"] = "sans",
+ ["tt"] = "mono",
+ ["mm"] = "math",
+ ["hw"] = "handwriting",
+ ["cg"] = "calligraphy",
+}
+
+function selectfont.typeface(data)
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local style = m_style[fontstyle]
+ local size = data.options.designsize ~= "" and data.options.designsize or "default"
+ local scale = data.options.rscale ~= "" and data.options.rscale or 1
+ --~ if trace_typescript then
+ --~ report_typescript("Class: '%s', Style: '%s', Size: '%s', Scale: '%s'",fontclass,fontstyle,size,scale)
+ --~ end
+ if fontstyle == "mm" then -- math uses the default bodyfont settings because it uses 'ma' and 'mb' as alternative names
+ ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "" }, { "default" }, { designsize = size, rscale = scale } )
+ else
+ ctx_definetypeface( { fontclass }, { fontstyle }, { "" }, { "" }, { "" }, { designsize = size, rscale = scale } )
end
end
-local function definetextfont(index)
- local data = data[index]
- local fontclass = data.metadata.typeface
- local shortstyle = data.metadata.style
- local style = styles[data.metadata.style]
- local designsize = data.options.opticals == v_yes and "auto" or "default"
- local scale = data.options.scale ~= "" and data.options.scale or 1
- ctx_definetypeface( { fontclass }, { shortstyle }, { style }, { "" }, { "default" }, { designsize = designsize, rscale = scale } )
+function selectfont.default(data)
+ local family = data.metadata.family
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local style = m_style[fontstyle]
+ report_selectfont("The requested font '%s' has no files for the 'tf' alternative, Latin Modern is used instead.",family)
+ ctx_definetypeface( { fontclass }, { fontstyle }, { style }, { "modern" }, { "default" } )
end
-local function definemathfont(index)
- local data = data[index]
- local fontclass = data.metadata.typeface
- local shortstyle = data.metadata.style
- local style = styles[data.metadata.style]
- local scale = data.options.scale ~= "" and data.options.scale or 1
- local typescript = cleanname(data.metadata.family)
- local entries = data.fonts
- if entries then
- ctx_definetypeface( { fontclass }, { shortstyle }, { style }, { "" }, { "default" }, { rscale = scale } )
+function selectfont.definefontfamily(index)
+ local data = data[index]
+ local fontstyle = data.metadata.style
+ local fontfiles = data.files and data.files["tf"]
+ if fontfiles then
+ selectfont.fallback (data)
+ selectfont.typescript(data)
+ if fontstyle ~= "mm" then
+ selectfont.bodyfont(data)
+ end
+ selectfont.typeface(data)
else
- ctx_definetypeface( { fontclass }, { shortstyle }, { style }, { typescript }, { "default" }, { rscale = scale } )
+ selectfont.default(data)
end
end
-function selectfont.definetypeface(index)
- local data = data[index]
- if data.metadata.style == "mm" then
- definefallbackfont(index)
- definetypescript (index)
- definemathfont (index)
+function selectfont.definefallbackfamily(index)
+ local data = data[index]
+ local family = data.metadata.family
+ local fontclass = data.metadata.typeface
+ local fontstyle = data.metadata.style
+ local fontfiles = data.files
+ if fontfiles then
+ selectfont.registerfallback(index)
else
- definefallbackfont(index)
- definetypescript (index)
- definetextfont (index)
+ report_selectfont("The requested fallback font '%s' for typeface '%s' style '%s' was ignored because no files where found.",family,fontclass,fontstyle)
end
- -- inspect(data)
end
-local styles = {
- { "tf" }, { "bf" }, { "it" }, { "sl" }, { "bi" }, { "bs" }, { "sc" },
-}
+function selectfont.definefontfamilypreset(name,data)
+ local p = presets[name]
+ local d = settings_to_hash(data)
+ if not p then
+ p = d
+ presets[name] = p
+ end
+end
implement {
- name = "defineselectfont",
- actions = { selectfont.define, context },
+ name = "registerfontfamily",
+ actions = { selectfont.registerfontfamily, context },
arguments = {
{
{
"metadata", {
{ "typeface" },
{ "style" },
- { "family" },
+ { "family" }
}
},
{
"options", {
- { "opticals" },
- { "scale" },
+ { "designsize" },
+ { "rscale" },
{ "goodies" },
- { "alternative" },
+ { "preset" },
+ { "extras" },
+ { "features" },
{ "range" },
{ "offset" },
{ "check" },
- { "force" },
+ { "force" }
}
},
- { "alternatives", styles },
- { "files", styles },
- { "features", styles },
+ {
+ "userdata"
+ }
}
- }
+ }
+}
+
+implement {
+ name = "registerfontalternative",
+ actions = selectfont.registerfontalternative,
+ arguments = "string"
}
implement {
name = "definefontfamily",
- actions = selectfont.definetypeface,
+ actions = selectfont.definefontfamily,
arguments = "integer"
}
implement {
name = "definefallbackfamily",
- actions = selectfont.registerfallback,
- arguments = { "string", "string", "integer"}
+ actions = selectfont.definefallbackfamily,
+ arguments = "integer"
+}
+
+implement {
+ name = "definefontfamilypreset",
+ actions = selectfont.definefontfamilypreset,
+ arguments = { "string", "string" }
}
diff --git a/tex/context/base/mkiv/font-sel.mkvi b/tex/context/base/mkiv/font-sel.mkvi
index eb45ea033..4e74f6864 100644
--- a/tex/context/base/mkiv/font-sel.mkvi
+++ b/tex/context/base/mkiv/font-sel.mkvi
@@ -1,6 +1,6 @@
%D \module
%D [ file=font-sel,
-%D version=2014.07.27,
+%D version=2016.05.16,
%D title=\CONTEXT\ User Module,
%D subtitle=Selectfont,
%D author=Wolfgang Schuster,
@@ -17,7 +17,7 @@
\installcorenamespace {selectfont}
\installsimplecommandhandler \??selectfont {selectfont}
-\unexpanded\def\selectfont_setparameters[#settings]%
+\unexpanded\def\selectfont_register[#settings]%
{\begingroup
\setupcurrentselectfont[#settings]%
\edef\p_selectfont_preset{\selectfontparameter\c!preset}%
@@ -25,75 +25,32 @@
\processcommacommand[\p_selectfont_preset]\selectfont_preset_process
\setupcurrentselectfont[#settings]%
\fi
- \setexpandedselectfontparameter\c!style {\expandnamespaceparameter\??selectfontstyle \selectfontparameter\c!style \s!rm }%
- \setexpandedselectfontparameter\c!alternative{\expandnamespaceparameter\??selectfontalternative\selectfontparameter\c!alternative\v!default}%
- \xdef\selectfont_index{\clf_defineselectfont
+ \font_helpers_process_alternative_list\clf_registerfontalternative
+ \setexpandedselectfontparameter\c!style{\expandnamespaceparameter\??fontshortstyle\selectfontparameter\c!style\s!rm}%
+ \xdef\selectfont_index{\clf_registerfontfamily
metadata {%
- typeface {\selectfontparameter\c!name}%
+ typeface {\selectfontparameter\c!label}%
style {\selectfontparameter\c!style}%
- family {\selectfontparameter\c!family}%
+ family {\selectfontparameter\c!name}%
}
options {%
- opticals {\selectfontparameter\c!opticalsize}%
- scale {\selectfontparameter\c!scale}%
+ designsize {\selectfontparameter\s!designsize}%
+ rscale {\selectfontparameter\s!rscale}%
goodies {\selectfontparameter\c!goodies}%
- alternative {\selectfontparameter\c!alternative}%
+ extras {\selectfontparameter\c!extras}%
+ features {\selectfontparameter\c!features}%
+ preset {\selectfontparameter\c!preset}%
range {\selectfontparameter\c!range}% fallback only
offset {\selectfontparameter\c!offset}% fallback only
check {\selectfontparameter\c!check}% fallback only
force {\selectfontparameter\c!force}% fallback only
}
- alternatives {%
- tf {\selectfontparameter\s!tf}%
- bf {\selectfontparameter\s!bf}%
- it {\selectfontparameter\s!it}%
- sl {\selectfontparameter\s!sl}%
- bi {\selectfontparameter\s!bi}%
- bs {\selectfontparameter\s!bs}%
- sc {\selectfontparameter\s!sc}%
- }
- files {%
- tf {\selectfontparameter\c!regularfont}%
- bf {\selectfontparameter\c!boldfont}%
- it {\selectfontparameter\c!italicfont}%
- sl {\selectfontparameter\c!slantedfont}%
- bi {\selectfontparameter\c!bolditalicfont}%
- bs {\selectfontparameter\c!boldslantedfont}%
- sc {\selectfontparameter\c!smallcapsfont}%
- }
- features {%
- tf {\selectfontparameter\c!regularfeatures}%
- bf {\selectfontparameter\c!boldfeatures}%
- it {\selectfontparameter\c!italicfeatures}%
- sl {\selectfontparameter\c!slantedfeatures}%
- bi {\selectfontparameter\c!bolditalicfeatures}%
- bs {\selectfontparameter\c!boldslantedfeatures}%
- sc {\selectfontparameter\c!smallcapsfeatures}%
- }}%
+ userdata {%
+ \luaexpanded{#settings}%
+ }}%
\endgroup}
%D \macros
-%D {defineselectfontstyle}
-
-\installcorenamespace {selectfontstyle}
-
-\unexpanded\def\defineselectfontstyle
- {\dodoubleargument\selectfont_style_define}
-
-\def\selectfont_style_define[#styles][#shortstyle]%
- {\processcommalist[#styles]{\selectfont_style_define_indeed{#shortstyle}}}
-
-\def\selectfont_style_define_indeed#shortstyle#style%
- {\setvalue{\??selectfontstyle#style}{#shortstyle}}
-
-\defineselectfontstyle [\s!rm,\s!serif] [\s!rm]
-\defineselectfontstyle [\s!ss,\s!sans] [\s!ss]
-\defineselectfontstyle [\s!tt,\s!mono] [\s!tt]
-\defineselectfontstyle [\s!hw,\s!handwriting] [\s!hw]
-\defineselectfontstyle [\s!cg,\s!calligraphy] [\s!cg]
-\defineselectfontstyle [\s!mm,\s!math] [\s!mm]
-
-%D \macros
%D {definefontfamilypreset}
\installcorenamespace {selectfontpreset}
@@ -113,6 +70,10 @@
% unknown preset
\fi}
+\def\selectfont_preset_define[#name][#settings]%
+ {\setvalue{\??selectfontpreset#name}{\setupcurrentselectfont[#settings]}%
+ \clf_definefontfamilypreset{#name}{\luaexpanded{#settings}}}
+
\definefontfamilypreset
[range:chinese]
[\c!range={cjkcompatibilityforms,
@@ -131,19 +92,19 @@
\definefontfamilypreset
[range:japanese]
- [\crange={cjkcompatibilityforms,
- cjkcompatibilityideographs,
- cjkcompatibilityideographssupplement,
- cjkradicalssupplement,
- cjkstrokes,
- cjksymbolsandpunctuation,
- cjkunifiedideographs,
- cjkunifiedideographsextensiona,
- cjkunifiedideographsextensionb,
- halfwidthandfullwidthforms,
- verticalforms,
- hiragana,
- katakana}]
+ [\c!range={cjkcompatibilityforms,
+ cjkcompatibilityideographs,
+ cjkcompatibilityideographssupplement,
+ cjkradicalssupplement,
+ cjkstrokes,
+ cjksymbolsandpunctuation,
+ cjkunifiedideographs,
+ cjkunifiedideographsextensiona,
+ cjkunifiedideographsextensionb,
+ halfwidthandfullwidthforms,
+ verticalforms,
+ hiragana,
+ katakana}]
\definefontfamilypreset
[range:korean]
@@ -207,36 +168,6 @@
\definefontfamilypreset [math:uppercasegreekbold] [\c!range=uppercasegreeknormal,\c!offset=uppercasegreekbold, \s!tf=style:bold]
\definefontfamilypreset [math:uppercasegreekbolditalic] [\c!range=uppercasegreeknormal,\c!offset=uppercasegreekbolditalic,\s!tf=style:bolditalic]
-
-%D \macros
-%D {defineselectfontalternative}
-%D
-%D The results between the old {\em simplefonts} and the new {\em selectfont}
-%D can be different because simplefonts the name entries in the database to find
-%D the styles for a font while selectfont the newer spec-method to the find the
-%D files for each style.
-%D
-%D The used method depends on the command one uses to load a font but it is
-%D also possible to switch between them with the {\em alternative} key, possible
-%D values are:
-%D
-%D \startitemize[packed]
-%D \startitem selectfont and \stopitem
-%D \startitem simplefonts. \stopitem
-%D \stopitemize
-
-\installcorenamespace {selectfontalternative}
-
-\unexpanded\def\defineselectfontalternative
- {\dodoubleargument\selectfont_alternative_define}
-
-\def\selectfont_alternative_define[#name][#alternative]%
- {\setvalue{\??selectfontalternative#name}{#alternative}}
-
-\defineselectfontalternative [\v!selectfont ] [\v!selectfont ]
-\defineselectfontalternative [\v!simplefonts] [\v!simplefonts]
-\defineselectfontalternative [\v!default ] [\v!default ]
-
%D \macros
%D {definefontfamily,definefallbackfamily}
%D
@@ -250,17 +181,17 @@
%D \definefontfamily [dejavu] [serif] [DejaVu Serif]
%D \definefontfamily [dejavu] [sans] [DejaVu Sans]
%D \definefontfamily [dejavu] [mono] [DejaVu Sans Mono]
-%D \definefontfamily [dejavu] [math] [XITS Math] [scale=1.1]
+%D \definefontfamily [dejavu] [math] [XITS Math] [rscale=1.1]
%D
%D \definefontfamily [office] [serif] [Times New Roman]
-%D \definefontfamily [office] [sans] [Arial] [scale=0.9]
+%D \definefontfamily [office] [sans] [Arial] [rscale=0.9]
%D \definefontfamily [office] [mono] [Courier]
%D \definefontfamily [office] [math] [TeX Gyre Termes Math]
%D
%D \definefontfamily [linux] [serif] [Linux Libertine O]
%D \definefontfamily [linux] [sans] [Linux Biolinum O]
%D \definefontfamily [linux] [mono] [Latin Modern Mono]
-%D \definefontfamily [linux] [math] [TeX Gyre Pagella Math] [scale=0.9]
+%D \definefontfamily [linux] [math] [TeX Gyre Pagella Math] [rscale=0.9]
%D
%D \setupbodyfont[dejavu]
%D
@@ -306,7 +237,7 @@
%D optical sizes when they are a feature of the requested font.
%D
%D \starttyping
-%D \definefontfamily[mainface][serif][Latin Modern Roman][opticalsize=yes]
+%D \definefontfamily[mainface][serif][Latin Modern Roman][designsize=auto]
%D
%D \setupbodyfont[mainface]
%D
@@ -319,15 +250,15 @@
%D \stoptext
%D \stoptyping
-% regularfont = … | * … | name:… | name:* … | file:… | file:* … | spec:…-…-… | style:medium
+% tf = … | * … | name:… | name:* … | file:… | file:* … | style:medium
\unexpanded\def\definefontfamily
{\doquadrupleempty\selectfont_family_define}
\def\selectfont_family_define[#typeface][#style][#family][#settings]%
{\doifelseassignment{#settings}
- {\selectfont_setparameters[\c!name={#typeface},\c!style={#style},\c!family={#family},#settings]}
- {\selectfont_setparameters[\c!name={#typeface},\c!style={#style},\c!family={#family},\c!preset={#settings}]}%
+ {\selectfont_register[\c!label={#typeface},\c!style={#style},\c!name={#family},#settings]}
+ {\selectfont_register[\c!label={#typeface},\c!style={#style},\c!name={#family},\c!preset={#settings}]}%
\clf_definefontfamily\selectfont_index\relax}
\unexpanded\def\definefallbackfamily
@@ -335,95 +266,13 @@
\def\selectfont_fallback_define[#typeface][#style][#family][#settings]%
{\doifelseassignment{#settings}
- {\selectfont_setparameters[\c!name={#typeface},\c!style={#style},\c!family={#family},#settings]}
- {\selectfont_setparameters[\c!name={#typeface},\c!style={#style},\c!family={#family},\c!preset={#settings}]}%
- \edef\p_selectfont_style{\expandnamespacevalue\??selectfontstyle{#style}\s!rm}%
- \clf_definefallbackfamily{#typeface}{\p_selectfont_style}\selectfont_index\relax}
-
-%D \macros
-%D {setupfontfamily,setupfallbackfamily}
-%D
-%D For simple documents which don’t need complex font settings one could use
-%D the \tex{setupfontfamily} command where the requested font is enabled immediately
-%D without the need to load it with \tex{setupbodyfont}. The downside of this method
-%D is that processing of the document takes longer with each additional font which
-%D is set with \tex{setupfontfamily}.
-%D
-%D \starttyping
-%D \setupfontfamily [serif] [DejaVu Serif]
-%D \setupfontfamily [sans] [DejaVu Sans]
-%D \setupfontfamily [mono] [DejaVu Sans Mono]
-%D \setupfontfamily [math] [XITS Math] [scale=1.1]
-%D
-%D \starttext
-%D
-%D \rm Serif 123 \ss Sans \tt Mono \m{1+2=3}
-%D
-%D \stoptext
-%D \stoptyping
-
-\newcount\c_selectfont_family
-\newtoks \t_selectfont_fallback
-\newtoks \t_selectfont_styles
-
-\unexpanded\def\setupfontfamily
- {\dotripleempty\selectfont_family_setup}
-
-\def\selectfont_family_setup
- {\ifsecondargument
- \expandafter\selectfont_family_setup_yes
- \else
- \expandafter\selectfont_family_setup_nop
- \fi}
-
-\def\selectfont_family_setup_yes[#style][#family][#settings]%
- {\normalexpanded{\t_selectfont_styles{\selectfont_set_font_family[#style][#family][#settings]\the\t_selectfont_styles}}%
- \selectfont_set_font_indeed}
-
-\def\selectfont_family_setup_nop[#settings][#dummya][#dummyb]%
- {\setupselectfont[#settings]}
-
-\unexpanded\def\selectfont_set_default
- {\selectfont_set_font_family[\v!serif][Latin Modern Roman][\c!opticalsize=\v!yes]%
- \selectfont_set_font_family[\v!sans] [Latin Modern Sans] [\c!opticalsize=\v!yes]%
- \selectfont_set_font_family[\v!mono] [Latin Modern Mono] [\c!opticalsize=\v!yes,\c!features=\s!none]%
- \selectfont_set_font_family[\v!math] [Latin Modern Math] [\c!opticalsize=\v!yes]}
-
-\unexpanded\def\setupfallbackfamily
- {\dotripleempty\selectfont_fallback_setup}
-
-\def\selectfont_fallback_setup[#style][#family][#settings]%
- {\normalexpanded{\t_selectfont_fallback{\the\t_selectfont_fallback\selectfont_set_font_fallback[#style][#family][#settings]}}}
-
-\def\selectfont_set_font_indeed
- {\global\advance\c_selectfont_family\plusone
- \edef\m_selectfont_typeface{\v!selectfont-\number\c_selectfont_family}%
- \the\t_selectfont_fallback
- \the\t_selectfont_styles
- \selectfont_set_default
- \setupbodyfont[\m_selectfont_typeface,\rootselectfontparameter\c!style]}
-
-\unexpanded\def\selectfont_set_font_family[#style]#dummy[#family]#dummy[#settings]%
- {\ifcsname\m_selectfont_typeface#style\endcsname \else
- \expandafter\let\csname\m_selectfont_typeface#style\endcsname\relax
- \selectfont_family_define[\m_selectfont_typeface][#style][#family][#settings]%
- \fi}
-
-\unexpanded\def\selectfont_set_font_fallback[#style]#dummy[#family]#dummy[#settings]%
- {\selectfont_fallback_define[\m_selectfont_typeface][#style][#family][#settings]}
-
-%D You can apply a different feature set to each style of a font but if nothing
-%D is set the global features are used.
+ {\selectfont_register[\c!label={#typeface},\c!style={#style},\c!name={#family},#settings]}
+ {\selectfont_register[\c!label={#typeface},\c!style={#style},\c!name={#family},\c!preset={#settings}]}%
+ \clf_definefallbackfamily\selectfont_index\relax}
\setupselectfont
- [ \c!features=\s!default,
- \c!regularfeatures=\selectfontparameter\c!features,
- \c!boldfeatures=\selectfontparameter\c!features,
- \c!italicfeatures=\selectfontparameter\c!features,
- \c!slantedfeatures=\selectfontparameter\c!features,
- \c!bolditalicfeatures=\selectfontparameter\c!features,
- \c!boldslantedfeatures=\selectfontparameter\c!features,
- \c!smallcapsfeatures=\s!smallcaps,
- \c!style=\s!rm]
+ [ \c!features=\s!default,
+ \s!designsize=\s!default,
+ \s!rscale=1]
-\protect
+\protect \ No newline at end of file
diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua
index 8d45552a5..858dc5e82 100644
--- a/tex/context/base/mkiv/font-sol.lua
+++ b/tex/context/base/mkiv/font-sol.lua
@@ -21,7 +21,6 @@ if not modules then modules = { } end modules ['font-sol'] = { -- this was: node
local gmatch, concat, format, remove = string.gmatch, table.concat, string.format, table.remove
local next, tostring, tonumber = next, tostring, tonumber
local insert, remove = table.insert, table.remove
-local utfchar = utf.char
local random = math.random
local utilities, logs, statistics, fonts, trackers = utilities, logs, statistics, fonts, trackers
@@ -121,9 +120,7 @@ local stoptiming = statistics.stoptiming
local inject_kerns = nodes.injections.handler
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local setfontdynamics = fonthashes.setdynamics
-local fontprocesses = fonthashes.processes
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua
index 435aa1ddc..2f39639fd 100644
--- a/tex/context/base/mkiv/font-syn.lua
+++ b/tex/context/base/mkiv/font-syn.lua
@@ -890,7 +890,6 @@ local function checkduplicate(where) -- fails on "Romantik" but that's a border
local ok = true
local fn = s.filename
for i=1,#h do
- local hn = s.filename
if h[i] == fn then
ok = false
break
diff --git a/tex/context/base/mkiv/font-tfm.lua b/tex/context/base/mkiv/font-tfm.lua
index 8e92c4808..f79006481 100644
--- a/tex/context/base/mkiv/font-tfm.lua
+++ b/tex/context/base/mkiv/font-tfm.lua
@@ -29,7 +29,7 @@ tfm.maxnestingdepth = 5
tfm.maxnestingsize = 65536*1024
local tfmfeatures = constructors.newfeatures("tfm")
-local registertfmfeature = tfmfeatures.register
+----- registertfmfeature = tfmfeatures.register
constructors.resolvevirtualtoo = false -- wil be set in font-ctx.lua
diff --git a/tex/context/base/mkiv/font-tmp.lua b/tex/context/base/mkiv/font-tmp.lua
index 8db5cff14..36fc01dbc 100644
--- a/tex/context/base/mkiv/font-tmp.lua
+++ b/tex/context/base/mkiv/font-tmp.lua
@@ -18,7 +18,7 @@ local streamreader = readers.streamreader
local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
local readulong = streamreader.readcardinal4 -- 24-bit unsigned integer
-local readshort = streamreader.readinteger2 -- 16-bit signed integer
+----- readshort = streamreader.readinteger2 -- 16-bit signed integer
local readtag = streamreader.readtag
local skipshort = streamreader.skipshort
local setposition = streamreader.setposition
diff --git a/tex/context/base/mkiv/grph-rul.lua b/tex/context/base/mkiv/grph-rul.lua
index 9222af319..556763812 100644
--- a/tex/context/base/mkiv/grph-rul.lua
+++ b/tex/context/base/mkiv/grph-rul.lua
@@ -168,12 +168,19 @@ interfaces.implement {
{ "name", "string" },
} } ,
actions = function(t)
+ local r = userrule(t)
+ local ma = getattribute(a_colorspace) or 1
+ local ca = getattribute(a_color)
+ local ta = getattribute(a_transparency)
if t.type == "mp" then
- t.ma = getattribute(a_colorspace) or 1
- t.ca = getattribute(a_color)
- t.ta = getattribute(a_transparency)
+ t.ma = ma
+ t.ca = ca
+ t.ta = ta
+ else
+ r[a_colorspace] = ma
+ r[a_color] = ca
+ r[a_transparency] = ta
end
- local r = userrule(t)
context(r)
end
}
diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua
index 84d9b2d5b..749e2e35d 100644
--- a/tex/context/base/mkiv/lang-dis.lua
+++ b/tex/context/base/mkiv/lang-dis.lua
@@ -12,7 +12,6 @@ local nodes = nodes
local tasks = nodes.tasks
local nuts = nodes.nuts
-local nodepool = nuts.pool
local tonode = nuts.tonode
local tonut = nuts.tonut
@@ -32,10 +31,8 @@ local setdisc = nuts.setdisc
local isglyph = nuts.isglyph
local copy_node = nuts.copy
-local free_node = nuts.free
local remove_node = nuts.remove
local traverse_id = nuts.traverse_id
-local traverse_nodes = nuts.traverse
local nodecodes = nodes.nodecodes
local disccodes = nodes.disccodes
diff --git a/tex/context/base/mkiv/lang-hyp.lua b/tex/context/base/mkiv/lang-hyp.lua
index 146aea4a8..ac1d5cb7e 100644
--- a/tex/context/base/mkiv/lang-hyp.lua
+++ b/tex/context/base/mkiv/lang-hyp.lua
@@ -603,8 +603,8 @@ if context then
local discretionary_code = disccodes.discretionary
local explicit_code = disccodes.explicit
- local regular_code = disccodes.regular
- local automatic_code = disccodes.automatic
+ ----- regular_code = disccodes.regular
+ ----- automatic_code = disccodes.automatic
local nuts = nodes.nuts
local tonut = nodes.tonut
@@ -612,7 +612,6 @@ if context then
local nodepool = nuts.pool
local new_disc = nodepool.disc
- local new_glyph = nodepool.glyph
local new_penalty = nodepool.penalty
local getfield = nuts.getfield
diff --git a/tex/context/base/mkiv/lang-rep.lua b/tex/context/base/mkiv/lang-rep.lua
index 28f2e5d50..2e998b7fb 100644
--- a/tex/context/base/mkiv/lang-rep.lua
+++ b/tex/context/base/mkiv/lang-rep.lua
@@ -65,7 +65,6 @@ local flush_list = nuts.flush_list
local insert_after = nuts.insert_after
local nodepool = nuts.pool
-local new_glyph = nodepool.glyph
local new_disc = nodepool.disc
local texsetattribute = tex.setattribute
diff --git a/tex/context/base/mkiv/lpdf-col.lua b/tex/context/base/mkiv/lpdf-col.lua
index 877c01a1c..5075ecd48 100644
--- a/tex/context/base/mkiv/lpdf-col.lua
+++ b/tex/context/base/mkiv/lpdf-col.lua
@@ -26,7 +26,6 @@ local register = nodepool.register
local pdfliteral = nodepool.pdfliteral
local pdfconstant = lpdf.constant
-local pdfstring = lpdf.string
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfreference = lpdf.reference
diff --git a/tex/context/base/mkiv/lpdf-fld.lua b/tex/context/base/mkiv/lpdf-fld.lua
index 75d0ba98e..04425fb46 100644
--- a/tex/context/base/mkiv/lpdf-fld.lua
+++ b/tex/context/base/mkiv/lpdf-fld.lua
@@ -58,7 +58,6 @@ if not modules then modules = { } end modules ['lpdf-fld'] = {
local tostring, next = tostring, next
local gmatch, lower, format, formatters = string.gmatch, string.lower, string.format, string.formatters
local lpegmatch = lpeg.match
-local utfchar = utf.char
local bpfactor, todimen = number.dimenfactors.bp, string.todimen
local trace_fields = false trackers.register("backends.fields", function(v) trace_fields = v end)
@@ -88,7 +87,6 @@ local pdfreference = lpdf.reference
local pdfunicode = lpdf.unicode
local pdfstring = lpdf.string
local pdfconstant = lpdf.constant
-local pdftoeight = lpdf.toeight
local pdfflushobject = lpdf.flushobject
local pdfshareobjectreference = lpdf.shareobjectreference
local pdfshareobject = lpdf.shareobject
diff --git a/tex/context/base/mkiv/lpdf-grp.lua b/tex/context/base/mkiv/lpdf-grp.lua
index 0eac52dfb..af9116175 100644
--- a/tex/context/base/mkiv/lpdf-grp.lua
+++ b/tex/context/base/mkiv/lpdf-grp.lua
@@ -17,7 +17,6 @@ local nodeinjections = backends.pdf.nodeinjections
local colors = attributes.colors
local basepoints = number.dimenfactors["bp"]
-local inches = number.dimenfactors["in"]
local nodeinjections = backends.pdf.nodeinjections
local codeinjections = backends.pdf.codeinjections
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index f0b919d4e..bd47fda1b 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -78,8 +78,8 @@ end
local pdfsetinfo = pdf.setinfo
local pdfsetcatalog = pdf.setcatalog
-local pdfsetnames = pdf.setnames
-local pdfsettrailer = pdf.settrailer
+----- pdfsetnames = pdf.setnames
+----- pdfsettrailer = pdf.settrailer
local pdfsetpageresources = pdf.setpageresources
local pdfsetpageattributes = pdf.setpageattributes
diff --git a/tex/context/base/mkiv/lpdf-mis.lua b/tex/context/base/mkiv/lpdf-mis.lua
index 62713727d..64c061e18 100644
--- a/tex/context/base/mkiv/lpdf-mis.lua
+++ b/tex/context/base/mkiv/lpdf-mis.lua
@@ -33,7 +33,6 @@ local register = nodepool.register
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
-local pdfboolean = lpdf.boolean
local pdfconstant = lpdf.constant
local pdfreference = lpdf.reference
local pdfunicode = lpdf.unicode
diff --git a/tex/context/base/mkiv/lpdf-swf.lua b/tex/context/base/mkiv/lpdf-swf.lua
index 88cdcc4ec..e40dc6378 100644
--- a/tex/context/base/mkiv/lpdf-swf.lua
+++ b/tex/context/base/mkiv/lpdf-swf.lua
@@ -13,20 +13,17 @@ local format, gsub = string.format, string.gsub
local backends, lpdf = backends, lpdf
-local pdfconstant = lpdf.constant
-local pdfboolean = lpdf.boolean
-local pdfstring = lpdf.string
-local pdfunicode = lpdf.unicode
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfnull = lpdf.null
-local pdfreference = lpdf.reference
-local pdfflushobject = lpdf.flushobject
-
-local checkedkey = lpdf.checkedkey
-
-local codeinjections = backends.pdf.codeinjections
-local nodeinjections = backends.pdf.nodeinjections
+local pdfconstant = lpdf.constant
+local pdfstring = lpdf.string
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfreference = lpdf.reference
+local pdfflushobject = lpdf.flushobject
+
+local checkedkey = lpdf.checkedkey
+
+local codeinjections = backends.pdf.codeinjections
+local nodeinjections = backends.pdf.nodeinjections
local trace_swf = false trackers.register("backend.swf", function(v) trace_swf = v end)
diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua
index 79b8ac368..0e5cea1bf 100644
--- a/tex/context/base/mkiv/lpdf-tag.lua
+++ b/tex/context/base/mkiv/lpdf-tag.lua
@@ -9,7 +9,6 @@ if not modules then modules = { } end modules ['lpdf-tag'] = {
local next = next
local format, match, concat = string.format, string.match, table.concat
local lpegmatch, P, S, C = lpeg.match, lpeg.P, lpeg.S, lpeg.C
-local utfchar = utf.char
local settings_to_hash = utilities.parsers.settings_to_hash
local formatters = string.formatters
@@ -32,7 +31,6 @@ local pdfboolean = lpdf.boolean
local pdfconstant = lpdf.constant
local pdfreference = lpdf.reference
local pdfunicode = lpdf.unicode
-local pdfstring = lpdf.string
local pdfflushobject = lpdf.flushobject
local pdfreserveobject = lpdf.reserveobject
local pdfpagereference = lpdf.pagereference
@@ -70,7 +68,6 @@ local setlist = nuts.setlist
local traverse_nodes = nuts.traverse
local tosequence = nuts.tosequence
-local slide_nodelist = nuts.slide
local insert_before = nuts.insert_before
local insert_after = nuts.insert_after
@@ -88,7 +85,6 @@ local taglist = structurestags.taglist
local specifications = structurestags.specifications
local usedlabels = structurestags.labels
local properties = structurestags.properties
-local lasttaginchain = structurestags.lastinchain
local usewithcare = structurestags.usewithcare
local usedmapping = { }
@@ -348,7 +344,6 @@ function nodeinjections.addtags(head)
last = nil
else
local nl = getlist(n)
- -- slide_nodelist(nl) -- temporary hack till math gets slided (tracker item)
collectranges(nl,n)
end
end
@@ -482,7 +477,6 @@ end
-- last = nil
-- else
-- local nl = getlist(n)
--- -- slide_nodelist(nl) -- temporary hack till math gets slided (tracker item)
-- collectranges(nl,n)
-- end
-- end
diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua
index 73a56caa3..f3c993316 100644
--- a/tex/context/base/mkiv/lpdf-wid.lua
+++ b/tex/context/base/mkiv/lpdf-wid.lua
@@ -29,10 +29,8 @@ local executers = structures.references.executers
local variables = interfaces.variables
local v_hidden = variables.hidden
-local v_normal = variables.normal
local v_auto = variables.auto
local v_embed = variables.embed
-local v_unknown = variables.unknown
local v_max = variables.max
local pdfconstant = lpdf.constant
@@ -42,7 +40,6 @@ local pdfreference = lpdf.reference
local pdfunicode = lpdf.unicode
local pdfstring = lpdf.string
local pdfboolean = lpdf.boolean
-local pdfcolorspec = lpdf.colorspec
local pdfflushobject = lpdf.flushobject
local pdfflushstreamobject = lpdf.flushstreamobject
local pdfflushstreamfileobject = lpdf.flushstreamfileobject
diff --git a/tex/context/base/mkiv/lxml-aux.lua b/tex/context/base/mkiv/lxml-aux.lua
index 4112db1e5..abe36837e 100644
--- a/tex/context/base/mkiv/lxml-aux.lua
+++ b/tex/context/base/mkiv/lxml-aux.lua
@@ -19,7 +19,6 @@ local xml = xml
local xmlcopy, xmlname = xml.copy, xml.name
local xmlinheritedconvert = xml.inheritedconvert
local xmlapplylpath = xml.applylpath
-local xmlfilter = xml.filter
local type, next, setmetatable, getmetatable = type, next, setmetatable, getmetatable
local insert, remove, fastcopy, concat = table.insert, table.remove, table.fastcopy, table.concat
diff --git a/tex/context/base/mkiv/lxml-ent.lua b/tex/context/base/mkiv/lxml-ent.lua
index c392713f0..93f48046b 100644
--- a/tex/context/base/mkiv/lxml-ent.lua
+++ b/tex/context/base/mkiv/lxml-ent.lua
@@ -8,8 +8,6 @@ if not modules then modules = { } end modules ['lxml-ent'] = {
local type, next, tonumber = type, next, tonumber
local byte, format = string.byte, string.format
-local utfchar = utf.char
-local lpegmatch = lpeg.match
local setmetatableindex = table.setmetatableindex
--[[ldx--
diff --git a/tex/context/base/mkiv/lxml-tab.lua b/tex/context/base/mkiv/lxml-tab.lua
index 60d6262c7..2925af5f9 100644
--- a/tex/context/base/mkiv/lxml-tab.lua
+++ b/tex/context/base/mkiv/lxml-tab.lua
@@ -439,7 +439,6 @@ do
local p_rest = (1-P(";"))^0
local p_many = P(1)^0
- local p_char = lpegpatterns.utf8character
local parsedentity =
P("&#") * (P("x")*(p_rest/fromhex) + (p_rest/fromdec)) * P(";") * P(-1) +
diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua
index 3a49ea3d2..836286073 100644
--- a/tex/context/base/mkiv/lxml-tex.lua
+++ b/tex/context/base/mkiv/lxml-tex.lua
@@ -10,7 +10,6 @@ if not modules then modules = { } end modules ['lxml-tex'] = {
-- interface and not the context one. If we ever do that there will
-- be an cldf-xml helper library.
-local utfchar = utf.char
local concat, insert, remove, sortedkeys, reversed = table.concat, table.insert, table.remove, table.sortedkeys, table.reverse
local format, sub, gsub, find, gmatch, match = string.format, string.sub, string.gsub, string.find, string.gmatch, string.match
local type, next, tonumber, tostring, select = type, next, tonumber, tostring, select
diff --git a/tex/context/base/mkiv/math-act.lua b/tex/context/base/mkiv/math-act.lua
index d0ea78990..d47d29179 100644
--- a/tex/context/base/mkiv/math-act.lua
+++ b/tex/context/base/mkiv/math-act.lua
@@ -406,7 +406,6 @@ local setmetatableindex = table.setmetatableindex
local family_font = node.family_font
local fontcharacters = fonts.hashes.characters
-local fontdescriptions = fonts.hashes.descriptions
local extensibles = utilities.storage.allocate()
fonts.hashes.extensibles = extensibles
@@ -418,7 +417,6 @@ local extensibles = mathematics.extensibles
local e_left = extensibles.left
local e_right = extensibles.right
local e_horizontal = extensibles.horizontal
-local e_vertical = extensibles.vertical
local e_mixed = extensibles.mixed
local e_unknown = extensibles.unknown
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 95b5a8ac9..f80959ea6 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -111,19 +111,14 @@ local mlist_to_hlist = nodes.mlist_to_hlist
local font_of_family = node.family_font
local new_kern = nodepool.kern
-local new_rule = nodepool.rule
local fonthashes = fonts.hashes
local fontdata = fonthashes.identifiers
local fontcharacters = fonthashes.characters
-local fontproperties = fonthashes.properties
local fontitalics = fonthashes.italics
-local fontemwidths = fonthashes.emwidths
-local fontexheights = fonthashes.exheights
local variables = interfaces.variables
local texsetattribute = tex.setattribute
-local texgetattribute = tex.getattribute
local unsetvalue = attributes.unsetvalue
local implement = interfaces.implement
@@ -166,7 +161,7 @@ local math_sub = nodecodes.submlist -- attr list
local math_char = nodecodes.mathchar -- attr fam char
local math_textchar = nodecodes.mathtextchar -- attr fam char
local math_delim = nodecodes.delim -- attr small_fam small_char large_fam large_char
-local math_style = nodecodes.style -- attr style
+----- math_style = nodecodes.style -- attr style
local math_choice = nodecodes.choice -- attr display text script scriptscript
local math_fence = nodecodes.fence -- attr subtype
@@ -1564,7 +1559,6 @@ do
local domains = { }
local categories = { }
local numbers = { }
- local mclasses = mathematics.classes
local a_mathdomain = privateattribute("mathdomain")
mathematics.domains = categories
diff --git a/tex/context/base/mkiv/math-tag.lua b/tex/context/base/mkiv/math-tag.lua
index e83b401fb..975b894ec 100644
--- a/tex/context/base/mkiv/math-tag.lua
+++ b/tex/context/base/mkiv/math-tag.lua
@@ -70,8 +70,6 @@ local math_code = nodecodes.math
local processnoads = noads.process
local a_tagged = attributes.private('tagged')
-local a_taggedpar = attributes.private('taggedpar')
-local a_exportstatus = attributes.private('exportstatus')
local a_mathcategory = attributes.private('mathcategory')
local a_mathmode = attributes.private('mathmode')
local a_fontkern = attributes.private('fontkern')
diff --git a/tex/context/base/mkiv/math-vfu.lua b/tex/context/base/mkiv/math-vfu.lua
index a683e02cf..bba4112f0 100644
--- a/tex/context/base/mkiv/math-vfu.lua
+++ b/tex/context/base/mkiv/math-vfu.lua
@@ -25,7 +25,6 @@ if not modules then modules = { } end modules ['math-vfu'] = {
local type, next = type, next
local max = math.max
local format = string.format
-local utfchar = utf.char
local fastcopy = table.copy
local fonts, nodes, mathematics = fonts, nodes, mathematics
diff --git a/tex/context/base/mkiv/mlib-int.lua b/tex/context/base/mkiv/mlib-int.lua
index 6d219fe04..91ac970ba 100644
--- a/tex/context/base/mkiv/mlib-int.lua
+++ b/tex/context/base/mkiv/mlib-int.lua
@@ -8,8 +8,8 @@ if not modules then modules = { } end modules ['mlib-int'] = {
local factor = number.dimenfactors.bp
local mpprint = mp.print
-local mpboolean = mp.boolean
-local mpquoted = mp.quoted
+----- mpboolean = mp.boolean
+----- mpquoted = mp.quoted
local getdimen = tex.getdimen
local getcount = tex.getcount
local get = tex.get
diff --git a/tex/context/base/mkiv/mlib-pps.lua b/tex/context/base/mkiv/mlib-pps.lua
index c016e0f36..018dbb03d 100644
--- a/tex/context/base/mkiv/mlib-pps.lua
+++ b/tex/context/base/mkiv/mlib-pps.lua
@@ -17,12 +17,11 @@ local formatters = string.formatters
local mplib, metapost, lpdf, context = mplib, metapost, lpdf, context
local context = context
-local context_setvalue = context.setvalue
local implement = interfaces.implement
local setmacro = interfaces.setmacro
-local texgetbox = tex.getbox
+----- texgetbox = tex.getbox
local texsetbox = tex.setbox
local textakebox = tex.takebox
local copy_list = node.copy_list
@@ -283,10 +282,10 @@ local function settext(box,slot)
-- if trace_textexts then
-- report_textexts("getting text %s from box %s",slot,box)
-- end
- top.textexts[slot] = copy_list(texgetbox(box))
- texsetbox(box,nil)
- -- this can become
- -- top.textexts[slot] = textakebox(box)
+ -- top.textexts[slot] = copy_list(texgetbox(box))
+ -- texsetbox(box,nil)
+ -- this can become
+ top.textexts[slot] = textakebox(box)
else
-- weird error
end
@@ -294,6 +293,7 @@ end
local function gettext(box,slot)
if top then
+ -- maybe check how often referenced
texsetbox(box,copy_list(top.textexts[slot]))
-- if trace_textexts then
-- report_textexts("putting text %s in box %s",slot,box)
@@ -524,12 +524,6 @@ metapost.checktexts = checktexts
local factor = 65536*(7227/7200)
--- function metapost.edefsxsy(wd,ht,dp) -- helper for figure
--- local hd = ht + dp
--- context_setvalue("sx",wd ~= 0 and factor/wd or 0)
--- context_setvalue("sy",hd ~= 0 and factor/hd or 0)
--- end
-
implement {
name = "mpsetsxsy",
arguments = { "dimen", "dimen", "dimen" },
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index 8109cff2d..42fcdd26b 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -93,8 +93,7 @@ do
local finders = { }
mplib.finders = finders -- also used in meta-lua.lua
- local new_instance = mplib.new
- local resolved_file = resolvers.findfile
+ local new_instance = mplib.new
local function preprocessed(name)
if not mpbasepath(name) then
@@ -241,9 +240,8 @@ function metapost.load(name,method)
end
function metapost.checkformat(mpsinput,method)
- local mpsversion = environment.version or "unset version"
- local mpsinput = mpsinput or "metafun"
- local foundfile = ""
+ local mpsinput = mpsinput or "metafun"
+ local foundfile = ""
if file.suffix(mpsinput) ~= "" then
foundfile = find_file(mpsinput) or ""
end
diff --git a/tex/context/base/mkiv/node-acc.lua b/tex/context/base/mkiv/node-acc.lua
index ed34dbec9..4727fd6a4 100644
--- a/tex/context/base/mkiv/node-acc.lua
+++ b/tex/context/base/mkiv/node-acc.lua
@@ -28,14 +28,14 @@ local setlink = nuts.setlink
local setchar = nuts.setchar
local setsubtype = nuts.setsubtype
-local traverse_nodes = nuts.traverse
+----- traverse_nodes = nuts.traverse
local traverse_id = nuts.traverse_id
local copy_node = nuts.copy
local free_nodelist = nuts.flush_list
local insert_after = nuts.insert_after
local glue_code = nodecodes.glue
-local kern_code = nodecodes.kern
+----- kern_code = nodecodes.kern
local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
diff --git a/tex/context/base/mkiv/node-aux.lua b/tex/context/base/mkiv/node-aux.lua
index ebe113fc6..5ac096f7c 100644
--- a/tex/context/base/mkiv/node-aux.lua
+++ b/tex/context/base/mkiv/node-aux.lua
@@ -20,7 +20,6 @@ local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local attributelist_code = nodecodes.attributelist -- temporary
-local math_code = nodecodes.math
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -51,15 +50,11 @@ local hpack_nodes = nuts.hpack
local unset_attribute = nuts.unset_attribute
local first_glyph = nuts.first_glyph
local copy_node = nuts.copy
-local copy_node_list = nuts.copy_list
+----- copy_node_list = nuts.copy_list
local find_tail = nuts.tail
local insert_node_after = nuts.insert_after
-local isnode = nuts.is_node
local getbox = nuts.getbox
-local nodes_traverse_id = nodes.traverse_id
-local nodes_first_glyph = nodes.first_glyph
-
local nodepool = nuts.pool
local new_glue = nodepool.glue
local new_glyph = nodepool.glyph
@@ -262,16 +257,6 @@ nuts.unsetattributes = unset_attributes nodes.unsetattribut
-- end
-- end
--
--- if not node.end_of_math then
--- function node.end_of_math(n)
--- for n in traverse_id(math_code,getnext(next)) do
--- return n
--- end
--- end
--- end
---
--- nodes.endofmath = node.end_of_math
---
-- local function firstline(n)
-- while n do
-- local id = getid(n)
@@ -300,16 +285,6 @@ function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255
end
end
--- function nodes.firstcharacter(n,untagged) -- tagged == subtype > 255
--- if untagged then
--- return nodes_first_glyph(n)
--- else
--- for g in nodes_traverse_id(glyph_code,n) do
--- return g
--- end
--- end
--- end
-
local function firstcharinbox(n)
local l = getlist(getbox(n))
if l then
@@ -386,79 +361,6 @@ nodes.tonodes = function(str,fnt,attr)
return tonode(head), tonode(tail)
end
--- local function link(list,currentfont,currentattr,head,tail)
--- for i=1,#list do
--- local n = list[i]
--- if n then
--- local tn = isnode(n)
--- if not tn then
--- local tn = type(n)
--- if tn == "number" then
--- if not currentfont then
--- currentfont = current_font()
--- end
--- local h, t = tonodes(tostring(n),currentfont,currentattr)
--- if not h then
--- -- skip
--- elseif not head then
--- head = h
--- tail = t
--- else
--- setfield(tail,"next",h)
--- setfield(h,"prev",t)
--- tail = t
--- end
--- elseif tn == "string" then
--- if #tn > 0 then
--- if not currentfont then
--- currentfont = current_font()
--- end
--- local h, t = tonodes(n,currentfont,currentattr)
--- if not h then
--- -- skip
--- elseif not head then
--- head, tail = h, t
--- else
--- setfield(tail,"next",h)
--- setfield(h,"prev",t)
--- tail = t
--- end
--- end
--- elseif tn == "table" then
--- if #tn > 0 then
--- if not currentfont then
--- currentfont = current_font()
--- end
--- head, tail = link(n,currentfont,currentattr,head,tail)
--- end
--- end
--- elseif not head then
--- head = n
--- tail = find_tail(n)
--- elseif getid(n) == attributelist_code then
--- -- weird case
--- report_error("weird node type in list at index %s:",i)
--- for i=1,#list do
--- local l = list[i]
--- report_error("%3i: %s %S",i,getid(l) == attributelist_code and "!" or ">",l)
--- end
--- os.exit()
--- else
--- setfield(tail,"next",n)
--- setfield(n,"prev",tail)
--- if getnext(n) then
--- tail = find_tail(n)
--- else
--- tail = n
--- end
--- end
--- else
--- -- permitting nil is convenient
--- end
--- end
--- return head, tail
--- end
-
local function link(list,currentfont,currentattr,head,tail) -- an oldie, might be replaced
for i=1,#list do
local n = list[i]
diff --git a/tex/context/base/mkiv/node-bck.lua b/tex/context/base/mkiv/node-bck.lua
index a095ac4c4..326987586 100644
--- a/tex/context/base/mkiv/node-bck.lua
+++ b/tex/context/base/mkiv/node-bck.lua
@@ -18,7 +18,6 @@ local listcodes = nodes.listcodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local glyph_code = nodecodes.glyph
local cell_code = listcodes.cell
local nuts = nodes.nuts
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua
index a2d63d38d..25a2d2f44 100644
--- a/tex/context/base/mkiv/node-fin.lua
+++ b/tex/context/base/mkiv/node-fin.lua
@@ -42,12 +42,9 @@ local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
local glue_code = nodecodes.glue
local rule_code = nodecodes.rule
-local whatsit_code = nodecodes.whatsit
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local normal_rule = rulecodes.normal
-
local states = attributes.states
local numbers = attributes.numbers
local a_trigger = attributes.private('trigger')
@@ -179,7 +176,6 @@ function states.finalize(namespace,attribute,head) -- is this one ok?
end
-- we need to deal with literals too (reset as well as oval)
--- if id == glyph_code or (id == whatsit_code and getsubtype(stack) == pdfliteral_code) or (id == rule_code and stack.width ~= 0) or (id == glue_code and stack.leader) then
local function process(namespace,attribute,head,inheritance,default) -- one attribute
local stack = head
@@ -226,9 +222,7 @@ local function process(namespace,attribute,head,inheritance,default) -- one attr
-- end nested --
end
elseif id == rule_code then
--- if subtype(stack) == normal_rule then
check = getfield(stack,"width") ~= 0
--- end
end
-- much faster this way than using a check() and nested() function
if check then
@@ -355,9 +349,7 @@ local function selective(namespace,attribute,head,inheritance,default) -- two at
-- end nested
end
elseif id == rule_code then
--- if subtype(stack) == normal_rule then
check = getfield(stack,"width") ~= 0
--- end
end
if check then
@@ -488,9 +480,7 @@ local function stacked(namespace,attribute,head,default) -- no triggering, no in
end
end
elseif id == rule_code then
--- if subtype(stack) == normal_rule then
check = getfield(stack,"width") ~= 0
--- end
end
if check then
@@ -584,9 +574,7 @@ local function stacker(namespace,attribute,head,default) -- no triggering, no in
done = done or ok
end
elseif id == rule_code then
--- if subtype(stack) == normal_rule then
check = getfield(current,"width") ~= 0
--- end
end
if check then
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua
index e77280c37..f1e8b33ed 100644
--- a/tex/context/base/mkiv/node-fnt.lua
+++ b/tex/context/base/mkiv/node-fnt.lua
@@ -64,11 +64,9 @@ local ischar = nuts.ischar -- checked
local traverse_id = nuts.traverse_id
local traverse_char = nuts.traverse_char
-local remove_node = nuts.remove
local protect_glyph = nuts.protect_glyph
local free_node = nuts.free
-local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
local boundary_code = nodecodes.boundary
local word_boundary = nodes.boundarycodes.word
diff --git a/tex/context/base/mkiv/node-ini.lua b/tex/context/base/mkiv/node-ini.lua
index bb8a7d331..f8720f717 100644
--- a/tex/context/base/mkiv/node-ini.lua
+++ b/tex/context/base/mkiv/node-ini.lua
@@ -265,6 +265,15 @@ end
local nodecodes = simplified(node.types())
local whatcodes = simplified(node.whatsits())
+local usercodes = allocate {
+ [ 97] = "attributes", -- a
+ [100] = "number", -- d
+ [108] = "lua", -- l
+ [110] = "nodes", -- n
+ [115] = "string", -- s
+ [116] = "tokens" -- t
+}
+
skipcodes = allocate(swapped(skipcodes,skipcodes))
boundarycodes = allocate(swapped(boundarycodes,boundarycodes))
noadcodes = allocate(swapped(noadcodes,noadcodes))
@@ -283,25 +292,32 @@ accentcodes = allocate(swapped(accentcodes,accentcodes))
fencecodes = allocate(swapped(fencecodes,fencecodes))
rulecodes = allocate(swapped(rulecodes,rulecodes))
leadercodes = allocate(swapped(leadercodes,leadercodes))
+usercodes = allocate(swapped(usercodes,usercodes))
-nodes.skipcodes = skipcodes nodes.gluecodes = skipcodes -- more official
+nodes.skipcodes = skipcodes
nodes.boundarycodes = boundarycodes
nodes.noadcodes = noadcodes
nodes.nodecodes = nodecodes
-nodes.whatcodes = whatcodes nodes.whatsitcodes = whatcodes -- more official
+nodes.whatcodes = whatcodes
nodes.listcodes = listcodes
nodes.glyphcodes = glyphcodes
nodes.kerncodes = kerncodes
nodes.penaltycodes = penaltycodes
nodes.mathcodes = mathcodes
nodes.fillcodes = fillcodes
-nodes.margincodes = margincodes nodes.marginkerncodes = margincodes
-nodes.disccodes = disccodes nodes.discretionarycodes = disccodes
+nodes.margincodes = margincodes
+nodes.disccodes = disccodes
nodes.accentcodes = accentcodes
nodes.radicalcodes = radicalcodes
nodes.fencecodes = fencecodes
nodes.rulecodes = rulecodes
nodes.leadercodes = leadercodes
+nodes.usercodes = usercodes
+
+nodes.gluecodes = skipcodes -- more official
+nodes.whatsitcodes = whatcodes -- more official
+nodes.marginkerncodes = margincodes
+nodes.discretionarycodes = disccodes
listcodes.row = listcodes.alignment
listcodes.column = listcodes.alignment
@@ -327,6 +343,9 @@ nodes.codes = allocate { -- mostly for listing
whatsit = whatcodes,
accent = accentcodes,
fence = fencecodes,
+ rule = rulecodes,
+ leader = leadercodes,
+ user = usercodes,
}
local report_codes = logs.reporter("nodes","codes")
diff --git a/tex/context/base/mkiv/node-ltp.lua b/tex/context/base/mkiv/node-ltp.lua
index ae17ab9ef..fc64bf6e5 100644
--- a/tex/context/base/mkiv/node-ltp.lua
+++ b/tex/context/base/mkiv/node-ltp.lua
@@ -149,7 +149,7 @@ local trace_expansion = false trackers.register("builders.paragraphs.expans
local trace_quality = false trackers.register("builders.paragraphs.quality", function(v) trace_quality = v end)
local report_parbuilders = logs.reporter("nodes","parbuilders")
-local report_hpackers = logs.reporter("nodes","hpackers")
+----- report_hpackers = logs.reporter("nodes","hpackers")
local calculate_badness = tex.badness
local texnest = tex.nest
@@ -185,7 +185,6 @@ local constructors = parbuilders.constructors
local setmetatableindex = table.setmetatableindex
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local chardata = fonthashes.characters
local quaddata = fonthashes.quads
local parameters = fonthashes.parameters
@@ -222,15 +221,13 @@ local slide_nodelist = nuts.slide -- get rid of this, probably ok > 78.2
local find_tail = nuts.tail
local new_node = nuts.new
local copy_node = nuts.copy
-local copy_nodelist = nuts.copy_list
local flush_node = nuts.free
local flush_nodelist = nuts.flush_list
-local hpack_nodes = nuts.hpack
+----- hpack_nodes = nuts.hpack
local xpack_nodes = nuts.hpack
local replace_node = nuts.replace
local insert_node_after = nuts.insert_after
local insert_node_before = nuts.insert_before
-local traverse_by_id = nuts.traverse_id
local setnodecolor = nodes.tracers.colors.set
@@ -278,7 +275,7 @@ local ligature_code = glyphcodes.ligature
local stretch_orders = nodes.fillcodes
local leftmargin_code = margincodes.left
-local rightmargin_code = margincodes.right
+----- rightmargin_code = margincodes.right
local automatic_disc_code = disccodes.automatic
local regular_disc_code = disccodes.regular
@@ -616,12 +613,16 @@ local function find(head) -- do we really want to recurse into an hlist?
else
head = getnext(head)
end
- elseif id == protrusion_code then
- local v = getfield(head,"value")
- if v == 1 or v == 3 then
- head = getnext(head)
- if head then
+ elseif id == boundary_code then
+ if getsubtype(head) == protrusion_code then
+ local v = getfield(head,"value")
+ if v == 1 or v == 3 then
head = getnext(head)
+ if head then
+ head = getnext(head)
+ end
+ else
+ return head
end
else
return head
@@ -666,12 +667,16 @@ local function find(head,tail)
else
tail = getprev(tail)
end
- elseif id == protrusion_code then
- local v = getfield(tail,"value")
- if v == 2 or v == 3 then
- tail = getprev(tail)
- if tail then
+ elseif id == boundary_code then
+ if getsubtype(head) == protrusion_code then
+ local v = getfield(tail,"value")
+ if v == 2 or v == 3 then
tail = getprev(tail)
+ if tail then
+ tail = getprev(tail)
+ end
+ else
+ return tail
end
else
return tail
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index 432ecd1ec..c6a246b96 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -201,7 +201,6 @@ nodes.getbox = node.getbox or tex.getbox
nodes.setbox = node.setbox or tex.setbox
nodes.getskip = node.getskip or tex.get
-local n_new_node = nodes.new
local n_free_node = nodes.free
local n_copy_node = nodes.copy
local n_copy_list = nodes.copy_list
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index 1465a6680..4f89d93fc 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -274,8 +274,6 @@ nuts.isglyph = direct.is_glyph
local d_remove_node = direct.remove
local d_free_node = direct.free
-local d_getfield = direct.getfield
-local d_setfield = direct.setfield
local d_getnext = direct.getnext
local d_getprev = direct.getprev
local d_getid = direct.getid
diff --git a/tex/context/base/mkiv/node-ppt.lua b/tex/context/base/mkiv/node-ppt.lua
index 2573e5f5c..cbdae27ce 100644
--- a/tex/context/base/mkiv/node-ppt.lua
+++ b/tex/context/base/mkiv/node-ppt.lua
@@ -46,9 +46,6 @@ local userdefined_code = whatsitcodes.userdefined
local nodepool = nodes.pool
local new_usernumber = nodepool.usernumber
-local nutpool = nuts.pool
-local nut_usernumber = nutpool.usernumber
-
local variables = interfaces.variables
local v_before = variables.before
local v_after = variables.after
@@ -180,6 +177,9 @@ end
-- another experiment (a table or function closure are equally efficient); a function
-- is easier when we want to experiment with different (compatible) implementations
+-- local nutpool = nuts.pool
+-- local nut_usernumber = nutpool.usernumber
+
-- function nodes.nuts.pool.deferredfunction(...)
-- nofdelayed = nofdelayed + 1
-- local n = nut_usernumber(property_id,0)
diff --git a/tex/context/base/mkiv/node-pro.lua b/tex/context/base/mkiv/node-pro.lua
index 36670eed2..713d78f07 100644
--- a/tex/context/base/mkiv/node-pro.lua
+++ b/tex/context/base/mkiv/node-pro.lua
@@ -14,10 +14,7 @@ local force_processors = false directives.register("nodes.processors.force", fu
local report_nodes = logs.reporter("nodes","processors")
-local nodes = nodes
-
-local nodecodes = nodes.nodecodes
-local glyph_code = nodecodes.glyph
+local nodes = nodes
local tasks = nodes.tasks
local nuts = nodes.nuts
diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua
index 9f2d0918c..bce554beb 100644
--- a/tex/context/base/mkiv/node-ref.lua
+++ b/tex/context/base/mkiv/node-ref.lua
@@ -574,8 +574,8 @@ end
-- references:
-local texsetattribute = tex.setattribute
local texsetcount = tex.setcount
+----- texsetattribute = tex.setattribute
local stack = { }
local done = { }
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua
index 4d25314ad..89ffd1ff5 100644
--- a/tex/context/base/mkiv/node-res.lua
+++ b/tex/context/base/mkiv/node-res.lua
@@ -27,6 +27,7 @@ local kerncodes = nodes.kerncodes
local rulecodes = nodes.rulecodes
local nodecodes = nodes.nodecodes
local boundarycodes = nodes.boundarycodes
+local usercodes = nodes.usercodes
local glyph_code = nodecodes.glyph
@@ -150,11 +151,15 @@ local textdir = register_nut(new_nut("dir"))
local latelua = register_nut(new_nut("whatsit",whatsitcodes.latelua))
local special = register_nut(new_nut("whatsit",whatsitcodes.special))
-local user_n = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_n,"type",100) -- 44
-local user_l = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_l,"type",110) -- 44
-local user_s = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_s,"type",115) -- 44
-local user_t = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_t,"type",116) -- 44
------ user_c = register_nut(new_nut("whatsit",whatsitcodes.userdefined)) setfield(user_c,"type",108) -- 44
+
+local user_node = new_nut("whatsit",whatsitcodes.userdefined)
+
+local user_number = register_nut(copy_nut(user_node)) setfield(user_number, "type",usercodes.number)
+local user_nodes = register_nut(copy_nut(user_node)) setfield(user_nodes, "type",usercodes.nodes)
+local user_string = register_nut(copy_nut(user_node)) setfield(user_string, "type",usercodes.string)
+local user_tokens = register_nut(copy_nut(user_node)) setfield(user_tokens, "type",usercodes.tokens)
+----- user_lua = register_nut(copy_nut(user_node)) setfield(user_lua, "type",usercodes.lua) -- in > 0.95
+local user_attributes = register_nut(copy_nut(user_node)) setfield(user_attributes,"type",usercodes.attributes)
local left_margin_kern = register_nut(new_nut("margin_kern",0))
local right_margin_kern = register_nut(new_nut("margin_kern",1))
@@ -417,9 +422,7 @@ if context and _cldo_ then
-- a typical case where we have more nodes than nuts
- local context = context
-
- local f_cldo = string.formatters["_cldo_(%i)"]
+ local context = context
local register = context.registerfunction
local latelua_node = register_node(new_node("whatsit",whatsitcodes.latelua))
@@ -428,20 +431,6 @@ if context and _cldo_ then
local setfield_node = nodes.setfield
local setfield_nut = nuts .setfield
- -- function nodepool.lateluafunction(f)
- -- local n = copy_node(latelua_node)
- -- setfield_node(n,"string",f_cldo(register(f)))
- -- return n
- -- end
-
- -- function nutpool.lateluafunction(f)
- -- local n = copy_nut(latelua_nut)
- -- setfield_nut(n,"string",f_cldo(register(f)))
- -- return n
- -- end
-
- -- when function in latelua:
-
function nodepool.lateluafunction(f)
local n = copy_node(latelua_node)
setfield_node(n,"string",f)
@@ -454,37 +443,16 @@ if context and _cldo_ then
return n
end
- local latefunction = nodepool.lateluafunction
- local flushnode = context.flushnode
-
- -- function context.lateluafunction(f)
- -- flushnode(latefunction(f)) -- hm, quite some indirect calls
- -- end
-
- -- when function in latelua:
-
-- function context.lateluafunction(f)
-- local n = copy_node(latelua_node)
-- setfield_node(n,"string",f)
- -- flushnode(n)
- -- end
-
- -- local contextsprint = context.sprint
- -- local ctxcatcodes = tex.ctxcatcodes
- -- local storenode = context.storenode
-
- -- when 0.79 is out:
-
- -- function context.lateluafunction(f)
- -- contextsprint(ctxcatcodes,"\\cldl",storenode(latefunction(f))," ")
+ -- contextsprint(ctxcatcodes,"\\cldl",storenode(n)," ")
-- end
- -- when function in latelua:
+ local new_latelua_node = nodes.pool.latelua
- function context.lateluafunction(f)
- local n = copy_node(latelua_node)
- setfield_node(n,"string",f)
- contextsprint(ctxcatcodes,"\\cldl",storenode(n)," ")
+ function context.lateluafunction(f) -- not used anyway
+ context(new_latelua_node(f))
end
end
@@ -571,7 +539,7 @@ end
-- local str = userids[num]
function nutpool.usernumber(id,num)
- local n = copy_nut(user_n)
+ local n = copy_nut(user_number)
if num then
setfield(n,"user_id",id)
setfield(n,"value",num)
@@ -582,7 +550,7 @@ function nutpool.usernumber(id,num)
end
function nutpool.userlist(id,list)
- local n = copy_nut(user_l)
+ local n = copy_nut(user_nodes)
if list then
setfield(n,"user_id",id)
setfield(n,"value",list)
@@ -593,7 +561,7 @@ function nutpool.userlist(id,list)
end
function nutpool.userstring(id,str)
- local n = copy_nut(user_s)
+ local n = copy_nut(user_string)
if str then
setfield(n,"user_id",id)
setfield(n,"value",str)
@@ -604,7 +572,7 @@ function nutpool.userstring(id,str)
end
function nutpool.usertokens(id,tokens)
- local n = copy_nut(user_t)
+ local n = copy_nut(user_tokens)
if tokens then
setfield(n,"user_id",id)
setfield(n,"value",tokens)
@@ -614,16 +582,27 @@ function nutpool.usertokens(id,tokens)
return n
end
--- function nutpool.usercode(id,code)
--- local n = copy_nut(user_c)
--- if code then
--- setfield(n,"user_id",id)
--- setfield(n,"value",code)
--- else
--- setfield(n,"value",id)
--- end
--- return n
--- end
+function nutpool.userlua(id,code)
+ local n = copy_nut(user_lua)
+ if code then
+ setfield(n,"user_id",id)
+ setfield(n,"value",code)
+ else
+ setfield(n,"value",id)
+ end
+ return n
+end
+
+function nutpool.userattributes(id,attr)
+ local n = copy_nut(user_attributes)
+ if attr then
+ setfield(n,"user_id",id)
+ setfield(n,"value",attr)
+ else
+ setfield(n,"value",id)
+ end
+ return n
+end
function nutpool.special(str)
local n = copy_nut(special)
@@ -637,24 +616,22 @@ local function cleanup(nofboxes) -- todo
if nodes.tracers.steppers then -- to be resolved
nodes.tracers.steppers.reset() -- todo: make a registration subsystem
end
- local nl, nr = 0, nofreserved
+ local nl = 0
+ local nr = nofreserved
for i=1,nofreserved do
local ri = reserved[i]
- -- if not (getid(ri) == glue_spec and not getfield(ri,"is_writable")) then
- free_nut(reserved[i])
- -- end
+ free_nut(reserved[i])
end
if nofboxes then
for i=0,nofboxes do
local l = getbox(i)
if l then
--- print(nodes.listtoutf(getlist(l)))
free_nut(l) -- also list ?
nl = nl + 1
end
end
end
- reserved = { }
+ reserved = { }
nofreserved = 0
return nr, nl, nofboxes -- can be nil
end
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index a1ac67657..033539062 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -13,34 +13,36 @@ if not modules then modules = { } end modules ['node-rul'] = {
local attributes, nodes, node = attributes, nodes, node
-local nuts = nodes.nuts
-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
-local getnext = nuts.getnext
-local getprev = nuts.getprev
-local getid = nuts.getid
-local getattr = nuts.getattr
-local setattr = nuts.setattr
-local getfont = nuts.getfont
-local getsubtype = nuts.getsubtype
-local getlist = nuts.getlist
-local setlist = nuts.setlist
-
-local nodecodes = nodes.nodecodes
-local tasks = nodes.tasks
-
-local properties = nodes.properties
-local attribs = node.current_attr
-
-local glyph_code = nodecodes.glyph
-local disc_code = nodecodes.disc
-local rule_code = nodecodes.rule
+local nuts = nodes.nuts
+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
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getattr = nuts.getattr
+local setattr = nuts.setattr
+local getfont = nuts.getfont
+local getsubtype = nuts.getsubtype
+local getlist = nuts.getlist
+local setlist = nuts.setlist
+
+local nodecodes = nodes.nodecodes
+local tasks = nodes.tasks
+
+local properties = nodes.properties
+local attribs = node.current_attr
+
+local glyph_code = nodecodes.glyph
+local disc_code = nodecodes.disc
+local rule_code = nodecodes.rule
+local boundary_code = nodecodes.boundary
+local dir_code = nodecodes.dir
function nodes.striprange(first,last) -- todo: dir
if first and last then -- just to be sure
@@ -49,7 +51,7 @@ function nodes.striprange(first,last) -- todo: dir
end
while first and first ~= last do
local id = getid(first)
- if id == glyph_code or id == disc_code then -- or id == rule_code
+ if id == glyph_code or id == disc_code or id == dir_code or id == boundary_code then -- or id == rule_code
break
else
first = getnext(first)
@@ -62,7 +64,7 @@ function nodes.striprange(first,last) -- todo: dir
end
while last and last ~= first do
local id = getid(last)
- if id == glyph_code or id == disc_code then -- or id == rule_code
+ if id == glyph_code or id == disc_code or id == dir_code or id == boundary_code then -- or id == rule_code
break
else
local prev = getprev(last) -- luatex < 0.70 has italic correction kern not prev'd
@@ -123,6 +125,7 @@ local kern_code = nodecodes.kern
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local rule_code = nodecodes.rule
+local boundary_code = nodecodes.boundary
local dir_code = nodecodes.dir
local userskip_code = skipcodes.userskip
@@ -137,7 +140,6 @@ local nodepool = nuts.pool
local new_rule = nodepool.rule
local new_userrule = nodepool.userrule
local new_kern = nodepool.kern
-local new_glue = nodepool.glue
-- we can use this one elsewhere too
--
@@ -198,7 +200,7 @@ local function processwords(attribute,data,flush,head,parent) -- we have hlistdi
end
f, l, a = nil, nil, nil
end
- elseif id == disc_code then
+ elseif id == disc_code or id == boundary_code then
if f then
l = n
end
@@ -215,8 +217,12 @@ local function processwords(attribute,data,flush,head,parent) -- we have hlistdi
if list then
setlist(n,(processwords(attribute,data,flush,list,n))) -- watch ()
end
- elseif checkdir and id == dir_code then -- only changes in dir, we assume proper boundaries
- if f and a then
+-- elseif checkdir and id == dir_code then -- only changes in dir, we assume proper boundaries
+-- if f and a then
+-- l = n
+-- end
+ elseif id == dir_code then -- only changes in dir, we assume proper boundaries
+ if f then
l = n
end
elseif f then
@@ -467,10 +473,10 @@ local function flush_shifted(head,first,last,data,level,parent,strip) -- not tha
head = list
end
if prev then
- setlink(prev,list)
+ setlink(prev,list)
end
if next then
- setlink(next,list)
+ setlink(list,next)
end
local raise = data.dy * dimenfactor(data.unit,fontdata[getfont(first)])
setfield(list,"shift",raise)
diff --git a/tex/context/base/mkiv/node-rul.mkiv b/tex/context/base/mkiv/node-rul.mkiv
index 74f6dfd23..130ac9671 100644
--- a/tex/context/base/mkiv/node-rul.mkiv
+++ b/tex/context/base/mkiv/node-rul.mkiv
@@ -148,10 +148,12 @@
\unexpanded\def\startbar[#1]%
{\begingroup
- \node_rules_set{#1}}
+ \node_rules_set{#1}%
+ \ignorespaces}
\unexpanded\def\stopbar
- {\endgroup}
+ {\removeunwantedspaces
+ \endgroup}
\unexpanded\def\setbar[#1]%
{\node_rules_set{#1}}
@@ -367,22 +369,24 @@
+\csname\??shiftattribute#1\ifcsname\??shift#1:\number\c_node_shifts_index\s!parent\endcsname:\number\c_node_shifts_index\fi\endcsname
\relax
\useshiftstyleandcolor\c!style\c!color
- \dosetupisolatedalign{\shiftparameter\c!align}}
+ \dosetupisolatedalign{\shiftparameter\c!align}} % weird feature that i probably needed once
\unexpanded\def\startshift[#1]%
{\begingroup
- \node_shifts_set{#1}}
+ \node_shifts_set{#1}%
+ \ignorespaces}
\unexpanded\def\stopshift
- {\endgroup}
+ {\removeunwantedspaces
+ \endgroup}
% \unexpanded\def\node_shifts_direct#1%
% {\doisolatedgroupedalign{\node_shifts_set{#1}}\donothing}
\unexpanded\def\node_shifts_direct#1%
{\groupedcommand
- {\begingroup\dostartisolation\begingroup\node_shifts_set{#1}}
- {\endgroup\dostopisolation\endgroup}}
+ {\begingroup\dostartisolation\begingroup\node_shifts_set{#1}\ignorespaces}
+ {\removeunwantedspaces\endgroup\dostopisolation\endgroup}}
\setupshifts
[\c!method=0,
diff --git a/tex/context/base/mkiv/node-shp.lua b/tex/context/base/mkiv/node-shp.lua
index 2f2af4905..216e6462a 100644
--- a/tex/context/base/mkiv/node-shp.lua
+++ b/tex/context/base/mkiv/node-shp.lua
@@ -23,9 +23,6 @@ local handlers = nodes.handlers
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local disc_code = nodecodes.disc
-local mark_code = nodecodes.mark
-local kern_code = nodecodes.kern
-local glue_code = nodecodes.glue
local whatsit_code = nodecodes.whatsit
local fulldisc_code = disccodes.discretionary
@@ -37,15 +34,14 @@ local implement = interfaces.implement
local nuts = nodes.nuts
local tonut = nuts.tonut
local tonode = nuts.tonode
-local free_node = nuts.free
local remove_node = nuts.remove
local traverse_nodes = nuts.traverse
local getfield = nuts.getfield
local setfield = nuts.setfield
-local setsetlink = nuts.setlink
-local setsetprev = nuts.setprev
-local setsetnext = nuts.setnext
+local setlink = nuts.setlink
+local setprev = nuts.setprev
+local setnext = nuts.setnext
local getid = nuts.getid
local getdisc = nuts.getdisc
local getboth = nuts.getboth
diff --git a/tex/context/base/mkiv/node-tra.lua b/tex/context/base/mkiv/node-tra.lua
index d184620ef..807b1de58 100644
--- a/tex/context/base/mkiv/node-tra.lua
+++ b/tex/context/base/mkiv/node-tra.lua
@@ -75,7 +75,6 @@ local rule_code = nodecodes.rule
local dir_code = nodecodes.dir
local localpar_code = nodecodes.localpar
local whatsit_code = nodecodes.whatsit
-local gluespec_code = nodecodes.gluespec
local dimenfactors = number.dimenfactors
local fillorders = nodes.fillcodes
diff --git a/tex/context/base/mkiv/node-typ.lua b/tex/context/base/mkiv/node-typ.lua
index 2d84e07a3..a40b45b56 100644
--- a/tex/context/base/mkiv/node-typ.lua
+++ b/tex/context/base/mkiv/node-typ.lua
@@ -25,7 +25,6 @@ local getfont = nuts.getfont
local hpack_node_list = nuts.hpack
local vpack_node_list = nuts.vpack
local full_hpack_list = nuts.fullhpack
-local copy_node = nuts.copy
local nodepool = nuts.pool
local new_glyph = nodepool.glyph
@@ -34,19 +33,19 @@ local new_glue = nodepool.glue
local utfvalues = utf.values
local currentfont = font.current
-local currentattr = node.current_attr
+----- currentattr = node.current_attr
local fontparameters = fonts.hashes.parameters
local function tonodes(str,fontid,spacing,templateglyph) -- quick and dirty
local head, prev = nil, nil
--- local attrid = nil
+ -- local attrid = nil
if not fontid then
if templateglyph then
fontid = getfont(templateglyph)
--- attrid = getfield(templateglyph,"attr")
+ -- attrid = getfield(templateglyph,"attr")
else
fontid = currentfont()
--- attrid = currentattr()
+ -- attrid = currentattr()
end
end
local fp = fontparameters[fontid]
diff --git a/tex/context/base/mkiv/pack-mrl.mkiv b/tex/context/base/mkiv/pack-mrl.mkiv
index 649b29fa6..85aa3ad04 100644
--- a/tex/context/base/mkiv/pack-mrl.mkiv
+++ b/tex/context/base/mkiv/pack-mrl.mkiv
@@ -56,10 +56,14 @@
\setstrut
\fi\fi
\useblackrulesstyleandcolor\c!style\c!color
- \vrule
- \ifx\p_width \v!max\s!width \emwidth\else\ifx\p_width \empty\else\s!width \p_width \fi\fi
- \ifx\p_height\v!max\s!height\strutht\else\ifx\p_height\empty\else\s!height\p_height\fi\fi
- \ifx\p_depth \v!max\s!depth \strutdp\else\ifx\p_depth \empty\else\s!depth \p_depth \fi\fi
+ \ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
+ \lastnamedcs
+ \else
+ \vrule
+ \fi
+ \ifx\p_width \v!max\s!width \emwidth\else\ifx\p_width \empty\else\s!width \p_width \fi\fi
+ \ifx\p_height\v!max\s!height\strutht\else\ifx\p_height\empty\else\s!height\p_height\fi\fi
+ \ifx\p_depth \v!max\s!depth \strutdp\else\ifx\p_depth \empty\else\s!depth \p_depth \fi\fi
\egroup}
\setupblackrules
@@ -109,7 +113,7 @@
\scratchdistance\directblackrulesparameter\c!distance
\scratchcounter \directblackrulesparameter\c!n
\edef\p_alternative{\blackrulesparameter\c!alternative}%
- \ifx\p_alternative\c!b
+ \ifx\p_alternative\c!b % why not just check distance
\ifnum\scratchcounter=\plusone
\scratchdistance\zeropoint
\else
@@ -117,15 +121,34 @@
\fi
\fi
\useblackrulesstyleandcolor\c!style\c!color
+ \edef\brule
+ {\ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
+ \lastnamedcs
+ \else
+ \vrule
+ \fi}%
\dorecurse\scratchcounter % a typical case of where we can use a simple loop
- {\vrule
+ {\brule
\s!width \scratchwidth
\s!height\scratchheight
\s!depth \scratchdepth
- \hskip\scratchdistance}%
+ \ifzeropt\scratchdistance\else
+ \hskip\scratchdistance
+ \fi}%
\unskip
\egroup}
+\installcorenamespace{blackruletype}
+
+\setvalue{\??blackruletype mp}%
+ {\frule
+ type {mp}%
+ data {\includeMPgraphic{\directblackrulesparameter\c!mp}}}
+
+\letvalue{\??blackruletype\s!no }\novrule
+%letvalue{\??blackruletype\s!yes}\vrule
+
+
\setupblackrules
[\c!n=3,
\c!alternative=\c!a,
diff --git a/tex/context/base/mkiv/pack-obj.lua b/tex/context/base/mkiv/pack-obj.lua
index 8a1af2b70..cba0dcf8f 100644
--- a/tex/context/base/mkiv/pack-obj.lua
+++ b/tex/context/base/mkiv/pack-obj.lua
@@ -25,7 +25,6 @@ local setbox = nuts.setbox
local new_latelua = nuts.pool.latelua
local settexdimen = tokens.setters.dimen
-local settexcount = tokens.setters.count
local gettexbox = tokens.getters.box
local gettexdimen = tokens.getters.dimen
diff --git a/tex/context/base/mkiv/page-cst.lua b/tex/context/base/mkiv/page-cst.lua
index 782bbebfc..f27c4bf31 100644
--- a/tex/context/base/mkiv/page-cst.lua
+++ b/tex/context/base/mkiv/page-cst.lua
@@ -24,7 +24,6 @@ local setmetatableindex = table.setmetatableindex
local properties = nodes.properties
local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
local rulecodes = nodes.rulecodes
local hlist_code = nodecodes.hlist
@@ -32,24 +31,16 @@ local vlist_code = nodecodes.vlist
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
-local insert_code = nodecodes.ins
-local mark_code = nodecodes.mark
local rule_code = nodecodes.rule
-local topskip_code = gluecodes.topskip
-local lineskip_code = gluecodes.lineskip
-local baselineskip_code = gluecodes.baselineskip
-local userskip_code = gluecodes.userskip
-
local nuts = nodes.nuts
local tonode = nuts.tonode
local tonut = nuts.tonut
local hpack = nuts.hpack
local vpack = nuts.vpack
-local freenode = nuts.free
local flushlist = nuts.flush_list
-local removenode = nuts.remove
+----- removenode = nuts.remove
local getfield = nuts.getfield
local setfield = nuts.setfield
@@ -84,9 +75,7 @@ local theprop = nuts.theprop
local nodepool = nuts.pool
-local new_hlist = nodepool.hlist
local new_vlist = nodepool.vlist
-local new_kern = nodepool.kern
local new_trace_rule = nodepool.rule
local new_empty_rule = nodepool.emptyrule
@@ -99,13 +88,11 @@ local v_fixed = variables.fixed
local v_top = variables.top
local v_bottom = variables.bottom
local v_repeat = variables["repeat"]
-local v_left = variables.left
-local v_right = variables.right
local v_yes = variables.yes
local v_page = variables.page
local v_first = variables.first
local v_last = variables.last
-local v_wide = variables.wide
+----- v_wide = variables.wide
pagebuilders = pagebuilders or { } -- todo: pages.builders
pagebuilders.columnsets = pagebuilders.columnsets or { }
diff --git a/tex/context/base/mkiv/page-flt.lua b/tex/context/base/mkiv/page-flt.lua
index caa8d490d..53780e420 100644
--- a/tex/context/base/mkiv/page-flt.lua
+++ b/tex/context/base/mkiv/page-flt.lua
@@ -21,11 +21,8 @@ local C, S, P, lpegmatch = lpeg.C, lpeg.S, lpeg.P, lpeg.match
-- we use floatbox, floatwidth, floatheight
-- text page leftpage rightpage (todo: top, bottom, margin, order)
-local flush_node_list = node.flush_list
-
local setdimen = tex.setdimen
local setcount = tex.setcount
-local texgetbox = tex.getbox
local texsetbox = tex.setbox
local textakebox = nodes.takebox
diff --git a/tex/context/base/mkiv/page-inj.lua b/tex/context/base/mkiv/page-inj.lua
index fd66ead08..d3548b4fb 100644
--- a/tex/context/base/mkiv/page-inj.lua
+++ b/tex/context/base/mkiv/page-inj.lua
@@ -22,7 +22,6 @@ local variables = interfaces.variables
local texsetcount = tex.setcount
-local v_yes = variables.yes
local v_previous = variables.previous
local v_next = variables.next
diff --git a/tex/context/base/mkiv/page-ins.lua b/tex/context/base/mkiv/page-ins.lua
index 235f586c6..4791bc69b 100644
--- a/tex/context/base/mkiv/page-ins.lua
+++ b/tex/context/base/mkiv/page-ins.lua
@@ -12,8 +12,6 @@ structures = structures or { }
structures.inserts = structures.inserts or { }
local inserts = structures.inserts
-local report_inserts = logs.reporter("inserts")
-
local allocate = utilities.storage.allocate
inserts.stored = inserts.stored or allocate { } -- combining them in one is inefficient in the
@@ -21,10 +19,6 @@ inserts.data = inserts.data or allocate { } -- bytecode storage pool
local variables = interfaces.variables
local v_page = variables.page
-local v_columns = variables.columns
-local v_firstcolumn = variables.firstcolumn
-local v_lastcolumn = variables.lastcolumn
-local v_text = variables.text
local context = context
local implement = interfaces.implement
diff --git a/tex/context/base/mkiv/page-lin.lua b/tex/context/base/mkiv/page-lin.lua
index 5b18d9823..d6369c432 100644
--- a/tex/context/base/mkiv/page-lin.lua
+++ b/tex/context/base/mkiv/page-lin.lua
@@ -50,10 +50,8 @@ local listcodes = nodes.listcodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local whatsit_code = nodecodes.whatsit
-local glue_code = nodecodes.glue
local glyph_code = nodecodes.glyph
local line_code = listcodes.line
-local leftskip_code = skipcodes.leftskip
local a_displaymath = attributes.private('displaymath')
local a_linenumber = attributes.private('linenumber')
@@ -83,17 +81,12 @@ local setfield = nuts.setfield
local traverse_id = nuts.traverse_id
local traverse = nuts.traverse
local copy_node = nuts.copy
-local hpack_nodes = nuts.hpack
-local linked_nodes = nuts.linked
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+----- hpack_nodes = nuts.hpack
local is_display_math = nuts.is_display_math
local leftmarginwidth = nuts.leftmarginwidth
-local nodepool = nuts.pool
-local negated_glue = nodepool.negatedglue
-local new_hlist = nodepool.hlist
-local new_kern = nodepool.kern
+----- nodepool = nuts.pool
+----- new_kern = nodepool.kern
local ctx_convertnumber = context.convertnumber
local ctx_makelinenumber = context.makelinenumber
diff --git a/tex/context/base/mkiv/page-mix.lua b/tex/context/base/mkiv/page-mix.lua
index c844bd32d..7a3b4877d 100644
--- a/tex/context/base/mkiv/page-mix.lua
+++ b/tex/context/base/mkiv/page-mix.lua
@@ -23,7 +23,6 @@ local trace_detail = false trackers.register("mixedcolumns.detail", function(v)
local report_state = logs.reporter("mixed columns")
local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
@@ -34,14 +33,8 @@ local insert_code = nodecodes.ins
local mark_code = nodecodes.mark
local rule_code = nodecodes.rule
-local topskip_code = gluecodes.topskip
-local lineskip_code = gluecodes.lineskip
-local baselineskip_code = gluecodes.baselineskip
-local userskip_code = gluecodes.userskip
-
local nuts = nodes.nuts
local tonode = nuts.tonode
-local nodetostring = nuts.tostring
local listtoutf = nodes.listtoutf
local hpack = nuts.hpack
@@ -83,12 +76,7 @@ local variables = interfaces.variables
local v_yes = variables.yes
local v_global = variables["global"]
local v_local = variables["local"]
-local v_columns = variables.columns
-local v_fixed = variables.fixed
-local v_auto = variables.auto
local v_none = variables.none
-local v_more = variables.more
-local v_less = variables.less
local v_halfline = variables.halfline
local context = context
@@ -680,8 +668,6 @@ local kept = head
backtracked = false
- -- print("process",nodetostring(current))
-
if id == hlist_code or id == vlist_code then
if process_list(current,nxt) then break end
elseif id == glue_code then
@@ -696,10 +682,7 @@ local kept = head
end
if backtracked then
- -- print("pickup",nodetostring(current))
nxt = current
- else
- -- print("move on",nodetostring(current))
end
if nxt then
diff --git a/tex/context/base/mkiv/page-str.lua b/tex/context/base/mkiv/page-str.lua
index b2f597633..164fc7051 100644
--- a/tex/context/base/mkiv/page-str.lua
+++ b/tex/context/base/mkiv/page-str.lua
@@ -14,26 +14,17 @@ local concat, insert, remove = table.concat, table.insert, table.remove
local nodes, node = nodes, node
-local nodepool = nodes.pool
local tasks = nodes.tasks
local implement = interfaces.implement
-local new_kern = nodepool.kern
-local new_glyph = nodepool.glyph
-
local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local glue_code = nodecodes.glue
local slide_nodelist = node.slide
local write_node = node.write
local free_node = node.free
local copy_nodelist = node.copy_list
local vpack_nodelist = node.vpack
-local hpack_nodelist = node.hpack
local settings_to_array = utilities.parsers.settings_to_array
@@ -173,16 +164,6 @@ function streams.synchronize(list) -- this is an experiment !
local dana = data[name]
local slot = dana[m]
if slot then
--- for n in nodes.traverse(slot) do
--- local id = n.id
--- if id == hlist_code or id == vlist_code then
--- print(n,n.height,n.depth)
--- elseif id == glue_code then
--- print(n,n.width,gluecodes[n.subtype])
--- else
--- print(n)
--- end
--- end
local vbox = vpack_nodelist(slot)
local ht, dp = vbox.height, vbox.depth
if ht > height then
diff --git a/tex/context/base/mkiv/publ-aut.lua b/tex/context/base/mkiv/publ-aut.lua
index 5ed25f288..b434872f3 100644
--- a/tex/context/base/mkiv/publ-aut.lua
+++ b/tex/context/base/mkiv/publ-aut.lua
@@ -15,7 +15,6 @@ local lpeg = lpeg
local type, next, tostring = type, next, tostring
local concat = table.concat
-local utfchar = utf.char
local utfsub = utf.sub
local formatters = string.formatters
@@ -27,7 +26,6 @@ local context = context
----- commands = commands
local implement = interfaces.implement
-local ctx_setmacro = interfaces.setmacro
local publications = publications
@@ -347,7 +345,6 @@ local currentauthorsymbol = nil
local manipulators = typesetters.manipulators
local splitmanipulation = manipulators.splitspecification
local applymanipulation = manipulators.applyspecification
-local manipulatormethods = manipulators.methods
local function value(i,field)
if currentauthordata then
diff --git a/tex/context/base/mkiv/publ-dat.lua b/tex/context/base/mkiv/publ-dat.lua
index b9c43ac44..98bff25e6 100644
--- a/tex/context/base/mkiv/publ-dat.lua
+++ b/tex/context/base/mkiv/publ-dat.lua
@@ -22,9 +22,6 @@ if not characters then
dofile(resolvers.findfile("char-tex.lua"))
end
-local chardata = characters.data
-local lowercase = characters.lower
-
local lower, find, sub = string.lower, string.find, string.sub
local concat, copy, tohash = table.concat, table.copy, table.tohash
local next, type, rawget = next, type, rawget
@@ -191,8 +188,7 @@ local defaultshortcuts = allocate {
local space = p_whitespace^0
local separator = space * "+" * space
-local l_splitter = lpeg.tsplitat(separator)
-local d_splitter = lpeg.splitat (separator)
+local p_splitter = lpeg.tsplitat(separator)
local unknownfield = function(t,k)
local v = "extra"
@@ -323,7 +319,7 @@ function publications.parenttag(dataset,tag)
if not dataset or not tag then
report("error in specification, dataset %a, tag %a",dataset,tag)
elseif find(tag,"%+") then
- local tags = lpegmatch(l_splitter,tag)
+ local tags = lpegmatch(p_splitter,tag)
local parent = tags[1]
local current = datasets[dataset]
local luadata = current.luadata
diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua
index c30f780f1..86dc6cea2 100644
--- a/tex/context/base/mkiv/publ-ini.lua
+++ b/tex/context/base/mkiv/publ-ini.lua
@@ -24,7 +24,6 @@ if not modules then modules = { } end modules ['publ-ini'] = {
local next, rawget, type, tostring, tonumber = next, rawget, type, tostring, tonumber
local match, find, gsub = string.match, string.find, string.gsub
local concat, sort, tohash = table.concat, table.sort, table.tohash
-local utfsub = utf.sub
local mod = math.mod
local formatters = string.formatters
local allocate = utilities.storage.allocate
@@ -38,7 +37,6 @@ local upper = utf.upper
local report = logs.reporter("publications")
local report_cite = logs.reporter("publications","cite")
local report_list = logs.reporter("publications","list")
-local report_reference = logs.reporter("publications","reference")
local report_suffix = logs.reporter("publications","suffix")
local trace = false trackers.register("publications", function(v) trace = v end)
@@ -72,8 +70,6 @@ local v_yes = variables.yes
local v_no = variables.no
local v_all = variables.all
local v_always = variables.always
-local v_hidden = variables.hidden
-local v_list = variables.list
local v_text = variables.text
local v_doublesided = variables.doublesided
local v_default = variables.default
@@ -81,8 +77,6 @@ local v_dataset = variables.dataset
local conditionals = tex.conditionals
-local numbertochar = converters.characters
-
local logsnewline = logs.newline
local logspushtarget = logs.pushtarget
local logspoptarget = logs.poptarget
@@ -108,19 +102,16 @@ manipulatormethods.WORDS = converters.WORDS
local context = context
local commands = commands
local implement = interfaces.implement
-local ctx_setmacro = interfaces.setmacro
local ctx_doifelse = commands.doifelse
local ctx_doif = commands.doif
local ctx_doifnot = commands.doifnot
local ctx_gobbletwoarguments = context.gobbletwoarguments
-local ctx_btxdirectlink = context.btxdirectlink
local ctx_btxhandlelistentry = context.btxhandlelistentry
local ctx_btxhandlelisttextentry = context.btxhandlelisttextentry
local ctx_btxhandlecombientry = context.btxhandlecombientry
local ctx_btxchecklistentry = context.btxchecklistentry
-local ctx_btxchecklistcombi = context.btxchecklistcombi
local ctx_btxsetdataset = context.btxsetdataset
local ctx_btxsettag = context.btxsettag
@@ -142,10 +133,8 @@ local ctx_btxsetrighttext = context.btxsetrighttext
local ctx_btxsetbefore = context.btxsetbefore
local ctx_btxsetafter = context.btxsetafter
local ctx_btxsetbacklink = context.btxsetbacklink
-local ctx_btxsetbacktrace = context.btxsetbacktrace
local ctx_btxsetcount = context.btxsetcount
local ctx_btxsetconcat = context.btxsetconcat
-local ctx_btxsetoveflow = context.btxsetoverflow
local ctx_btxsetfirstpage = context.btxsetfirstpage
local ctx_btxsetlastpage = context.btxsetlastpage
local ctx_btxsetfirstinternal = context.btxsetfirstinternal
diff --git a/tex/context/base/mkiv/publ-reg.lua b/tex/context/base/mkiv/publ-reg.lua
index 3f276b49a..b40fbc80a 100644
--- a/tex/context/base/mkiv/publ-reg.lua
+++ b/tex/context/base/mkiv/publ-reg.lua
@@ -9,7 +9,6 @@ if not modules then modules = { } end modules ['publ-reg'] = {
local formatters = string.formatters
local concat = table.concat
local sortedhash = table.sortedhash
-local lpegmatch = lpeg.match
local context = context
@@ -135,7 +134,6 @@ implement {
local ctx_dosetfastregisterentry = context.dosetfastregisterentry -- register entry key
------ p_keywords = lpeg.tsplitat(lpeg.patterns.whitespace^0 * lpeg.P(";") * lpeg.patterns.whitespace^0)
local components = publications.components.author
local f_author = formatters[ [[\btxindexedauthor{%s}{%s}{%s}{%s}{%s}{%s}]] ]
diff --git a/tex/context/base/mkiv/publ-tra.lua b/tex/context/base/mkiv/publ-tra.lua
index 4b03307ac..12bf7bf63 100644
--- a/tex/context/base/mkiv/publ-tra.lua
+++ b/tex/context/base/mkiv/publ-tra.lua
@@ -42,7 +42,6 @@ local ctx_monobold = ctx_formatted.monobold
local ctx_verbatim = ctx_formatted.verbatim
local ctx_rotate = context.rotate
-local ctx_llap = context.llap
local ctx_rlap = context.rlap
local ctx_page = context.page
@@ -102,9 +101,6 @@ function tracers.showdatasetcompleteness(settings)
local fielddata = specification and specifications[specification] or specifications.apa
local categories = fielddata.categories
- -- local lpegmatch = lpeg.match
- -- local texescape = lpeg.patterns.texescape
-
local preamble = { "|lTBw(5em)|lBTp(10em)|plT|" }
local function identified(tag,category,crossref,index)
diff --git a/tex/context/base/mkiv/scrp-cjk.lua b/tex/context/base/mkiv/scrp-cjk.lua
index 77c58b18a..689754df1 100644
--- a/tex/context/base/mkiv/scrp-cjk.lua
+++ b/tex/context/base/mkiv/scrp-cjk.lua
@@ -14,8 +14,6 @@ if not modules then modules = { } end modules ['scrp-cjk'] = {
-- sense either because otherwise a wanted space at the end of a
-- line would have to be a hard coded ones.
-local utfchar = utf.getchar
-
local nuts = nodes.nuts
local tonut = nodes.tonut
local tonode = nodes.tonode
@@ -59,7 +57,6 @@ local hash = scripts.hash
local numbertodataset = scripts.numbertodataset
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local quaddata = fonthashes.quads
local spacedata = fonthashes.spaces
diff --git a/tex/context/base/mkiv/spac-adj.lua b/tex/context/base/mkiv/spac-adj.lua
index cdf9b5051..bebc15b88 100644
--- a/tex/context/base/mkiv/spac-adj.lua
+++ b/tex/context/base/mkiv/spac-adj.lua
@@ -17,7 +17,6 @@ local vlist_code = nodecodes.vlist
local remove_node = nodes.remove
local hpack_node = node.hpack
-local vpack_node = node.vpack
function nodes.handlers.graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only
if groupcode == "" then -- mvl only
diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua
index 97b32c366..1fde2348c 100644
--- a/tex/context/base/mkiv/spac-chr.lua
+++ b/tex/context/base/mkiv/spac-chr.lua
@@ -46,7 +46,6 @@ local setcolor = nodes.tracers.colors.set
local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
local remove_node = nuts.remove
-local copy_node_list = nuts.copy_list
local traverse_id = nuts.traverse_id
local tasks = nodes.tasks
@@ -60,7 +59,6 @@ local new_rule = nodepool.rule
local nodecodes = nodes.nodecodes
local skipcodes = nodes.skipcodes
local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
local space_skip_code = skipcodes["spaceskip"]
diff --git a/tex/context/base/mkiv/spac-hor.lua b/tex/context/base/mkiv/spac-hor.lua
index 5d5a43e31..17b104459 100644
--- a/tex/context/base/mkiv/spac-hor.lua
+++ b/tex/context/base/mkiv/spac-hor.lua
@@ -6,7 +6,6 @@ if not modules then modules = { } end modules ['spac-hor'] = {
license = "see context related readme files"
}
-local utfbyte = utf.byte
local lpegmatch, P, C = lpeg.match, lpeg.P, lpeg.C
local context = context
diff --git a/tex/context/base/mkiv/spac-prf.lua b/tex/context/base/mkiv/spac-prf.lua
index 39d90794c..d2fc5860d 100644
--- a/tex/context/base/mkiv/spac-prf.lua
+++ b/tex/context/base/mkiv/spac-prf.lua
@@ -34,13 +34,9 @@ local leaders_code = gluecodes.leaders
local lineskip_code = gluecodes.lineskip
local baselineskip_code = gluecodes.baselineskip
local line_code = listcodes.line
-local parskip_code = listcodes.parskip
local texlists = tex.lists
-local gettexdimen = tex.getdimen
local settexattribute = tex.setattribute
-local settexbox = tex.setbox
-local taketexbox = tex.takebox
local nuts = nodes.nuts
local tonut = nodes.tonut
@@ -60,6 +56,9 @@ local setlink = nuts.setlink
local setlist = nuts.setlist
local setattr = nuts.setattr
+local properties = nodes.properties.data
+local setprop = nuts.setprop
+local getprop = nuts.getprop
local theprop = nuts.theprop
local floor = math.floor
@@ -69,16 +68,13 @@ local new_rule = nuts.pool.rule
local new_glue = nuts.pool.glue
local new_kern = nuts.pool.kern
local hpack_nodes = nuts.hpack
-local link_nodes = nuts.link
local find_node_tail = nuts.tail
local setglue = nuts.setglue
-local properties = nodes.properties.data
-
local a_visual = attributes.private("visual")
local a_snapmethod = attributes.private("snapmethod")
local a_profilemethod = attributes.private("profilemethod")
-local a_specialcontent = attributes.private("specialcontent")
+----- a_specialcontent = attributes.private("specialcontent")
local variables = interfaces.variables
local v_none = variables.none
@@ -203,7 +199,8 @@ local function getprofile(line,step)
-- we could do a nested check .. but then we need to push / pop glue
local shift = getfield(current,"shift")
wd = getfield(current,"width")
- if getattr(current,a_specialcontent) then
+ -- if getattr(current,a_specialcontent) then
+ if getprop(current,"specialcontent") then
-- like a margin note, maybe check for wd
ht = 0
dp = 0
@@ -887,12 +884,12 @@ function profiling.profilebox(specification)
end
-local ignore = table.tohash {
- "split_keep",
- "split_off",
- -- "vbox",
-}
-
+-- local ignore = table.tohash {
+-- "split_keep",
+-- "split_off",
+-- -- "vbox",
+-- }
+--
-- function profiling.vboxhandler(head,where)
-- if head and not ignore[where] then
-- local h = tonut(head)
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index e81e8b81d..d31067a25 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -70,20 +70,16 @@ local report_vspacing = logs.reporter("vspacing","spacing")
local report_collapser = logs.reporter("vspacing","collapsing")
local report_snapper = logs.reporter("vspacing","snapping")
local report_specials = logs.reporter("vspacing","specials")
-local report_page_builder = logs.reporter("builders","page")
local a_skipcategory = attributes.private('skipcategory')
local a_skippenalty = attributes.private('skippenalty')
local a_skiporder = attributes.private('skiporder')
------ snap_category = attributes.private('snapcategory')
local a_snapmethod = attributes.private('snapmethod')
local a_snapvbox = attributes.private('snapvbox')
-local a_profilemethod = attributes.private("profilemethod")
local nuts = nodes.nuts
local tonode = nuts.tonode
local tonut = nuts.tonut
-local ntostring = nuts.tostring
local getfield = nuts.getfield
local setfield = nuts.setfield
@@ -100,7 +96,6 @@ local getbox = nuts.getbox
local find_node_tail = nuts.tail
local free_node = nuts.free
-local free_node_list = nuts.flush_list
local traverse_nodes = nuts.traverse
local traverse_nodes_id = nuts.traverse_id
local insert_node_before = nuts.insert_before
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 29fb1aba8..ddb38919f 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 30714b82e..90f58f8d4 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/strc-bkm.lua b/tex/context/base/mkiv/strc-bkm.lua
index a055a97a1..9ec6734e8 100644
--- a/tex/context/base/mkiv/strc-bkm.lua
+++ b/tex/context/base/mkiv/strc-bkm.lua
@@ -18,7 +18,6 @@ if not modules then modules = { } end modules ['strc-bkm'] = {
local next, type = next, type
local gsub, lower = string.gsub, string.lower
local concat = table.concat
-local utfvalues = utf.values
local settings_to_hash = utilities.parsers.settings_to_hash
local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end)
diff --git a/tex/context/base/mkiv/strc-doc.lua b/tex/context/base/mkiv/strc-doc.lua
index 885e2de0b..105e5ad8d 100644
--- a/tex/context/base/mkiv/strc-doc.lua
+++ b/tex/context/base/mkiv/strc-doc.lua
@@ -37,7 +37,6 @@ local v_auto = variables.auto
local v_strict = variables.strict
local v_all = variables.all
local v_positive = variables.positive
-local v_by = variables.by
local trace_sectioning = false trackers.register("structures.sectioning", function(v) trace_sectioning = v end)
local trace_detail = false trackers.register("structures.detail", function(v) trace_detail = v end)
@@ -64,8 +63,6 @@ local strippedprocessor = processors.stripped
local convertnumber = converters.convert
-local a_internal = attributes.private('internal')
-
local ctx_convertnumber = context.convertnumber
local ctx_sprint = context.sprint
local ctx_finalizeauto = context.finalizeautostructurelevel
@@ -327,7 +324,7 @@ function sections.setentry(given)
local mappedlevel = levelmap[givenname]
local newdepth = tonumber(mappedlevel or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
local resetset = directives and directives.resetset or ""
- -- local resetter = sets.getall("structure:resets",data.block,resetset)
+ -- local resetter = sets.getall("structure:resets",data.block,resetset)
-- a trick to permit userdata to overload title, ownnumber and reference
-- normally these are passed as argument but nowadays we provide several
-- interfaces (we need this because we want to be compatible)
diff --git a/tex/context/base/mkiv/strc-lev.lua b/tex/context/base/mkiv/strc-lev.lua
index ec5dcf6f0..1d60e3a8f 100644
--- a/tex/context/base/mkiv/strc-lev.lua
+++ b/tex/context/base/mkiv/strc-lev.lua
@@ -16,7 +16,6 @@ local sections = structures.sections
local implement = interfaces.implement
local v_default = interfaces.variables.default
-local v_auto = interfaces.variables.auto
sections.levels = sections.levels or { }
diff --git a/tex/context/base/mkiv/strc-lst.lua b/tex/context/base/mkiv/strc-lst.lua
index 0f5d8e0d7..be8e07112 100644
--- a/tex/context/base/mkiv/strc-lst.lua
+++ b/tex/context/base/mkiv/strc-lst.lua
@@ -83,12 +83,10 @@ local variables = interfaces.variables
local v_all = variables.all
local v_reference = variables.reference
local v_title = variables.title
-local v_number = variables.reference
local v_command = variables.command
local v_text = variables.text
local v_current = variables.current
local v_previous = variables.previous
-local v_next = variables.next
local v_intro = variables.intro
local v_here = variables.here
local v_component = variables.component
diff --git a/tex/context/base/mkiv/strc-num.lua b/tex/context/base/mkiv/strc-num.lua
index 0203334ff..8b5230b65 100644
--- a/tex/context/base/mkiv/strc-num.lua
+++ b/tex/context/base/mkiv/strc-num.lua
@@ -38,9 +38,6 @@ local v_previous = variables.previous
local v_prev = variables.prev
local v_last = variables.last
----- v_no = variables.no
-local v_backward = variables.backward
-local v_forward = variables.forward
------ v_subs = variables.subs or "subs"
-- states: start stop none reset
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index 70d79dc57..4cb74095b 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -44,10 +44,6 @@ local report_importing = logs.reporter("references","importing")
local report_empty = logs.reporter("references","empty")
local variables = interfaces.variables
-local v_default = variables.default
-local v_url = variables.url
-local v_file = variables.file
-local v_unknown = variables.unknown
local v_page = variables.page
local v_auto = variables.auto
local v_yes = variables.yes
@@ -127,20 +123,18 @@ local componentsplitter = references.componentsplitter
local currentreference = nil
local txtcatcodes = catcodes.numbers.txtcatcodes -- or just use "txtcatcodes"
-local context_delayed = context.delayed
-
-local ctx_pushcatcodes = context.pushcatcodes
-local ctx_popcatcodes = context.popcatcodes
-local ctx_dofinishreference = context.dofinishreference
-local ctx_dofromurldescription = context.dofromurldescription
-local ctx_dofromurlliteral = context.dofromurlliteral
-local ctx_dofromfiledescription = context.dofromfiledescription
-local ctx_dofromfileliteral = context.dofromfileliteral
-local ctx_expandreferenceoperation = context.expandreferenceoperation
-local ctx_expandreferencearguments = context.expandreferencearguments
-local ctx_getreferencestructureprefix = context.getreferencestructureprefix
-local ctx_convertnumber = context.convertnumber
-local ctx_emptyreference = context.emptyreference
+
+local ctx_pushcatcodes = context.pushcatcodes
+local ctx_popcatcodes = context.popcatcodes
+local ctx_dofinishreference = context.dofinishreference
+local ctx_dofromurldescription = context.dofromurldescription
+local ctx_dofromurlliteral = context.dofromurlliteral
+local ctx_dofromfiledescription = context.dofromfiledescription
+local ctx_dofromfileliteral = context.dofromfileliteral
+local ctx_expandreferenceoperation = context.expandreferenceoperation
+local ctx_expandreferencearguments = context.expandreferencearguments
+local ctx_convertnumber = context.convertnumber
+local ctx_emptyreference = context.emptyreference
storage.register("structures/references/defined", references.defined, "structures.references.defined")
@@ -790,10 +784,6 @@ implement {
-- shared by urls and files
--- function references.whatfrom(name)
--- context((urldata[name] and v_url) or (filedata[name] and v_file) or v_unknown)
--- end
-
function references.from(name)
local u = urldata[name]
if u then
diff --git a/tex/context/base/mkiv/strc-reg.lua b/tex/context/base/mkiv/strc-reg.lua
index 66c264a49..e0a49115c 100644
--- a/tex/context/base/mkiv/strc-reg.lua
+++ b/tex/context/base/mkiv/strc-reg.lua
@@ -9,7 +9,6 @@ if not modules then modules = { } end modules ['strc-reg'] = {
local next, type = next, type
local format, gmatch = string.format, string.gmatch
local equal, concat, remove = table.are_equal, table.concat, table.remove
-local utfchar = utf.char
local lpegmatch = lpeg.match
local allocate = utilities.storage.allocate
@@ -43,7 +42,6 @@ local v_yes = variables.yes
local v_packed = variables.packed
local v_current = variables.current
local v_previous = variables.previous
-local v_next = variables.next
local v_first = variables.first
local v_last = variables.last
local v_text = variables.text
@@ -64,9 +62,6 @@ local internalreferences = references.internals
local setinternalreference = references.setinternalreference
local setmetatableindex = table.setmetatableindex
-local texsetattribute = tex.setattribute
-
-local a_destination = attributes.private('destination')
local absmaxlevel = 5 -- \c_strc_registers_maxlevel
diff --git a/tex/context/base/mkiv/strc-syn.lua b/tex/context/base/mkiv/strc-syn.lua
index 5f3557a69..ecc5e19ae 100644
--- a/tex/context/base/mkiv/strc-syn.lua
+++ b/tex/context/base/mkiv/strc-syn.lua
@@ -227,7 +227,6 @@ function synonyms.flush(data,options)
local result = data.result
for i=1,#result do
local sublist = result[i]
- local letter = sublist.tag
local data = sublist.data
for d=1,#data do
local entry = data[d].definition
diff --git a/tex/context/base/mkiv/supp-box.lua b/tex/context/base/mkiv/supp-box.lua
index d3a4f57e5..98d0e0474 100644
--- a/tex/context/base/mkiv/supp-box.lua
+++ b/tex/context/base/mkiv/supp-box.lua
@@ -18,15 +18,12 @@ local nodes = nodes
local implement = interfaces.implement
-local splitstring = string.split
-
local nodecodes = nodes.nodecodes
local disc_code = nodecodes.disc
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local glue_code = nodecodes.glue
-local kern_code = nodecodes.kern
local glyph_code = nodecodes.glyph
local nuts = nodes.nuts
@@ -64,8 +61,6 @@ local nodepool = nuts.pool
local new_penalty = nodepool.penalty
local new_hlist = nodepool.hlist
local new_glue = nodepool.glue
-local new_rule = nodepool.rule
-local new_kern = nodepool.kern
local setlistcolor = nodes.tracers.colors.setlist
@@ -101,7 +96,6 @@ local function hyphenatedlist(head,usecolor)
flush_list(replace)
setfield(current,"replace",nil)
end
- -- setfield(current,"replace",new_rule(65536)) -- new_kern(65536*2))
setboth(current)
local list = link_nodes (
pre and new_penalty(10000),
diff --git a/tex/context/base/mkiv/syst-lua.lua b/tex/context/base/mkiv/syst-lua.lua
index 422f57a00..0cbcd6988 100644
--- a/tex/context/base/mkiv/syst-lua.lua
+++ b/tex/context/base/mkiv/syst-lua.lua
@@ -19,7 +19,7 @@ local implement = interfaces.implement
local two_strings = interfaces.strings[2]
local context = context
-local csprint = context.sprint
+----- csprint = context.sprint
local prtcatcodes = tex.prtcatcodes
@@ -42,20 +42,20 @@ local ctx_gobbleoneargument = context.gobbleoneargument -- context.constru
function commands.doifelse(b)
if b then
ctx_firstoftwoarguments()
--- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
+ -- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
else
ctx_secondoftwoarguments()
--- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
+ -- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
end
end
function commands.doifelsesomething(b)
if b and b ~= "" then
ctx_firstoftwoarguments()
--- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
+ -- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
else
ctx_secondoftwoarguments()
--- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
+ -- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
end
end
@@ -72,30 +72,30 @@ end
function commands.doifsomething(b)
if b and b ~= "" then
ctx_firstofoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
+ -- context.__flushdirect(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
else
ctx_gobbleoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
+ -- context.__flushdirect(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
end
end
function commands.doifnot(b)
if b then
ctx_gobbleoneargument()
--- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
+ -- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
else
ctx_firstofoneargument()
--- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
+ -- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
end
end
function commands.doifnotthing(b)
if b and b ~= "" then
ctx_gobbleoneargument()
--- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
+ -- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
else
ctx_firstofoneargument()
--- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
+ -- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
end
end
diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua
index 87d5fa121..4eaa29ad3 100644
--- a/tex/context/base/mkiv/tabl-xtb.lua
+++ b/tex/context/base/mkiv/tabl-xtb.lua
@@ -79,7 +79,6 @@ local nodepool = nuts.pool
local new_glue = nodepool.glue
local new_kern = nodepool.kern
-local new_penalty = nodepool.penalty
local new_hlist = nodepool.hlist
local v_stretch = variables.stretch
@@ -89,7 +88,7 @@ local v_height = variables.height
local v_repeat = variables["repeat"]
local v_max = variables.max
local v_fixed = variables.fixed
-local v_auto = variables.auto
+----- v_auto = variables.auto
local v_before = variables.before
local v_after = variables.after
local v_both = variables.both
diff --git a/tex/context/base/mkiv/trac-jus.lua b/tex/context/base/mkiv/trac-jus.lua
index ad1a098e2..dbf2b8d33 100644
--- a/tex/context/base/mkiv/trac-jus.lua
+++ b/tex/context/base/mkiv/trac-jus.lua
@@ -33,9 +33,7 @@ local tracedrule = nodes.tracers.pool.nuts.rule
local nodepool = nuts.pool
-local new_rule = nodepool.rule
local new_hlist = nodepool.hlist
-local new_glue = nodepool.glue
local new_kern = nodepool.kern
local hlist_code = nodes.nodecodes.hlist
diff --git a/tex/context/base/mkiv/trac-log.lua b/tex/context/base/mkiv/trac-log.lua
index 86557ef09..6623e189c 100644
--- a/tex/context/base/mkiv/trac-log.lua
+++ b/tex/context/base/mkiv/trac-log.lua
@@ -793,7 +793,7 @@ end
-- we don't have show_open and show_close callbacks yet
-local report_files = logs.reporter("files")
+----- report_files = logs.reporter("files")
local nesting = 0
local verbose = false
local hasscheme = url.hasscheme
diff --git a/tex/context/base/mkiv/trac-par.lua b/tex/context/base/mkiv/trac-par.lua
index fc3be5b6c..3d8909eb4 100644
--- a/tex/context/base/mkiv/trac-par.lua
+++ b/tex/context/base/mkiv/trac-par.lua
@@ -26,7 +26,6 @@ local nodecodes = nodes.nodecodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local glyph_code = nodecodes.glyph
-local kern_code = nodecodes.kern
local setnodecolor = nodes.tracers.colors.set
local parameters = fonts.hashes.parameters
local basepoints = number.basepoints
diff --git a/tex/context/base/mkiv/trac-set.lua b/tex/context/base/mkiv/trac-set.lua
index 9e2bf8758..d0047650f 100644
--- a/tex/context/base/mkiv/trac-set.lua
+++ b/tex/context/base/mkiv/trac-set.lua
@@ -213,7 +213,6 @@ function setters.list(t) -- pattern
end
function setters.show(t)
- local category = t.name
local list = setters.list(t)
t.report()
for k=1,#list do
diff --git a/tex/context/base/mkiv/trac-tex.lua b/tex/context/base/mkiv/trac-tex.lua
index 86f3b539f..6b0c31c1f 100644
--- a/tex/context/base/mkiv/trac-tex.lua
+++ b/tex/context/base/mkiv/trac-tex.lua
@@ -95,8 +95,6 @@ end
directives.register("system.dumphash", function() dump_hash(false) end)
directives.register("system.dumpdelta", function() dump_hash(true ) end)
-local report_dump = logs.reporter("resolvers","dump")
-
local function saveusedfilesintrees(format)
local data = {
jobname = environment.jobname or "?",
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index 061cef8ba..803bfdde0 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -93,7 +93,6 @@ local getdisc = nuts.getdisc
local hpack_nodes = nuts.hpack
local vpack_nodes = nuts.vpack
-local copy_node = nuts.copy
local copy_list = nuts.copy_list
local free_node = nuts.free
local free_node_list = nuts.flush_list
@@ -123,7 +122,6 @@ local nodepool = nuts.pool
local new_rule = nodepool.rule
local new_kern = nodepool.kern
local new_glue = nodepool.glue
-local new_penalty = nodepool.penalty
local new_hlist = nodepool.hlist
local new_vlist = nodepool.vlist
@@ -605,16 +603,6 @@ local function ruledbox(head,current,vertical,layer,what,simple,previous,trace_o
end
info = new_hlist(info,wd,ht,dp,shift)
end
-
--- how about dir, so maybe just copy the node
---
--- local l = getlist(current)
--- setlist(current,nil)
--- local c = copy_node(current)
--- setlist(current,l)
--- setlist(c,info)
--- info = c
-
if next then
setlink(info,next)
end
@@ -636,13 +624,6 @@ local function ruledbox(head,current,vertical,layer,what,simple,previous,trace_o
end
end
-local bpfactor = number.dimenfactors.bp
-
--- callback.register("process_rule",function(n,h,v)
--- local p = string.formatters["0 0 %0.6F %0.6F re f"](h*bpfactor,v*bpfactor)
--- pdf.print("direct",p)
--- end)
-
local function ruledglyph(head,current,previous)
local wd = getfield(current,"width")
-- local wd = chardata[getfont(current)][getchar(current)].width
diff --git a/tex/context/base/mkiv/typo-brk.lua b/tex/context/base/mkiv/typo-brk.lua
index 106bb4954..66615317b 100644
--- a/tex/context/base/mkiv/typo-brk.lua
+++ b/tex/context/base/mkiv/typo-brk.lua
@@ -79,7 +79,7 @@ local kern_code = nodecodes.kern
local math_code = nodecodes.math
local fontkern_code = kerncodes.fontkern
-local userkern_code = kerncodes.userkern
+----- userkern_code = kerncodes.userkern
local italickern_code = kerncodes.italiccorrection
local typesetters = typesetters
diff --git a/tex/context/base/mkiv/typo-cap.lua b/tex/context/base/mkiv/typo-cap.lua
index 62b90b8ab..a4e221ea1 100644
--- a/tex/context/base/mkiv/typo-cap.lua
+++ b/tex/context/base/mkiv/typo-cap.lua
@@ -37,7 +37,6 @@ local setchar = nuts.setchar
local copy_node = nuts.copy
local end_of_math = nuts.end_of_math
-local traverse_nodes = nuts.traverse
local traverse_id = nuts.traverse_id
local insert_after = nuts.insert_after
@@ -63,7 +62,6 @@ local fontchar = fonthashes.characters
local variables = interfaces.variables
local v_reset = variables.reset
-local chardata = characters.data
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
diff --git a/tex/context/base/mkiv/typo-chr.lua b/tex/context/base/mkiv/typo-chr.lua
index 041a73e1b..ae09db4f8 100644
--- a/tex/context/base/mkiv/typo-chr.lua
+++ b/tex/context/base/mkiv/typo-chr.lua
@@ -90,7 +90,6 @@ local insert, remove = table.insert, table.remove
local nodecodes = nodes.nodecodes
local glyph_code = nodecodes.glyph
-local whatsit_code = nodecodes.whatsit
local localpar_code = nodecodes.localpar
local texnest = tex.nest
diff --git a/tex/context/base/mkiv/typo-dha.lua b/tex/context/base/mkiv/typo-dha.lua
index 25e92bd28..bdba20878 100644
--- a/tex/context/base/mkiv/typo-dha.lua
+++ b/tex/context/base/mkiv/typo-dha.lua
@@ -48,7 +48,6 @@ local report_directions = logs.reporter("typesetting","text directions")
local nuts = nodes.nuts
local tonut = nuts.tonut
local tonode = nuts.tonode
-local nutstring = nuts.tostring
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -77,11 +76,8 @@ local skipcodes = nodes.skipcodes
local glyph_code = nodecodes.glyph
local math_code = nodecodes.math
-local penalty_code = nodecodes.penalty
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
local dir_code = nodecodes.dir
local localpar_code = nodecodes.localpar
@@ -94,7 +90,6 @@ local formatters = string.formatters
local insert = table.insert
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local fontchar = fonthashes.characters
local chardirections = characters.directions
diff --git a/tex/context/base/mkiv/typo-dig.lua b/tex/context/base/mkiv/typo-dig.lua
index 09c2f64ee..076761ad9 100644
--- a/tex/context/base/mkiv/typo-dig.lua
+++ b/tex/context/base/mkiv/typo-dig.lua
@@ -53,9 +53,7 @@ local tasks = nodes.tasks
local new_glue = nodepool.glue
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local chardata = fonthashes.characters
-local quaddata = fonthashes.quads
local v_reset = interfaces.variables.reset
diff --git a/tex/context/base/mkiv/typo-dir.lua b/tex/context/base/mkiv/typo-dir.lua
index 482b7114d..4422a15de 100644
--- a/tex/context/base/mkiv/typo-dir.lua
+++ b/tex/context/base/mkiv/typo-dir.lua
@@ -28,7 +28,6 @@ if not modules then modules = { } end modules ['typo-dir'] = {
local next, type = next, type
local format, insert, sub, find, match = string.format, table.insert, string.sub, string.find, string.match
-local utfchar = utf.char
local formatters = string.formatters
local nodes, node = nodes, node
@@ -38,7 +37,7 @@ local trace_mathdirections = false trackers.register("typesetters.directions.m
local trace_directions = false trackers.register("typesetters.directions", function(v) trace_textdirections = v trace_mathdirections = v end)
local report_textdirections = logs.reporter("typesetting","text directions")
-local report_mathdirections = logs.reporter("typesetting","math directions")
+----- report_mathdirections = logs.reporter("typesetting","math directions")
local hasbit = number.hasbit
diff --git a/tex/context/base/mkiv/typo-drp.lua b/tex/context/base/mkiv/typo-drp.lua
index bddcc008e..fa3081485 100644
--- a/tex/context/base/mkiv/typo-drp.lua
+++ b/tex/context/base/mkiv/typo-drp.lua
@@ -55,7 +55,6 @@ local insert_after = nuts.insert_after
local remove_node = nuts.remove
local traverse_id = nuts.traverse_id
local traverse = nuts.traverse
-local free_node = nuts.free
local variables = interfaces.variables
local v_default = variables.default
diff --git a/tex/context/base/mkiv/typo-dua.lua b/tex/context/base/mkiv/typo-dua.lua
index f697ac562..728fd031b 100644
--- a/tex/context/base/mkiv/typo-dua.lua
+++ b/tex/context/base/mkiv/typo-dua.lua
@@ -69,7 +69,6 @@ local mirrordata = characters.mirrors
local nuts = nodes.nuts
local tonut = nuts.tonut
local tonode = nuts.tonode
-local nutstring = nuts.tostring
local getnext = nuts.getnext
local getid = nuts.getid
diff --git a/tex/context/base/mkiv/typo-dub.lua b/tex/context/base/mkiv/typo-dub.lua
index 7ac339799..7946fe5b3 100644
--- a/tex/context/base/mkiv/typo-dub.lua
+++ b/tex/context/base/mkiv/typo-dub.lua
@@ -57,7 +57,6 @@ local textclassdata = characters.textclasses
local nuts = nodes.nuts
local tonut = nuts.tonut
local tonode = nuts.tonode
-local nutstring = nuts.tostring
local getnext = nuts.getnext
local getid = nuts.getid
@@ -98,12 +97,6 @@ local setcolor = directions.setcolor
local getfences = directions.getfences
local a_directions = attributes.private('directions')
-local a_textbidi = attributes.private('textbidi')
------ a_state = attributes.private('state')
-
------ s_isol = fonts.analyzers.states.isol
-
------ current[a_state] = s_isol -- maybe better have a special bidi attr value -> override (9) -> todo
local remove_controls = true directives.register("typesetters.directions.removecontrols",function(v) remove_controls = v end)
----- analyze_fences = true directives.register("typesetters.directions.analyzefences", function(v) analyze_fences = v end)
diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua
index fce40932f..dfb69bcba 100644
--- a/tex/context/base/mkiv/typo-duc.lua
+++ b/tex/context/base/mkiv/typo-duc.lua
@@ -58,7 +58,6 @@ local textclassdata = characters.textclasses
local nuts = nodes.nuts
local tonut = nuts.tonut
local tonode = nuts.tonode
-local nutstring = nuts.tostring
local getnext = nuts.getnext
local getid = nuts.getid
@@ -101,12 +100,6 @@ local setcolor = directions.setcolor
local getfences = directions.getfences
local a_directions = attributes.private('directions')
-local a_textbidi = attributes.private('textbidi')
------ a_state = attributes.private('state')
-
------ s_isol = fonts.analyzers.states.isol
-
------ current[a_state] = s_isol -- maybe better have a special bidi attr value -> override (9) -> todo
local remove_controls = true directives.register("typesetters.directions.removecontrols",function(v) remove_controls = v end)
----- analyze_fences = true directives.register("typesetters.directions.analyzefences", function(v) analyze_fences = v end)
diff --git a/tex/context/base/mkiv/typo-fln.lua b/tex/context/base/mkiv/typo-fln.lua
index 1e1a2c44a..848c7ccf6 100644
--- a/tex/context/base/mkiv/typo-fln.lua
+++ b/tex/context/base/mkiv/typo-fln.lua
@@ -50,7 +50,6 @@ local free_node_list = nuts.flush_list
local free_node = nuts.flush_node
local copy_node_list = nuts.copy_list
local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
local hpack_node_list = nuts.hpack
local remove_node = nuts.remove
diff --git a/tex/context/base/mkiv/typo-itc.lua b/tex/context/base/mkiv/typo-itc.lua
index ea8103aad..a54098bdf 100644
--- a/tex/context/base/mkiv/typo-itc.lua
+++ b/tex/context/base/mkiv/typo-itc.lua
@@ -6,7 +6,6 @@ if not modules then modules = { } end modules ['typo-itc'] = {
license = "see context related readme files"
}
-local utfchar = utf.char
local trace_italics = false trackers.register("typesetters.italics", function(v) trace_italics = v end)
local report_italics = logs.reporter("nodes","italics")
@@ -47,7 +46,6 @@ local isglyph = nuts.isglyph
local insert_node_after = nuts.insert_after
local delete_node = nuts.delete
local end_of_math = nuts.end_of_math
-local find_tail = nuts.tail
local texgetattribute = tex.getattribute
local texsetattribute = tex.setattribute
diff --git a/tex/context/base/mkiv/typo-krn.lua b/tex/context/base/mkiv/typo-krn.lua
index 7607fc5f5..e6072144b 100644
--- a/tex/context/base/mkiv/typo-krn.lua
+++ b/tex/context/base/mkiv/typo-krn.lua
@@ -10,7 +10,6 @@ if not modules then modules = { } end modules ['typo-krn'] = {
-- components: better split on tounicode
local next, type, tonumber = next, type, tonumber
-local utfchar = utf.char
local nodes = nodes
local fonts = fonts
@@ -82,7 +81,6 @@ local spaceskip_code = skipcodes.spaceskip
local xspaceskip_code = skipcodes.xspaceskip
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local chardata = fonthashes.characters
local quaddata = fonthashes.quads
local markdata = fonthashes.marks
diff --git a/tex/context/base/mkiv/typo-lin.lua b/tex/context/base/mkiv/typo-lin.lua
index a74a635f6..37fff48f7 100644
--- a/tex/context/base/mkiv/typo-lin.lua
+++ b/tex/context/base/mkiv/typo-lin.lua
@@ -65,7 +65,7 @@ local hlist_code = nodecodes.hlist
local glue_code = nodecodes.glue
local kern_code = nodecodes.kern
local line_code = listcodes.line
-local localpar_code = nodecodes.localpar
+----- localpar_code = nodecodes.localpar
local leftskip_code = gluecodes.leftskip
local rightskip_code = gluecodes.rightskip
local parfillskip_code = gluecodes.parfillskip
@@ -95,14 +95,11 @@ local getprop = nuts.rawprop -- getprop
local effectiveglue = nuts.effective_glue
local nodepool = nuts.pool
-local new_glue = nodepool.glue
local new_kern = nodepool.kern
local new_leftskip = nodepool.leftskip
local new_rightskip = nodepool.rightskip
local new_hlist = nodepool.hlist
-local new_vlist = nodepool.vlist
local new_rule = nodepool.rule
-local new_latelua = nodepool.latelua
local texgetcount = tex.getcount
local setmetatableindex = table.setmetatableindex
@@ -372,13 +369,6 @@ function paragraphs.moveinline(n,blob,dx,dy)
end
end
--- local f_anchor = formatters["_plib_.set('md:h',%i,{x=true,c=true})"]
--- local s_anchor = 'md:h'
---
--- local function setanchor(h_anchor)
--- return new_latelua(f_anchor(h_anchor))
--- end
-
local lateluafunction = nodepool.lateluafunction
local setposition = job.positions.set
local t_anchor = { x = true, c = true }
diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua
index cbac9f851..2886c7887 100644
--- a/tex/context/base/mkiv/typo-mar.lua
+++ b/tex/context/base/mkiv/typo-mar.lua
@@ -74,7 +74,7 @@ if not modules then modules = { } end modules ['typo-mar'] = {
-- so far
local format, validstring = string.format, string.valid
-local insert, remove, sortedkeys = table.insert, table.remove, table.sortedkeys
+local insert, remove, sortedkeys, fastcopy = table.insert, table.remove, table.sortedkeys, table.fastcopy
local setmetatable, next = setmetatable, next
local formatters = string.formatters
local toboolean = toboolean
@@ -86,7 +86,7 @@ local trace_margindata = false trackers.register("typesetters.margindata",
local trace_marginstack = false trackers.register("typesetters.margindata.stack", function(v) trace_marginstack = v end)
local trace_margingroup = false trackers.register("typesetters.margindata.group", function(v) trace_margingroup = v end)
-local report_margindata = logs.reporter("typesetters","margindata")
+local report_margindata = logs.reporter("margindata")
local tasks = nodes.tasks
local prependaction = tasks.prependaction
@@ -104,8 +104,6 @@ local v_local = variables["local"]
local v_global = variables["global"]
local v_left = variables.left
local v_right = variables.right
-local v_flushleft = variables.flushleft
-local v_flushright = variables.flushright
local v_inner = variables.inner
local v_outer = variables.outer
local v_margin = variables.margin
@@ -117,9 +115,7 @@ local v_continue = variables.continue
local v_first = variables.first
local v_text = variables.text
local v_paragraph = variables.paragraph
-local v_column = variables.column
local v_line = variables.line
-local v_hanging = variables.hanging
local nuts = nodes.nuts
local nodepool = nuts.pool
@@ -127,12 +123,9 @@ local nodepool = nuts.pool
local tonode = nuts.tonode
local tonut = nuts.tonut
-local copy_node_list = nuts.copy_list
local hpack_nodes = nuts.hpack
local traverse_id = nuts.traverse_id
local free_node_list = nuts.flush_list
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
local linked_nodes = nuts.linked
local getfield = nuts.getfield
@@ -143,10 +136,15 @@ local getid = nuts.getid
local getattr = nuts.getattr
local setattr = nuts.setattr
local getsubtype = nuts.getsubtype
-local getbox = nuts.getbox
local getlist = nuts.getlist
local setlist = nuts.setlist
+local getbox = nuts.getbox
+local takebox = nuts.takebox
+
+local setprop = nuts.setprop
+local getprop = nuts.getprop
+
local nodecodes = nodes.nodecodes
local listcodes = nodes.listcodes
local gluecodes = nodes.gluecodes
@@ -154,25 +152,17 @@ local whatsitcodes = nodes.whatsitcodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local glue_code = nodecodes.glue
-local kern_code = nodecodes.kern
-local penalty_code = nodecodes.penalty
local whatsit_code = nodecodes.whatsit
-local line_code = listcodes.line
-local cell_code = listcodes.cell
-local alignment_code = listcodes.alignment
local userdefined_code = whatsitcodes.userdefined
local nodepool = nuts.pool
-local new_kern = nodepool.kern
local new_usernumber = nodepool.usernumber
-local new_latelua = nodepool.latelua
local lateluafunction = nodepool.lateluafunction
-local texgetcount = tex.getcount
local texgetdimen = tex.getdimen
+----- texgetcount = tex.getcount
local texget = tex.get
local isleftpage = layouts.status.isleftpage
@@ -183,8 +173,7 @@ local addtoline = paragraphs.addtoline
local moveinline = paragraphs.moveinline
local calculatedelta = paragraphs.calculatedelta
-local a_margindata = attributes.private("margindata")
-local a_specialcontent = attributes.private("specialcontent")
+----- a_specialcontent = attributes.private("specialcontent")
local a_linenumber = attributes.private('linenumber')
local inline_mark = nodepool.userids["margins.inline"]
@@ -267,8 +256,9 @@ end
function margins.save(t)
setmetatable(t,defaults)
- local content = getbox(t.number)
-setattr(content,a_specialcontent,1) -- todo: a property
+ local content = takebox(t.number)
+ -- setattr(content,a_specialcontent,1)
+ setprop(content,"specialcontent","margindata")
local location = t.location
local category = t.category
local inline = t.inline
@@ -276,10 +266,6 @@ setattr(content,a_specialcontent,1) -- todo: a property
local name = t.name
local option = t.option
local stack = t.stack
- if stack == v_yes or stack == v_continue then
- inline = false
- t.inline = false
- end
if option then
option = settings_to_hash(option)
t.option = option
@@ -317,6 +303,7 @@ setattr(content,a_specialcontent,1) -- todo: a property
showstore(store,"before",location)
end
if name and name ~= "" then
+ -- this can be used to overload
if inlinestore then -- todo: inline store has to be done differently (not sparse)
local t = sortedkeys(store) for j=#t,1,-1 do local i = t[j]
local si = store[i]
@@ -343,7 +330,7 @@ setattr(content,a_specialcontent,1) -- todo: a property
local rightmargindistance = texgetdimen("naturalrightmargindistance")
local strutbox = getbox("strutbox")
-- better make a new table and make t entry in t
- t.box = copy_node_list(content)
+ t.box = content
t.n = nofsaved
-- used later (we will clean up this natural mess later)
-- nice is to make a special status table mechanism
@@ -388,21 +375,6 @@ end
-- When the prototype inner/outer code that was part of this proved to be
-- okay it was moved elsewhere.
-local status, nofstatus = { }, 0
-
--- local f_anchor = formatters["_plib_.set('md:h',%i,{x=true,c=true})"]
--- local s_anchor = 'md:h'
---
--- local function setanchor(h_anchor)
--- return new_latelua(f_anchor(h_anchor))
--- end
-
--- local t_anchor = { x = true, c = true }
---
--- local function setanchor(h_anchor)
--- return lateluafunction(function() setposition("md:h",h_anchor,t_anchor) end)
--- end
-
local function realign(current,candidate)
local location = candidate.location
local margin = candidate.margin
@@ -420,7 +392,6 @@ local function realign(current,candidate)
local atleft = true
local hmove = 0
local delta = 0
- -- local realpageno = candidate.realpageno
local leftpage = isleftpage(false,true)
local leftdelta = 0
local rightdelta = 0
@@ -489,11 +460,10 @@ local function realign(current,candidate)
moveinline(hook,candidate.node,delta)
end
-local function realigned(current,a)
- local candidate = status[a]
+local function realigned(current,candidate)
realign(current,candidate)
nofdelayed = nofdelayed - 1
- status[a] = nil
+ setprop(current,"margindata",false)
return true
end
@@ -509,36 +479,43 @@ end
local stacked = { } -- left/right keys depending on location
local cache = { }
-
-local function resetstacked()
- stacked = { }
+local anchors = { }
+
+local function resetstacked(location)
+ if location then
+ local s = { }
+ stacked[location] = s
+ anchors[location] = false
+ return s
+ else
+ stacked = { }
+ anchors = { }
+ return stacked
+ end
end
--- resetstacked()
+-- anchors are only set for lines that have a note
-local function ha(tag) -- maybe l/r keys ipv left/right keys
+local function sa(tag) -- maybe l/r keys ipv left/right keys
local p = cache[tag]
+ if trace_marginstack then
+ report_margindata("updating anchor %a",tag)
+ end
p.p = true
p.y = true
+-- p.a = tag
setposition('md:v',tag,p)
cache[tag] = nil
end
-margins.ha = ha
-
-local f_anchor = formatters["typesetters.margins.ha(%s)"]
-
-local function setanchor(v_anchor)
- return new_latelua(f_anchor(v_anchor))
+local function setanchor(v_anchor) -- freezes the global here
+ return lateluafunction(function() sa(v_anchor) end)
end
--- local function setanchor(v_anchor) -- freezes the global here
--- return lateluafunction(function() ha(v_anchor) end)
--- end
-
local function markovershoot(current) -- todo: alleen als offset > line
v_anchors = v_anchors + 1
- cache[v_anchors] = stacked
+ cache[v_anchors] = fastcopy(stacked)
+-- cache[v_anchors] = stacked -- so we adapt the previous too
local anchor = setanchor(v_anchors)
-- local list = hpack_nodes(linked_nodes(anchor,getlist(current))) -- not ok, we need to retain width
local list = hpack_nodes(linked_nodes(anchor,getlist(current)),getfield(current,"width"),"exactly")--
@@ -550,27 +527,66 @@ local function markovershoot(current) -- todo: alleen als offset > line
setlist(current,list)
end
+-- local function getovershoot(location)
+-- local p = getposition("md:v",v_anchors)
+-- local c = getposition("md:v",v_anchors+1)
+-- if p and c and p.p and p.p == c.p then
+-- local distance = p.y - c.y
+-- local offset = p[location] or 0
+-- local overshoot = offset - distance
+-- if trace_marginstack then
+-- report_margindata("location %a, anchor %a, distance %p, offset %p, overshoot %p",location,v_anchors,distance,offset,overshoot)
+-- end
+-- if overshoot > 0 then
+-- return overshoot, offset, distance
+-- else
+-- return 0, offset, distance
+-- end
+-- elseif trace_marginstack then
+-- report_margindata("location %a, anchor %a, nothing to correct",location,v_anchors)
+-- end
+-- return 0, 0, 0
+-- end
+
local function getovershoot(location)
- local p = getposition("md:v",v_anchors)
local c = getposition("md:v",v_anchors+1)
- if p and c and p.p and p.p == c.p then
- local distance = p.y - c.y
- local offset = p[location] or 0
- local overshoot = offset - distance
- if trace_marginstack then
- report_margindata("location %a, anchor %a, distance %p, offset %p, overshoot %p",location,v_anchors,distance,offset,overshoot)
+ if c then
+ local p = false
+ local cp = c.p
+ for i=v_anchors,1,-1 do
+ local pi = getposition("md:v",i)
+ if pi.p == cp then
+ p = pi
+ else
+ break
+ end
end
- if overshoot > 0 then
- return overshoot
+ if p then
+ local distance = p.y - c.y
+ local offset = p[location] or 0
+ local overshoot = offset - distance
+ if trace_marginstack then
+ report_margindata("location %a, anchor %a, distance %p, offset %p, overshoot %p",location,v_anchors,distance,offset,overshoot)
+ end
+ if overshoot > 0 then
+ return overshoot, offset, distance
+ else
+ return 0, offset, distance
+ end
end
- elseif trace_marginstack then
+ end
+ if trace_marginstack then
report_margindata("location %a, anchor %a, nothing to correct",location,v_anchors)
end
- return 0
+ return 0, 0, 0
+end
+
+local function getanchor(location,anchor)
+ return getposition("md:v",anchor)
end
local function inject(parent,head,candidate)
- local box = candidate.box
+ local box = candidate.box
if not box then
return head, nil, false -- we can have empty texts
end
@@ -586,12 +602,11 @@ local function inject(parent,head,candidate)
local baseline = candidate.baseline
local strutheight = candidate.strutheight
local strutdepth = candidate.strutdepth
+ local inline = candidate.inline
local psubtype = getsubtype(parent)
local offset = stacked[location]
local firstonstack = offset == false or offset == nil
- nofstatus = nofstatus + 1
nofdelayed = nofdelayed + 1
- status[nofstatus] = candidate
-- yet untested
baseline = tonumber(baseline)
if not baseline then
@@ -613,6 +628,34 @@ local function inject(parent,head,candidate)
if trace_margindata then
report_margindata("processing, index %s, height %p, depth %p, parent %a, method %a",candidate.n,height,depth,listcodes[psubtype],method)
end
+ -- The next section handles the inline notes that are checked for overlap which
+ -- is somewhat tricky as that mechanism is mostly for paragraph boundnotes.
+ local stackedinline = inline and (stack == v_yes or stack == v_continue)
+ if stackedinline then
+ firstonstack = true
+ if anchors[location] then
+ local a1 = getanchor(location,anchors[location])
+ local a2 = getanchor(location,v_anchors+1)
+ if a1 and a2 and a1.p == a2.p then
+ local distance = a1.y - a2.y
+ if distance > offset then
+ -- report_margindata("location %s, no overlap, case 1",location)
+ elseif offset > 0 then
+ offset = offset - distance
+ firstonstack = false
+ -- report_margindata("location %s, overlap %a",location,offset)
+ -- else
+ -- report_margindata("location %s, no overlap, case 2",location)
+ end
+ -- else
+ -- report_margindata("location %s, no overlap, case 3",location)
+ end
+ -- else
+ -- report_margindata("location %s, no overlap, case 4",location)
+ end
+ anchors[location] = v_anchors + 1
+ end
+ -- end of special section
if firstonstack then
offset = 0
else
@@ -693,7 +736,7 @@ local function inject(parent,head,candidate)
--
candidate.hook, candidate.node = addtoline(parent,box)
--
- setattr(box,a_margindata,nofstatus)
+ setprop(box,"margindata",candidate)
if trace_margindata then
report_margindata("injected, location %a, shift %p",location,shift)
end
@@ -704,14 +747,16 @@ local function inject(parent,head,candidate)
depth = offset,
slack = candidate.bottomspace, -- todo: 'depth' => strutdepth
lineheight = candidate.lineheight, -- only for tracing
+ stacked = stackedinline,
}
offset = offset + height
- stacked[location] = offset -- weird, no table ?
+ -- we need a restart ... when there is no overlap at all
+ stacked[location] = offset
-- todo: if no real depth then zero
if trace_margindata then
report_margindata("status, offset %s",offset)
end
- return getlist(parent), room, stack == v_continue
+ return getlist(parent), room, stackedinline or (stack == v_continue)
end
local function flushinline(parent,head)
@@ -729,9 +774,15 @@ local function flushinline(parent,head)
inlinestore[n] = nil
nofinlined = nofinlined - 1
head, room, con = inject(parent,head,candidate) -- maybe return applied offset
- continue = continue or con
- done = true
+ done = true
+ continue = continue or con
nofstored = nofstored - 1
+ if room and room.stacked then
+ -- for now we also check for inline+yes/continue, maybe someday no such check
+ -- will happen; we can assume most inlines are one line heigh; also this
+ -- together feature can become optional
+ registertogether(tonode(parent),room) -- !! tonode
+ end
end
end
elseif id == hlist_code or id == vlist_code then
@@ -761,8 +812,8 @@ local function flushed(scope,parent) -- current is hlist
local candidate = remove(store,1) -- brr, local stores are sparse
if candidate then -- no vpack, as we want to realign
head, room, con = inject(parent,head,candidate)
- done = true
- continue = continue or con
+ done = true
+ continue = continue or con
nofstored = nofstored - 1
if room then
registertogether(tonode(parent),room) -- !! tonode
@@ -817,11 +868,11 @@ local function handler(scope,head,group)
local done = false
while current do
local id = getid(current)
- if (id == vlist_code or id == hlist_code) and not getattr(current,a_margindata) then
+ if (id == vlist_code or id == hlist_code) and getprop(current,"margindata") == nil then
local don, continue = flushed(scope,current)
if don then
done = true
- setattr(current,a_margindata,0) -- signal to prevent duplicate processing
+ setprop(current,"margindata",false) -- signal to prevent duplicate processing
if continue then
markovershoot(current)
end
@@ -850,6 +901,9 @@ end
local trialtypesetting = context.trialtypesetting
+-- maybe change this to an action applied to the to be shipped out box (that is
+-- the mvl list in there so that we don't need to traverse global
+
function margins.localhandler(head,group) -- sometimes group is "" which is weird
if trialtypesetting() then
@@ -909,8 +963,9 @@ local function finalhandler(head)
while current and nofdelayed > 0 do
local id = getid(current)
if id == hlist_code then -- only lines?
- local a = getattr(current,a_margindata)
- if not a or a == 0 then
+ local a = getprop(current,"margindata")
+-- if not a or a == 0 then
+ if not a then
finalhandler(getlist(current))
elseif realigned(current,a) then
done = true
@@ -946,26 +1001,23 @@ end
-- Somehow the vbox builder (in combinations) gets pretty confused and decides to
-- go horizontal. So this needs more testing.
-prependaction("finalizers", "lists", "typesetters.margins.localhandler")
--- ("vboxbuilders", "normalizers", "typesetters.margins.localhandler")
-prependaction("mvlbuilders", "normalizers", "typesetters.margins.globalhandler")
-prependaction("shipouts", "normalizers", "typesetters.margins.finalhandler")
+prependaction("finalizers", "lists", "typesetters.margins.localhandler")
+prependaction("mvlbuilders", "normalizers", "typesetters.margins.globalhandler")
+prependaction("shipouts", "normalizers", "typesetters.margins.finalhandler")
-disableaction("finalizers", "typesetters.margins.localhandler")
--- ("vboxbuilders", "typesetters.margins.localhandler")
-disableaction("mvlbuilders", "typesetters.margins.globalhandler")
-disableaction("shipouts", "typesetters.margins.finalhandler")
+disableaction("finalizers", "typesetters.margins.localhandler")
+disableaction("mvlbuilders", "typesetters.margins.globalhandler")
+disableaction("shipouts", "typesetters.margins.finalhandler")
enablelocal = function()
- enableaction("finalizers", "typesetters.margins.localhandler")
- -- enableaction("vboxbuilders", "typesetters.margins.localhandler")
- enableaction("shipouts", "typesetters.margins.finalhandler")
+ enableaction("finalizers", "typesetters.margins.localhandler")
+ enableaction("shipouts", "typesetters.margins.finalhandler")
enablelocal = nil
end
enableglobal = function()
- enableaction("mvlbuilders", "typesetters.margins.globalhandler")
- enableaction("shipouts", "typesetters.margins.finalhandler")
+ enableaction("mvlbuilders", "typesetters.margins.globalhandler")
+ enableaction("shipouts", "typesetters.margins.finalhandler")
enableglobal = nil
end
diff --git a/tex/context/base/mkiv/typo-mar.mkiv b/tex/context/base/mkiv/typo-mar.mkiv
index 90ccd46e2..4c634a2d3 100644
--- a/tex/context/base/mkiv/typo-mar.mkiv
+++ b/tex/context/base/mkiv/typo-mar.mkiv
@@ -195,6 +195,8 @@
% todo: naturalhbox
+% when name is set we overload
+
\let\margindatahbox\naturalhbox % \hbox
\unexpanded\def\typo_margins_data_yes_indeed[#dataparameters][#textparameters]#content%
diff --git a/tex/context/base/mkiv/typo-rep.lua b/tex/context/base/mkiv/typo-rep.lua
index a8925a2ce..489877792 100644
--- a/tex/context/base/mkiv/typo-rep.lua
+++ b/tex/context/base/mkiv/typo-rep.lua
@@ -35,11 +35,9 @@ local replace_node = nuts.replace
local copy_node = nuts.copy
local nodecodes = nodes.nodecodes
-local glyph_code = nodecodes.glyph
local chardata = characters.data
local collected = false
-local fontdata = fonts.hashes.identifiers
local a_stripping = attributes.private("stripping")
local texsetattribute = tex.setattribute
diff --git a/tex/context/base/mkiv/typo-spa.lua b/tex/context/base/mkiv/typo-spa.lua
index f00e3ae6b..d1aa2e277 100644
--- a/tex/context/base/mkiv/typo-spa.lua
+++ b/tex/context/base/mkiv/typo-spa.lua
@@ -7,7 +7,6 @@ if not modules then modules = { } end modules ['typo-spa'] = {
}
local next, type = next, type
-local utfchar = utf.char
local trace_spacing = false trackers.register("typesetters.spacing", function(v) trace_spacing = v end)
@@ -18,7 +17,6 @@ local nodes, fonts, node = nodes, fonts, node
local tasks = nodes.tasks
local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
local quaddata = fonthashes.quads
local texsetattribute = tex.setattribute
@@ -47,7 +45,6 @@ local new_penalty = nodepool.penalty
local new_glue = nodepool.glue
local nodecodes = nodes.nodecodes
-local glyph_code = nodecodes.glyph
local math_code = nodecodes.math
local somespace = nodes.somespace
diff --git a/tex/context/base/mkiv/util-sql-imp-swiglib.lua b/tex/context/base/mkiv/util-sql-imp-swiglib.lua
index af7012392..e4bed183a 100644
--- a/tex/context/base/mkiv/util-sql-imp-swiglib.lua
+++ b/tex/context/base/mkiv/util-sql-imp-swiglib.lua
@@ -132,31 +132,31 @@ end
--
-local typemap = mysql.MYSQL_TYPE_VAR_STRING and {
- [mysql.MYSQL_TYPE_VAR_STRING ] = "string",
- [mysql.MYSQL_TYPE_STRING ] = "string",
- [mysql.MYSQL_TYPE_DECIMAL ] = "number",
- [mysql.MYSQL_TYPE_SHORT ] = "number",
- [mysql.MYSQL_TYPE_LONG ] = "number",
- [mysql.MYSQL_TYPE_FLOAT ] = "number",
- [mysql.MYSQL_TYPE_DOUBLE ] = "number",
- [mysql.MYSQL_TYPE_LONGLONG ] = "number",
- [mysql.MYSQL_TYPE_INT24 ] = "number",
- [mysql.MYSQL_TYPE_YEAR ] = "number",
- [mysql.MYSQL_TYPE_TINY ] = "number",
- [mysql.MYSQL_TYPE_TINY_BLOB ] = "binary",
- [mysql.MYSQL_TYPE_MEDIUM_BLOB] = "binary",
- [mysql.MYSQL_TYPE_LONG_BLOB ] = "binary",
- [mysql.MYSQL_TYPE_BLOB ] = "binary",
- [mysql.MYSQL_TYPE_DATE ] = "date",
- [mysql.MYSQL_TYPE_NEWDATE ] = "date",
- [mysql.MYSQL_TYPE_DATETIME ] = "datetime",
- [mysql.MYSQL_TYPE_TIME ] = "time",
- [mysql.MYSQL_TYPE_TIMESTAMP ] = "time",
- [mysql.MYSQL_TYPE_ENUM ] = "set",
- [mysql.MYSQL_TYPE_SET ] = "set",
- [mysql.MYSQL_TYPE_NULL ] = "null",
-}
+-- local typemap = mysql.MYSQL_TYPE_VAR_STRING and {
+-- [mysql.MYSQL_TYPE_VAR_STRING ] = "string",
+-- [mysql.MYSQL_TYPE_STRING ] = "string",
+-- [mysql.MYSQL_TYPE_DECIMAL ] = "number",
+-- [mysql.MYSQL_TYPE_SHORT ] = "number",
+-- [mysql.MYSQL_TYPE_LONG ] = "number",
+-- [mysql.MYSQL_TYPE_FLOAT ] = "number",
+-- [mysql.MYSQL_TYPE_DOUBLE ] = "number",
+-- [mysql.MYSQL_TYPE_LONGLONG ] = "number",
+-- [mysql.MYSQL_TYPE_INT24 ] = "number",
+-- [mysql.MYSQL_TYPE_YEAR ] = "number",
+-- [mysql.MYSQL_TYPE_TINY ] = "number",
+-- [mysql.MYSQL_TYPE_TINY_BLOB ] = "binary",
+-- [mysql.MYSQL_TYPE_MEDIUM_BLOB] = "binary",
+-- [mysql.MYSQL_TYPE_LONG_BLOB ] = "binary",
+-- [mysql.MYSQL_TYPE_BLOB ] = "binary",
+-- [mysql.MYSQL_TYPE_DATE ] = "date",
+-- [mysql.MYSQL_TYPE_NEWDATE ] = "date",
+-- [mysql.MYSQL_TYPE_DATETIME ] = "datetime",
+-- [mysql.MYSQL_TYPE_TIME ] = "time",
+-- [mysql.MYSQL_TYPE_TIMESTAMP ] = "time",
+-- [mysql.MYSQL_TYPE_ENUM ] = "set",
+-- [mysql.MYSQL_TYPE_SET ] = "set",
+-- [mysql.MYSQL_TYPE_NULL ] = "null",
+-- }
-- real_escape_string
diff --git a/tex/context/base/mkiv/util-sql-tickets.lua b/tex/context/base/mkiv/util-sql-tickets.lua
index 5e958299d..a688b2ddb 100644
--- a/tex/context/base/mkiv/util-sql-tickets.lua
+++ b/tex/context/base/mkiv/util-sql-tickets.lua
@@ -53,7 +53,7 @@ tickets.statustags = statustags
local s_unknown = status.unknown
local s_pending = status.pending
local s_busy = status.busy
-local s_finished = status.finished
+----- s_finished = status.finished
local s_dependent = status.dependent
local s_error = status.error
local s_deleted = status.deleted
diff --git a/tex/context/base/mkiv/util-sql.lua b/tex/context/base/mkiv/util-sql.lua
index 84cbb1692..023c7809a 100644
--- a/tex/context/base/mkiv/util-sql.lua
+++ b/tex/context/base/mkiv/util-sql.lua
@@ -65,8 +65,6 @@ local P, S, V, C, Cs, Ct, Cc, Cg, Cf, patterns, lpegmatch = lpeg.P, lpeg.S, lpeg
local concat = table.concat
local osuuid = os.uuid
-local osclock = os.clock or os.time
-local ostime = os.time
local setmetatableindex = table.setmetatableindex
local trace_sql = false trackers.register("sql.trace", function(v) trace_sql = v end)
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua
index a6239adf4..d50205892 100644
--- a/tex/context/base/mkiv/util-tab.lua
+++ b/tex/context/base/mkiv/util-tab.lua
@@ -812,7 +812,7 @@ local function serialize(root,name,specification)
-- The dummy access will initialize a table that has a delayed initialization
-- using a metatable. (maybe explicitly test for metatable)
if getmetatable(root) then -- todo: make this an option, maybe even per subtable
- local dummy = root._w_h_a_t_e_v_e_r_
+ local dummy = root._w_h_a_t_e_v_e_r_ -- needed
root._w_h_a_t_e_v_e_r_ = nil
end
-- Let's forget about empty tables.
diff --git a/tex/context/interface/mkiv/i-blackrule.xml b/tex/context/interface/mkiv/i-blackrule.xml
index 1db99b9f4..edb6873f0 100644
--- a/tex/context/interface/mkiv/i-blackrule.xml
+++ b/tex/context/interface/mkiv/i-blackrule.xml
@@ -35,6 +35,14 @@
<cd:parameter name="color">
<cd:constant type="cd:color"/>
</cd:parameter>
+ <cd:parameter name="type">
+ <cd:constant type="mp"/>
+ <cd:constant type="yes"/>
+ <cd:constant type="no"/>
+ </cd:parameter>
+ <cd:parameter name="mp">
+ <cd:constant type="cd:name"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -90,4 +98,4 @@
</cd:arguments>
</cd:command>
-</cd:interface> \ No newline at end of file
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 66780bfcf..fa6f77cd2 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index f36360275..f42b96d9d 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv
index e033235c3..fd4a3c7a1 100644
--- a/tex/context/modules/mkiv/m-scite.mkiv
+++ b/tex/context/modules/mkiv/m-scite.mkiv
@@ -62,6 +62,8 @@ local f_fore_bold = formatters["\\def\\slx%s#1{{\\slxc%s\\bf#1}}%%"]
local f_none_bold = formatters["\\def\\slx%s#1{{\\bf#1}}%%"]
local f_none_none = formatters["\\def\\slx%s#1{{#1}}%%"]
local f_texstyled = formatters["\\slx%s{%s}"]
+local f_hanging = formatters["\\slxb{%s}%s\\slxe"]
+
local f_mapping = [[
\let\string\slxL\string\letterleftbrace
@@ -165,20 +167,21 @@ function scite.installcommands()
context(exportcolors())
end
-local p = lpeg.P("\\slxS ")^1
+local p1 = lpeg.tsplitat(lpeg.patterns.newline)
+local p2 = lpeg.P("\\slxS ")^1
local function indent(str)
- local l = string.split(str,"\n")
+ local l = lpegmatch(p1,str)
for i=1,#l do
local s = l[i]
if #s > 0 then
- local n = lpegmatch(p,s)
+ local n = lpegmatch(p2,s)
if n then
n = (n-1)/6
else
n = 0
end
- l[i] = formatters["\\slxb{%s}%s\\slxe"](n,s)
+ l[i] = f_hanging(n,s)
end
end
return concat(l,"\n")
diff --git a/tex/context/modules/mkiv/x-setups-basics.mkiv b/tex/context/modules/mkiv/x-setups-basics.mkiv
index 02376deea..4a7859c7f 100644
--- a/tex/context/modules/mkiv/x-setups-basics.mkiv
+++ b/tex/context/modules/mkiv/x-setups-basics.mkiv
@@ -686,6 +686,13 @@
\getsetupstring{\xmlatt{#1}{type}}
\stopxmlsetups
+\definebar % in case we mess with underbar settings
+ [cmd_underbar]
+ [\v!underbar]
+ [\c!foregroundcolor=,
+ \c!foregroundstyle=,
+ \c!color=]
+
\startxmlsetups xml:setups:constant
\doifelsemode {setups-pass-one} {
} {
@@ -694,7 +701,7 @@
\xmlmappedvalue{setups:method}{\xmlatt{#1}{method}}{none}
} {
\doif {\xmlatt{#1}{default}} {yes} {
- \underbar % next needs to be {braced}
+ \cmd_underbar % next needs to be {braced}
}
}
{\getsetupstring{\xmlatt{#1}{type}}}
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index f10f1399f..9c44911d0 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 : 05/17/16 10:06:55
+-- merge date : 05/20/16 18:42:08
do -- begin closure to overcome local limits and interference
@@ -5034,7 +5034,6 @@ if not modules then modules={} end modules ['font-ini']={
license="see context related readme files"
}
local allocate=utilities.storage.allocate
-local report_defining=logs.reporter("fonts","defining")
fonts=fonts or {}
local fonts=fonts
fonts.hashes={ identifiers=allocate() }
@@ -5061,7 +5060,6 @@ if not modules then modules={} end modules ['font-con']={
}
local next,tostring,rawget=next,tostring,rawget
local format,match,lower,gsub=string.format,string.match,string.lower,string.gsub
-local utfbyte=utf.byte
local sort,insert,concat,sortedkeys,serialize,fastcopy=table.sort,table.insert,table.concat,table.sortedkeys,table.serialize,table.fastcopy
local derivetable=table.derive
local trace_defining=false trackers.register("fonts.defining",function(v) trace_defining=v end)
@@ -6087,7 +6085,6 @@ function constructors.initializefeatures(what,tfmdata,features,trace,report)
local properties=tfmdata.properties or {}
local whathandler=handlers[what]
local whatfeatures=whathandler.features
- local whatinitializers=whatfeatures.initializers
local whatmodechecker=whatfeatures.modechecker
local mode=properties.mode or (whatmodechecker and whatmodechecker(tfmdata,features,features.mode)) or features.mode or "base"
properties.mode=mode
@@ -6403,7 +6400,6 @@ if not modules then modules={} end modules ['font-map']={
local tonumber,next,type=tonumber,next,type
local match,format,find,concat,gsub,lower=string.match,string.format,string.find,table.concat,string.gsub,string.lower
local P,R,S,C,Ct,Cc,lpegmatch=lpeg.P,lpeg.R,lpeg.S,lpeg.C,lpeg.Ct,lpeg.Cc,lpeg.match
-local utfbyte=utf.byte
local floor=math.floor
local formatters=string.formatters
local trace_loading=false trackers.register("fonts.loading",function(v) trace_loading=v end)
@@ -6839,7 +6835,6 @@ tfm.version=1.000
tfm.maxnestingdepth=5
tfm.maxnestingsize=65536*1024
local tfmfeatures=constructors.newfeatures("tfm")
-local registertfmfeature=tfmfeatures.register
constructors.resolvevirtualtoo=false
fonts.formats.tfm="type1"
fonts.formats.ofm="type1"
@@ -7148,7 +7143,6 @@ local streamreader=utilities.files
readers.streamreader=streamreader
local openfile=streamreader.open
local closefile=streamreader.close
-local skipbytes=streamreader.skip
local setposition=streamreader.setposition
local skipshort=streamreader.skipshort
local readbytes=streamreader.readbytes
@@ -7156,8 +7150,7 @@ local readstring=streamreader.readstring
local readbyte=streamreader.readcardinal1
local readushort=streamreader.readcardinal2
local readuint=streamreader.readcardinal3
-local readulong=streamreader.readcardinal4
-local readchar=streamreader.readinteger1
+local readulong=streamreader.readcardinal4
local readshort=streamreader.readinteger2
local readlong=streamreader.readinteger4
local readfixed=streamreader.readfixed4
@@ -10597,7 +10590,6 @@ local report=logs.reporter("otf reader")
local readers=fonts.handlers.otf.readers
local streamreader=readers.streamreader
local setposition=streamreader.setposition
-local skipbytes=streamreader.skip
local skipshort=streamreader.skipshort
local readushort=streamreader.readcardinal2
local readulong=streamreader.readcardinal4
@@ -15170,8 +15162,6 @@ local concat,unpack=table.concat,table.unpack
local insert,remove=table.insert,table.remove
local format,gmatch,gsub,find,match,lower,strip=string.format,string.gmatch,string.gsub,string.find,string.match,string.lower,string.strip
local type,next,tonumber,tostring,rawget=type,next,tonumber,tostring,rawget
-local lpegmatch=lpeg.match
-local utfchar=utf.char
local trace_baseinit=false trackers.register("otf.baseinit",function(v) trace_baseinit=v end)
local trace_singles=false trackers.register("otf.singles",function(v) trace_singles=v end)
local trace_multiples=false trackers.register("otf.multiples",function(v) trace_multiples=v end)
@@ -15543,7 +15533,6 @@ if not modules then modules={} end modules ['font-otj']={
}
if not nodes.properties then return end
local next,rawget=next,rawget
-local utfchar=utf.char
local fastcopy=table.fastcopy
local registertracker=trackers.register
local trace_injections=false registertracker("fonts.injections",function(v) trace_injections=v end)
@@ -15588,7 +15577,6 @@ local traverse_id=nuts.traverse_id
local traverse_char=nuts.traverse_char
local insert_node_before=nuts.insert_before
local insert_node_after=nuts.insert_after
-local find_tail=nuts.tail
local properties=nodes.properties.data
function injections.installnewkern(nk)
newkern=nk or newkern
@@ -16865,7 +16853,6 @@ local getsubtype=nuts.getsubtype
local getchar=nuts.getchar
local ischar=nuts.is_char
local traverse_id=nuts.traverse_id
-local traverse_node_list=nuts.traverse
local end_of_math=nuts.end_of_math
local nodecodes=nodes.nodecodes
local disc_code=nodecodes.disc
@@ -17257,7 +17244,6 @@ local report_chain=logs.reporter("fonts","otf chain")
local report_process=logs.reporter("fonts","otf process")
local report_warning=logs.reporter("fonts","otf warning")
local report_run=logs.reporter("fonts","otf run")
-local report_check=logs.reporter("fonts","otf check")
registertracker("otf.replacements","otf.singles,otf.multiples,otf.alternatives,otf.ligatures")
registertracker("otf.positions","otf.marks,otf.kerns,otf.cursive")
registertracker("otf.actions","otf.replacements,otf.positions")
@@ -17288,10 +17274,7 @@ local getdisc=nuts.getdisc
local setdisc=nuts.setdisc
local setlink=nuts.setlink
local ischar=nuts.is_char
-local insert_node_before=nuts.insert_before
local insert_node_after=nuts.insert_after
-local delete_node=nuts.delete
-local remove_node=nuts.remove
local copy_node=nuts.copy
local copy_node_list=nuts.copy_list
local find_node_tail=nuts.tail
@@ -19686,7 +19669,7 @@ local function c_run_single(head,font,attr,lookupcache,step,dataset,sequence,rlm
while start do
local char=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if not a or (a==attr) then
local lookupmatch=lookupcache[char]
if lookupmatch then
@@ -19716,7 +19699,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
while start~=stop do
local char=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if not a or (a==attr) then
local lookupmatch=lookupcache[char]
if lookupmatch then
@@ -19749,7 +19732,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
end
end
local function k_run_single(sub,injection,last,font,attr,lookupcache,step,dataset,sequence,rlmode,handler)
- local a=getattr(sub,0)
+ local a=attr and getattr(sub,0)
if not a or (a==attr) then
for n in traverse_nodes(sub) do
if n==last then
@@ -19780,7 +19763,7 @@ local function c_run_multiple(head,font,attr,steps,nofsteps,dataset,sequence,rlm
while start do
local char=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if not a or (a==attr) then
for i=1,nofsteps do
local step=steps[i]
@@ -19821,7 +19804,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
while start~=stop do
local char=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if not a or (a==attr) then
for i=1,nofsteps do
local step=steps[i]
@@ -19862,7 +19845,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
end
end
local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,dataset,sequence,rlmode,handler)
- local a=getattr(sub,0)
+ local a=attr and getattr(sub,0)
if not a or (a==attr) then
for n in traverse_nodes(sub) do
if n==last then
@@ -19944,6 +19927,9 @@ local function featuresprocessor(head,font,attr)
nesting=nesting-1
return head,false
end
+ if attr==0 then
+ attr=false
+ end
head=tonut(head)
if trace_steps then
checkstep(head)
@@ -19981,7 +19967,7 @@ local function featuresprocessor(head,font,attr)
while start do
local char=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if not a or (a==attr) then
for i=1,nofsteps do
local step=steps[i]
@@ -20022,7 +20008,7 @@ local function featuresprocessor(head,font,attr)
while start do
local char,id=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if a then
a=(a==attr) and (not attribute or getprop(start,a_state)==attribute)
else
@@ -20072,7 +20058,7 @@ local function featuresprocessor(head,font,attr)
while start do
local char,id=ischar(start,font)
if char then
- local a=getattr(start,0)
+ local a=attr and getattr(start,0)
if a then
a=(a==attr) and (not attribute or getprop(start,a_state)==attribute)
else
@@ -20297,8 +20283,6 @@ fonts=fonts or {}
fonts.analyzers=fonts.analyzers or {}
fonts.analyzers.methods=fonts.analyzers.methods or { node={ otf={} } }
local otf=fonts.handlers.otf
-local nodecodes=nodes.nodecodes
-local glyph_code=nodecodes.glyph
local handlers=otf.handlers
local methods=fonts.analyzers.methods
local otffeatures=fonts.constructors.newfeatures("otf")
@@ -22272,6 +22256,7 @@ local lpegmatch,patterns=lpeg.match,lpeg.patterns
local trace_indexing=false trackers.register("afm.indexing",function(v) trace_indexing=v end)
local trace_loading=false trackers.register("afm.loading",function(v) trace_loading=v end)
local report_afm=logs.reporter("fonts","afm loading")
+local report_afm=logs.reporter("fonts","pfb loading")
fonts=fonts or {}
local handlers=fonts.handlers or {}
fonts.handlers=handlers
@@ -22324,16 +22309,16 @@ do
local function loadpfbvector(filename)
local data=io.loaddata(resolvers.findfile(filename))
if not data then
- print("no data",filename)
+ report_pfb("no data in %a",filename)
return
end
- if not find(data,"!PS%-AdobeFont%-") then
- print("no font",filename)
+ if not (find(data,"!PS%-AdobeFont%-") or find(data,"%%!FontType1")) then
+ report_pfb("no font in %a",filename)
return
end
local ascii,binary=match(data,"(.*)eexec%s+......(.*)")
if not binary then
- print("no binary",filename)
+ report_pfb("no binary data in %a",filename)
return
end
binary=decrypt(binary,4)
@@ -22342,7 +22327,7 @@ do
vector[0]=table.remove(vector,1)
end
if not vector then
- print("no vector",filename)
+ report_pfb("no vector in %a",filename)
return
end
return vector
@@ -22367,16 +22352,18 @@ do
end
end
end
-local spacing=patterns.whitespace
+local spacer=patterns.spacer
+local whitespace=patterns.whitespace
local lineend=patterns.newline
+local spacing=spacer^0
local number=spacing*S("+-")^-1*(R("09")+S("."))^1/tonumber
-local name=spacing*C((1-spacing)^1)
-local words=spacing*(1-lineend)^1/strip
+local name=spacing*C((1-whitespace)^1)
+local words=spacing*((1-lineend)^1/strip)
local rest=(1-lineend)^0
local fontdata=Carg(1)
local semicolon=spacing*P(";")
-local plus=P("plus")*number
-local minus=P("minus")*number
+local plus=spacing*P("plus")*number
+local minus=spacing*P("minus")*number
local function addkernpair(data,one,two,value)
local chr=data.characters[one]
if chr then
@@ -22461,6 +22448,7 @@ local p_parameters=P(false)+fontdata*((P("FontName")+P("FullName")+P("FamilyName
+(fontdata*C("AXISHEIGHT")*number*rest)/set_1
)
local fullparser=(P("StartFontMetrics")*fontdata*name/start )*(p_charmetrics+p_kernpairs+p_parameters+(1-P("EndFontMetrics")) )^0*(P("EndFontMetrics")/stop )
+local fullparser=(P("StartFontMetrics")*fontdata*name/start )*(p_charmetrics+p_kernpairs+p_parameters+(1-P("EndFontMetrics")) )^0*(P("EndFontMetrics")/stop )
local infoparser=(P("StartFontMetrics")*fontdata*name/start )*(p_parameters+(1-P("EndFontMetrics")) )^0*(P("EndFontMetrics")/stop )
local function read(filename,parser)
local afmblob=io.loaddata(filename)
@@ -23195,7 +23183,8 @@ local function check_afm(specification,fullname)
end
end
function readers.afm(specification,method)
- local fullname,tfmdata=specification.filename or "",nil
+ local fullname=specification.filename or ""
+ local tfmdata=nil
if fullname=="" then
local forced=specification.forced or ""
if forced~="" then
@@ -23223,8 +23212,17 @@ function readers.pfb(specification,method)
if trace_defining then
report_afm("using afm reader for %a",original)
end
- specification.specification=file.replacesuffix(original,"afm")
specification.forced="afm"
+ local function swap(name)
+ local value=specification[swap]
+ if value then
+ specification[swap]=gsub("%.pfb",".afm",1)
+ end
+ end
+ swap("filename")
+ swap("fullname")
+ swap("forcedname")
+ swap("specification")
return readers.afm(specification,method)
end
@@ -24092,7 +24090,6 @@ local fonts=fonts
local nodes=nodes
local nuts=nodes.nuts
local traverse_id=nuts.traverse_id
-local remove_node=nuts.remove
local free_node=nuts.free
local glyph_code=nodes.nodecodes.glyph
local disc_code=nodes.nodecodes.disc