summaryrefslogtreecommitdiff
path: root/tex/context/base
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-12-19 15:15:06 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-12-19 15:15:06 +0100
commit717e95884408a83aaf6c7f34fd38b94b2fb83bed (patch)
treee3d8b9a4e5df583d2b7fc0d7f2089d2009e926a8 /tex/context/base
parentd1faffcd5d92925a6c5e66ebb72b4c8dcfae236f (diff)
downloadcontext-717e95884408a83aaf6c7f34fd38b94b2fb83bed.tar.gz
2015-12-19 14:45:00
Diffstat (limited to 'tex/context/base')
-rw-r--r--tex/context/base/anch-pos.lua3
-rw-r--r--tex/context/base/back-pdf.mkiv2
-rw-r--r--tex/context/base/cldf-ini.lua1
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4171 -> 4177 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/font-ctx.lua3
-rw-r--r--tex/context/base/font-ini.mkvi114
-rw-r--r--tex/context/base/font-nod.lua3
-rw-r--r--tex/context/base/font-otc.lua15
-rw-r--r--tex/context/base/font-otl.lua2
-rw-r--r--tex/context/base/font-otn.lua254
-rw-r--r--tex/context/base/font-otr.lua29
-rw-r--r--tex/context/base/font-ots.lua5
-rw-r--r--tex/context/base/font-oup.lua29
-rw-r--r--tex/context/base/font-sol.lua7
-rw-r--r--tex/context/base/lang-dis.lua5
-rw-r--r--tex/context/base/lpdf-res.lua3
-rw-r--r--tex/context/base/lpdf-tag.lua5
-rw-r--r--tex/context/base/luat-ini.mkiv6
-rw-r--r--tex/context/base/math-dir.lua5
-rw-r--r--tex/context/base/math-frc.mkiv23
-rw-r--r--tex/context/base/math-noa.lua9
-rw-r--r--tex/context/base/node-acc.lua3
-rw-r--r--tex/context/base/node-aux.lua7
-rw-r--r--tex/context/base/node-bck.lua7
-rw-r--r--tex/context/base/node-fin.lua122
-rw-r--r--tex/context/base/node-ltp.lua8
-rw-r--r--tex/context/base/node-mig.lua3
-rw-r--r--tex/context/base/node-nut.lua21
-rw-r--r--tex/context/base/node-ppt.lua3
-rw-r--r--tex/context/base/node-ref.lua13
-rw-r--r--tex/context/base/node-res.lua5
-rw-r--r--tex/context/base/node-rul.lua3
-rw-r--r--tex/context/base/node-shp.lua8
-rw-r--r--tex/context/base/pack-rul.lua5
-rw-r--r--tex/context/base/page-brk.mkiv2
-rw-r--r--tex/context/base/page-lin.lua6
-rw-r--r--tex/context/base/page-mix.lua7
-rw-r--r--tex/context/base/publ-dat.lua24
-rw-r--r--tex/context/base/spac-ali.lua5
-rw-r--r--tex/context/base/spac-chr.lua3
-rw-r--r--tex/context/base/spac-prf.lua3
-rw-r--r--tex/context/base/spac-ver.lua11
-rw-r--r--tex/context/base/status-files.pdfbin24365 -> 25689 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin257681 -> 267108 bytes
-rw-r--r--tex/context/base/supp-box.lua7
-rw-r--r--tex/context/base/syst-ini.mkiv4
-rw-r--r--tex/context/base/tabl-xtb.lua3
-rw-r--r--tex/context/base/trac-jus.lua10
-rw-r--r--tex/context/base/trac-vis.lua102
-rw-r--r--tex/context/base/typo-fln.lua3
-rw-r--r--tex/context/base/typo-krn.lua9
-rw-r--r--tex/context/base/typo-lin.lua9
-rw-r--r--tex/context/base/typo-mar.lua11
-rw-r--r--tex/context/base/typo-sus.lua3
56 files changed, 549 insertions, 408 deletions
diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua
index 95b5b86b2..c01e90179 100644
--- a/tex/context/base/anch-pos.lua
+++ b/tex/context/base/anch-pos.lua
@@ -57,6 +57,7 @@ local getfield = nuts.getfield
local setfield = nuts.setfield
local setlink = nuts.setlink
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getbox = nuts.getbox
local getskip = nuts.getskip
@@ -450,7 +451,7 @@ local function markregionbox(n,tag,correct)
else -- we can have a simple push/pop
setlink(push,pop)
end
- setfield(box,"list",push)
+ setlist(box,push)
end
jobpositions.markregionbox = markregionbox
diff --git a/tex/context/base/back-pdf.mkiv b/tex/context/base/back-pdf.mkiv
index d74c4c569..cc2284e79 100644
--- a/tex/context/base/back-pdf.mkiv
+++ b/tex/context/base/back-pdf.mkiv
@@ -55,7 +55,7 @@
\pdfgentounicode \plusone % \let\pdfgentounicode \undefined \newcount\pdfgentounicode
\pdfinclusioncopyfonts \plusone % \let\pdfinclusioncopyfonts \undefined \newcount\pdfinclusioncopyfonts
\pdfinclusionerrorlevel \zerocount % \let\pdfinclusionerrorlevel\undefined \newcount\pdfinclusionerrorlevel
-\pdfdecimaldigits \plusten % \let\pdfdecimaldigits \undefined \newcount\pdfdecimaldigits
+\pdfdecimaldigits \plussix % \let\pdfdecimaldigits \undefined \newcount\pdfdecimaldigits
\pdfimageresolution 300
\pdfpkresolution 600
diff --git a/tex/context/base/cldf-ini.lua b/tex/context/base/cldf-ini.lua
index 62dbe67b3..7d904282f 100644
--- a/tex/context/base/cldf-ini.lua
+++ b/tex/context/base/cldf-ini.lua
@@ -320,7 +320,6 @@ local registerfunction, unregisterfunction, reservefunction, knownfunctions, cal
interfaces.storedscanners = interfaces.storedscanners or { }
local storedscanners = interfaces.storedscanners
-
storage.register("interfaces/storedscanners", storedscanners, "interfaces.storedscanners")
local interfacescanners = table.setmetatablenewindex(function(t,k,v)
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index b48e9a499..fe76643ad 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2015.12.17 15:57}
+\newcontextversion{2015.12.19 14:43}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index 6d20a25b5..8b3e2464a 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 4efa365de..32f977b1d 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2015.12.17 15:57}
+\edef\contextversion{2015.12.19 14:43}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua
index c00312098..a99d2ed91 100644
--- a/tex/context/base/font-ctx.lua
+++ b/tex/context/base/font-ctx.lua
@@ -77,6 +77,7 @@ local setattr = nuts.setattr
local getprop = nuts.getprop
local setprop = nuts.setprop
local getfont = nuts.getfont
+local setsubtype = nuts.setsubtype
local texgetattribute = tex.getattribute
local texsetattribute = tex.setattribute
@@ -2222,7 +2223,7 @@ do
return c
end)
- directives.register("nodes.injections.fontkern", function(v) setfield(kern,"subtype",v and 0 or 1) end)
+ directives.register("nodes.injections.fontkern", function(v) setsubtype(kern,v and 0 or 1) end)
end
diff --git a/tex/context/base/font-ini.mkvi b/tex/context/base/font-ini.mkvi
index 73b26eeb3..3248781ec 100644
--- a/tex/context/base/font-ini.mkvi
+++ b/tex/context/base/font-ini.mkvi
@@ -486,7 +486,8 @@
\def\font_basics_set_mapped_fontsize#from%
{\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
- \csname\??mappedfontsize\the\dimexpr#from\relax\endcsname\else#from%
+ %\csname\??mappedfontsize\the\dimexpr#from\relax\endcsname\else#from%
+ \lastnamedcs\else#from%
\fi}
\installcorenamespace{fontbodyknown}
@@ -510,9 +511,11 @@
\def\font_helpers_check_relative_font_size#style%
{\edef\p_font_rscale
{\ifcsname\??fontclass\fontclass#style\s!rscale\endcsname
- \csname\??fontclass\fontclass#style\s!rscale\endcsname
+ %\csname\??fontclass\fontclass#style\s!rscale\endcsname
+ \lastnamedcs
\else\ifcsname\??fontclass\defaultfontclass#style\s!rscale\endcsname % brr
- \csname\??fontclass\defaultfontclass#style\s!rscale\endcsname
+ %\csname\??fontclass\defaultfontclass#style\s!rscale\endcsname
+ \lastnamedcs
\else
\v_font_rscale_default
\fi\fi}%
@@ -526,14 +529,16 @@
\def\font_rscale_xx#style%
{\ifcsname\??fontclass\fontclass#style\s!rscale\endcsname
- \csname\??fontclass\fontclass#style\s!rscale\endcsname
+ %\csname\??fontclass\fontclass#style\s!rscale\endcsname
+ \lastnamedcs
\else
\v_font_rscale_default
\fi}
\def\font_rscale_mm
{\ifcsname\??fontclass\fontclass\s!mm\s!rscale\endcsname
- \csname\??fontclass\fontclass\s!mm\s!rscale\endcsname
+ %\csname\??fontclass\fontclass\s!mm\s!rscale\endcsname
+ \lastnamedcs
\else
\v_font_rscale_default
\fi}
@@ -583,8 +588,8 @@
\def\font_basics_define_fontstyle[#commands][#style]% style: rm ss tt ...
{\ifcsname\??fontstyleknown#style\endcsname \else % can be delayed till used (cg, hw)
\font_helpers_register_style{#style}%
- \t_font_style_commands\expandafter{\the\t_font_style_commands
- \m_font_style_command{#style}}%
+ % todo: apptoks
+ \t_font_style_commands\expandafter{\the\t_font_style_commands\m_font_style_command{#style}}%
\fi
\processcommalist[#commands]{\font_basics_define_fontstyle_indeed{#style}}}
@@ -603,6 +608,7 @@
\unexpanded\def\definefontalternative[#alternative]%
{\ifcsname\??fontalternativeknown#alternative\endcsname \else
\font_helpers_register_alternative{#alternative}%
+ % todo: apptoks
\t_font_alternative_commands\expandafter{\the\t_font_alternative_commands
\m_font_alternative_command{#alternative}}%
\fi
@@ -821,22 +827,46 @@
\fi
\c_font_feature_inheritance_mode\c_font_feature_inheritance_default}
+% \def\font_helpers_check_body_scale#fontsize% gets character (x xx a etc)
+% {\ifcsname\??fontenvironments\fontclass\fontbody #fontsize\endcsname \setfalse\c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments\fontclass\fontbody #fontsize\endcsname \else
+% \ifcsname\??fontenvironments\fontclass\s!default#fontsize\endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments\fontclass\s!default#fontsize\endcsname \else
+% \ifcsname\??fontenvironments \fontbody #fontsize\endcsname \setfalse\c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments \fontbody #fontsize\endcsname \else
+% \ifcsname\??fontenvironments \s!default#fontsize\endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments \s!default#fontsize\endcsname \else
+% \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments\fontclass\s!default\s!text \endcsname \else
+% \ifcsname\??fontenvironments \s!default\s!text \endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
+% \csname\??fontenvironments \s!default\s!text \endcsname
+% \else
+% \settrue \c_font_body_scale
+% \let\f_font_body_scale\plusone
+% \fi\fi\fi\fi\fi\fi}
+
\def\font_helpers_check_body_scale#fontsize% gets character (x xx a etc)
- {\ifcsname\??fontenvironments\fontclass\fontbody #fontsize\endcsname \setfalse\c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments\fontclass\fontbody #fontsize\endcsname \else
- \ifcsname\??fontenvironments\fontclass\s!default#fontsize\endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments\fontclass\s!default#fontsize\endcsname \else
- \ifcsname\??fontenvironments \fontbody #fontsize\endcsname \setfalse\c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments \fontbody #fontsize\endcsname \else
- \ifcsname\??fontenvironments \s!default#fontsize\endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments \s!default#fontsize\endcsname \else
- \ifcsname\??fontenvironments\fontclass\s!default\s!text \endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments\fontclass\s!default\s!text \endcsname \else
- \ifcsname\??fontenvironments \s!default\s!text \endcsname \settrue \c_font_body_scale \expandafter\let\expandafter\f_font_body_scale
- \csname\??fontenvironments \s!default\s!text \endcsname
+ {\ifcsname\??fontenvironments\fontclass\fontbody#fontsize\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \setfalse\c_font_body_scale % !
+ \else\ifcsname\??fontenvironments\fontclass\s!default#fontsize\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \settrue\c_font_body_scale
+ \else\ifcsname\??fontenvironments\fontbody#fontsize\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \setfalse\c_font_body_scale % !
+ \else\ifcsname\??fontenvironments\s!default#fontsize\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \settrue\c_font_body_scale
+ \else\ifcsname\??fontenvironments\fontclass\s!default\s!text\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \settrue\c_font_body_scale
+ \else\ifcsname\??fontenvironments\s!default\s!text\endcsname
+ \expandafter\let\expandafter\f_font_body_scale\lastnamedcs
+ \settrue\c_font_body_scale
\else
- \settrue \c_font_body_scale
\let\f_font_body_scale\plusone
+ \settrue\c_font_body_scale
\fi\fi\fi\fi\fi\fi}
%D The following macros are used at the \LUA\ end. Watch the \type {\normal}
@@ -1629,6 +1659,7 @@
\def\font_helpers_define_unknown_check_sizes#body#relativesize%
{\ifcsname\??fontenvironments\s!default#relativesize\endcsname % fontclass ?
+ % how \lastnamedcs here
\expandafter\normalizebodyfontsize\csname\??fontenvironments#body#relativesize\endcsname{\csname\??fontenvironments\s!default#relativesize\endcsname\dimexpr#body\relax}%
\settrue\c_font_defining_state
\fi}
@@ -1637,12 +1668,14 @@
{\ifcsname\??fontdefinitions\s!default:#style\endcsname
\edef\m_font_asked_body{#body}%
\edef\m_font_asked_style{#style}%
- \csname\??fontdefinitions\s!default:#style\endcsname % {#body}{#style}%
+ %\csname\??fontdefinitions\s!default:#style\endcsname % {#body}{#style}%
+ \lastnamedcs
\settrue\c_font_defining_state
\fi}
\def\font_helpers_define_unknown_check_relatives#body#relativesize%
{\ifcsname\??fontbodyknown\csname\??fontenvironments#body#relativesize\endcsname\endcsname \else
+ % how \lastnamedcs here
\expandafter\font_helpers_define_unknown_font\csname\??fontenvironments#body#relativesize\endcsname
\settrue\c_font_defining_state
\fi}
@@ -2139,17 +2172,32 @@
}%
\global\expandafter\let\csname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces}
-\def\currentbodyfontdimension#parameter%
+% \def\currentbodyfontdimension#parameter%
+% {\the\dimexpr
+% \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname
+% \csname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname \else
+% \ifcsname\??fontenvironments\fontclass\s!default #parameter\endcsname
+% \csname\??fontenvironments\fontclass\s!default #parameter\endcsname
+% \dimexpr\normalizedbodyfontsize\relax \else % factor
+% \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname
+% \csname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \else
+% \csname\??fontenvironments \s!default #parameter\endcsname
+% \dimexpr\normalizedbodyfontsize\relax \fi\fi\fi % factor
+% \relax}
+
+\def\currentbodyfontdimension#parameter% there can be factors here
{\the\dimexpr
\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname
- \csname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname \else
- \ifcsname\??fontenvironments\fontclass\s!default #parameter\endcsname
- \csname\??fontenvironments\fontclass\s!default #parameter\endcsname
- \dimexpr\normalizedbodyfontsize\relax \else % factor
- \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname
- \csname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \else
- \csname\??fontenvironments \s!default #parameter\endcsname
- \dimexpr\normalizedbodyfontsize\relax \fi\fi\fi % factor
+ \lastnamedcs
+ \else\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname
+ \lastnamedcs
+ \dimexpr\normalizedbodyfontsize\relax
+ \else\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname
+ \lastnamedcs
+ \else
+ \csname\??fontenvironments\s!default#parameter\endcsname
+ \dimexpr\normalizedbodyfontsize\relax
+ \fi\fi\fi
\relax}
%D \macros
@@ -2233,7 +2281,8 @@
\unexpanded\def\fastswitchtobodyfont#name%
{\ifcsname\??fontenvironments\normalizedbodyfontsize#name\endcsname
- \edef\futurebodyfontsize{\csname\??fontenvironments\normalizedbodyfontsize#name\endcsname}%
+ %\edef\futurebodyfontsize{\csname\??fontenvironments\normalizedbodyfontsize#name\endcsname}%
+ \edef\futurebodyfontsize{\lastnamedcs}%
\ifcsname\??fontbodyknown\futurebodyfontsize\endcsname
\font_basics_complete_switch\futurebodyfontsize
\localbodyfontsize\futurebodyfontsize\relax
@@ -2449,7 +2498,8 @@
\unexpanded\def\predefinedfont[#1]% global !
{\ifcsname\??predefinedfont#1\endcsname
- \csname\??predefinedfont#1\endcsname
+ %\csname\??predefinedfont#1\endcsname
+ \lastnamedcs
\else
\font_basics_predefined{#1}%
\fi}
diff --git a/tex/context/base/font-nod.lua b/tex/context/base/font-nod.lua
index 62178da30..e0e0ca377 100644
--- a/tex/context/base/font-nod.lua
+++ b/tex/context/base/font-nod.lua
@@ -70,6 +70,7 @@ local getdisc = nuts.getdisc
local setfield = nuts.setfield
local setbox = nuts.setbox
local setchar = nuts.setchar
+local setsubtype = nuts.setsubtype
local copy_node_list = nuts.copy_list
local hpack_node_list = nuts.hpack
@@ -325,7 +326,7 @@ end
function tracers.fontchar(font,char)
local n = new_glyph(font,char)
- setfield(n,"subtype",256)
+ setsubtype(n,256)
context(tonode(n))
end
diff --git a/tex/context/base/font-otc.lua b/tex/context/base/font-otc.lua
index fccd38014..60aa94e3b 100644
--- a/tex/context/base/font-otc.lua
+++ b/tex/context/base/font-otc.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-otc'] = {
license = "see context related readme files"
}
-local format, insert, sortedkeys = string.format, table.insert, table.sortedkeys
+local format, insert, sortedkeys, tohash = string.format, table.insert, table.sortedkeys, table.tohash
local type, next = type, next
local lpegmatch = lpeg.match
local utfbyte = utf.byte
@@ -93,17 +93,18 @@ local function addfeature(data,feature,specifications)
end
local askedfeatures = specification.features or everywhere
local askedsteps = specifications.steps or specification.subtables or { specification.data } or { }
- local featuretype = normalized[specification.type or "substitution"] or "substitution"
+ local defaulttype = specification.type or "substitution"
local featureflags = specification.flags or noflags
local featureorder = specification.order or { feature }
local added = false
local nofsteps = 0
local steps = { }
for i=1,#askedsteps do
- local list = askedsteps[i]
- local coverage = { }
- local cover = coveractions[featuretype]
- local format = nil
+ local list = askedsteps[i]
+ local coverage = { }
+ local cover = coveractions[featuretype]
+ local format = nil
+ local featuretype = normalized[list.type or defaulttype] or "substitution"
if not cover then
-- unknown
elseif featuretype == "substitution" then
@@ -243,7 +244,7 @@ local function addfeature(data,feature,specifications)
-- script = { lang1, lang2, lang3 } or script = { lang1 = true, ... }
for k, v in next, askedfeatures do
if v[1] then
- askedfeatures[k] = table.tohash(v)
+ askedfeatures[k] = tohash(v)
end
end
local sequence = {
diff --git a/tex/context/base/font-otl.lua b/tex/context/base/font-otl.lua
index 8844bd5c6..8a7717a19 100644
--- a/tex/context/base/font-otl.lua
+++ b/tex/context/base/font-otl.lua
@@ -53,7 +53,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.008 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.009 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
local otfreaders = otf.readers
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua
index f87cd1ab5..8df01bdbf 100644
--- a/tex/context/base/font-otn.lua
+++ b/tex/context/base/font-otn.lua
@@ -212,7 +212,9 @@ local tonut = nuts.tonut
local getfield = nuts.getfield
local setfield = nuts.setfield
local getnext = nuts.getnext
+local setnext = nuts.setnext
local getprev = nuts.getprev
+local setprev = nuts.setprev
local getid = nuts.getid
local getattr = nuts.getattr
local setattr = nuts.setattr
@@ -220,7 +222,9 @@ local getprop = nuts.getprop
local setprop = nuts.setprop
local getfont = nuts.getfont
local getsubtype = nuts.getsubtype
+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
@@ -411,8 +415,8 @@ local function flattendisk(head,disc)
if replace then
if next then
local tail = find_node_tail(replace)
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setnext(tail,next)
+ setprev(next,tail)
end
return replace, replace
elseif next then
@@ -426,17 +430,17 @@ local function flattendisk(head,disc)
if replace then
local tail = find_node_tail(replace)
if next then
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setnext(tail,next)
+ setprev(next,tail)
end
- setfield(prev,"next",replace)
- setfield(replace,"prev",prev)
+ setnext(prev,replace)
+ setprev(replace,prev)
return head, replace
else
if next then
- setfield(next,"prev",prev)
+ setprev(next,prev)
end
- setfield(prev,"next",next)
+ setnext(prev,next)
return head, next
end
end
@@ -450,14 +454,14 @@ local function appenddisc(disc,list)
local ptail = find_node_tail(post)
local rtail = find_node_tail(replace)
if post then
- setfield(ptail,"next",phead)
- setfield(phead,"prev",ptail)
+ setnext(ptail,phead)
+ setprev(phead,ptail)
else
setfield(disc,"post",phead)
end
if replace then
- setfield(rtail,"next",rhead)
- setfield(rhead,"prev",rtail)
+ setnext(rtail,rhead)
+ setprev(rhead,rtail)
else
setfield(disc,"replace",rhead)
end
@@ -471,24 +475,24 @@ local function markstoligature(kind,lookupname,head,start,stop,char)
else
local prev = getprev(start)
local next = getnext(stop)
- setfield(start,"prev",nil)
- setfield(stop,"next",nil)
+ setprev(start,nil)
+ setnext(stop,nil)
local base = copy_glyph(start)
if head == start then
head = base
end
resetinjection(base)
- setfield(base,"char",char)
- setfield(base,"subtype",ligature_code)
+ setchar(base,char)
+ setsubtype(base,ligature_code)
setfield(base,"components",start)
if prev then
- setfield(prev,"next",base)
+ setnext(prev,base)
end
if next then
- setfield(next,"prev",base)
+ setprev(next,base)
end
- setfield(base,"next",next)
- setfield(base,"prev",prev)
+ setnext(base,next)
+ setprev(base,prev)
return head, base
end
end
@@ -527,7 +531,7 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun
end
if start == stop and getchar(start) == char then
resetinjection(start)
- setfield(start,"char",char)
+ setchar(start,char)
return head, start
end
-- needs testing (side effects):
@@ -540,24 +544,24 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun
local prev = getprev(start)
local next = getnext(stop)
local comp = start
- setfield(start,"prev",nil)
- setfield(stop,"next",nil)
+ setprev(start,nil)
+ setnext(stop,nil)
local base = copy_glyph(start)
if start == head then
head = base
end
resetinjection(base)
- setfield(base,"char",char)
- setfield(base,"subtype",ligature_code)
+ setchar(base,char)
+ setsubtype(base,ligature_code)
setfield(base,"components",comp) -- start can have components ... do we need to flush?
if prev then
- setfield(prev,"next",base)
+ setnext(prev,base)
end
if next then
- setfield(next,"prev",base)
+ setprev(next,base)
end
- setfield(base,"prev",prev)
- setfield(base,"next",next)
+ setprev(base,prev)
+ setnext(base,next)
if not discfound then
local deletemarks = markflag ~= "mark"
local components = start
@@ -601,8 +605,8 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun
end
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
- local discprev = getfield(discfound,"prev")
- local discnext = getfield(discfound,"next")
+ local discprev = getprev(discfound)
+ local discnext = getnext(discfound)
if discprev and discnext then
-- we assume normalization in context, and don't care about generic ... especially
-- \- can give problems as there we can have a negative char but that won't match
@@ -611,34 +615,34 @@ local function toligature(kind,lookupname,head,start,stop,char,markflag,discfoun
local post = getfield(discfound,"post")
local replace = getfield(discfound,"replace")
if not replace then -- todo: signal simple hyphen
- local prev = getfield(base,"prev")
+ local prev = getprev(base)
local copied = copy_node_list(comp)
- setfield(discnext,"prev",nil) -- also blocks funny assignments
- setfield(discprev,"next",nil) -- also blocks funny assignments
+ setprev(discnext,nil) -- also blocks funny assignments
+ setnext(discprev,nil) -- also blocks funny assignments
if pre then
- setfield(discprev,"next",pre)
- setfield(pre,"prev",discprev)
+ setnext(discprev,pre)
+ setprev(pre,discprev)
end
pre = comp
if post then
local tail = find_node_tail(post)
- setfield(tail,"next",discnext)
- setfield(discnext,"prev",tail)
- setfield(post,"prev",nil)
+ setnext(tail,discnext)
+ setprev(discnext,tail)
+ setprev(post,nil)
else
post = discnext
end
- setfield(prev,"next",discfound)
- setfield(discfound,"prev",prev)
- setfield(discfound,"next",next)
- setfield(next,"prev",discfound)
- setfield(base,"next",nil)
- setfield(base,"prev",nil)
+ setnext(prev,discfound)
+ setprev(discfound,prev)
+ setnext(discfound,next)
+ setprev(next,discfound)
+ setnext(base,nil)
+ setprev(base,nil)
setfield(base,"components",copied)
setfield(discfound,"pre",pre)
setfield(discfound,"post",post)
setfield(discfound,"replace",base)
- setfield(discfound,"subtype",discretionary_code)
+ setsubtype(discfound,discretionary_code)
base = prev -- restart
end
end
@@ -650,7 +654,7 @@ local function multiple_glyphs(head,start,multiple,ignoremarks)
local nofmultiples = #multiple
if nofmultiples > 0 then
resetinjection(start)
- setfield(start,"char",multiple[1])
+ setchar(start,multiple[1])
if nofmultiples > 1 then
local sn = getnext(start)
for k=2,nofmultiples do -- todo: use insert_node
@@ -661,13 +665,13 @@ local function multiple_glyphs(head,start,multiple,ignoremarks)
-- end
local n = copy_node(start) -- ignore components
resetinjection(n)
- setfield(n,"char",multiple[k])
- setfield(n,"prev",start)
- setfield(n,"next",sn)
+ setchar(n,multiple[k])
+ setprev(n,start)
+ setnext(n,sn)
if sn then
- setfield(sn,"prev",n)
+ setprev(sn,n)
end
- setfield(start,"next",n)
+ setnext(start,n)
start = n
end
end
@@ -719,7 +723,7 @@ function handlers.gsub_single(head,start,kind,lookupname,replacement)
logprocess("%s: replacing %s by single %s",pref(kind,lookupname),gref(getchar(start)),gref(replacement))
end
resetinjection(start)
- setfield(start,"char",replacement)
+ setchar(start,replacement)
return head, start, true
end
@@ -731,7 +735,7 @@ function handlers.gsub_alternate(head,start,kind,lookupname,alternative,sequence
logprocess("%s: replacing %s by alternative %a to %s, %s",pref(kind,lookupname),gref(getchar(start)),choice,gref(choice),comment)
end
resetinjection(start)
- setfield(start,"char",choice)
+ setchar(start,choice)
else
if trace_alternatives then
logwarning("%s: no variant %a for %s, %s",pref(kind,lookupname),value,gref(getchar(start)),comment)
@@ -829,7 +833,7 @@ function handlers.gsub_ligature(head,start,kind,lookupname,ligature,sequence)
else
-- weird but happens (in some arabic font)
resetinjection(start)
- setfield(start,"char",lig)
+ setchar(start,lig)
if trace_ligatures then
logprocess("%s: replacing %s by (no real) ligature %s case 3",pref(kind,lookupname),gref(startchar),gref(lig))
end
@@ -1206,7 +1210,7 @@ function chainprocs.reversesub(head,start,stop,kind,chainname,currentcontext,loo
logprocess("%s: single reverse replacement of %s by %s",cref(kind,chainname),gref(char),gref(replacement))
end
resetinjection(start)
- setfield(start,"char",replacement)
+ setchar(start,replacement)
return head, start, true
else
return head, start, false
@@ -1237,7 +1241,7 @@ as less as needed but that would also make the code even more messy.</p>
-- repeat -- start x x m x x stop => start m
-- local next = getnext(start)
-- if not marks[getchar(next)] then
--- local components = getfield(next,"components")
+-- local components = getnext(next,"components")
-- if components then -- probably not needed
-- flush_node_list(components)
-- end
@@ -1290,7 +1294,7 @@ function chainprocs.gsub_single(head,start,stop,kind,chainname,currentcontext,lo
logprocess("%s: replacing single %s by %s",cref(kind,chainname,chainlookupname,lookupname,chainindex),gref(currentchar),gref(replacement))
end
resetinjection(current)
- setfield(current,"char",replacement)
+ setchar(current,replacement)
end
end
return head, start, true
@@ -1367,7 +1371,7 @@ function chainprocs.gsub_alternate(head,start,stop,kind,chainname,currentcontext
logprocess("%s: replacing %s by alternative %a to %s, %s",cref(kind,chainname,chainlookupname,lookupname),gref(char),choice,gref(choice),comment)
end
resetinjection(start)
- setfield(start,"char",choice)
+ setchar(start,choice)
else
if trace_alternatives then
logwarning("%s: no variant %a for %s, %s",cref(kind,chainname,chainlookupname,lookupname),value,gref(char),comment)
@@ -1935,13 +1939,13 @@ local function chaindisk(head,start,last,kind,chainname,ck,lookuphash,chainlooku
local tail = nil
if prev then
tail = prev
- setfield(current,"prev",sweepnode)
+ setprev(current,sweepnode)
else
tail = find_node_tail(head)
end
- setfield(sweepnode,"next",current)
- setfield(head,"prev",nil)
- setfield(tail,"next",nil)
+ setnext(sweepnode,current)
+ setprev(head,nil)
+ setnext(tail,nil)
appenddisc(sweepnode,head)
end
end
@@ -2035,12 +2039,12 @@ local function chaindisk(head,start,last,kind,chainname,ck,lookuphash,chainlooku
cprev = getprev(cprev)
end
- setfield(lookaheaddisc,"prev",cprev)
+ setprev(lookaheaddisc,cprev)
if cprev then
- setfield(cprev,"next",lookaheaddisc)
+ setnext(cprev,lookaheaddisc)
end
- setfield(cf,"prev",nil)
- setfield(cl,"next",nil)
+ setprev(cf,nil)
+ setnext(cl,nil)
if startishead then
head = lookaheaddisc
end
@@ -2063,13 +2067,13 @@ local function chaindisk(head,start,last,kind,chainname,ck,lookuphash,chainlooku
new, cnew, ok = chainproc(new,cnew,clast,kind,chainname,ck,lookuphash,chainlookup,chainlookupname,nil,sequence)
end
if pre then
- setfield(cl,"next",pre)
- setfield(pre,"prev",cl)
+ setnext(cl,pre)
+ setprev(pre,cl)
end
if replace then
local tail = find_node_tail(new)
- setfield(tail,"next",replace)
- setfield(replace,"prev",tail)
+ setnext(tail,replace)
+ setprev(replace,tail)
end
setfield(lookaheaddisc,"pre",cf) -- also updates tail
setfield(lookaheaddisc,"replace",new) -- also updates tail
@@ -2091,11 +2095,11 @@ local function chaindisk(head,start,last,kind,chainname,ck,lookuphash,chainlooku
cnext = getnext(cnext)
end
if cnext then
- setfield(cnext,"prev",backtrackdisc)
+ setprev(cnext,backtrackdisc)
end
- setfield(backtrackdisc,"next",cnext)
- setfield(cf,"prev",nil)
- setfield(cl,"next",nil)
+ setnext(backtrackdisc,cnext)
+ setprev(cf,nil)
+ setnext(cl,nil)
local replace = getfield(backtrackdisc,"replace")
local post = getfield(backtrackdisc,"post")
local new = copy_node_list(cf)
@@ -2115,15 +2119,15 @@ local function chaindisk(head,start,last,kind,chainname,ck,lookuphash,chainlooku
end
if post then
local tail = find_node_tail(post)
- setfield(tail,"next",cf)
- setfield(cf,"prev",tail)
+ setnext(tail,cf)
+ setprev(cf,tail)
else
post = cf
end
if replace then
local tail = find_node_tail(replace)
- setfield(tail,"next",new)
- setfield(new,"prev",tail)
+ setnext(tail,new)
+ setprev(new,tail)
else
replace = new
end
@@ -2893,11 +2897,11 @@ local function kernrun(disc,run)
-- go on
elseif prev then
local nest = getprev(pre)
- setfield(pre,"prev",prev)
- setfield(prev,"next",pre)
+ setprev(pre,prev)
+ setnext(prev,pre)
run(prevmarks,"preinjections")
- setfield(pre,"prev",nest)
- setfield(prev,"next",disc)
+ setprev(pre,nest)
+ setnext(prev,disc)
else
run(pre,"preinjections")
end
@@ -2906,48 +2910,48 @@ local function kernrun(disc,run)
-- go on
elseif next then
local tail = find_node_tail(post)
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setnext(tail,next)
+ setprev(next,tail)
run(post,"postinjections",next)
- setfield(tail,"next",nil)
- setfield(next,"prev",disc)
+ setnext(tail,nil)
+ setprev(next,disc)
else
run(post,"postinjections")
end
--
if not replace and prev and next then
-- this should be already done by discfound
- setfield(prev,"next",next)
- setfield(next,"prev",prev)
+ setnext(prev,next)
+ setprev(next,prev)
run(prevmarks,"injections",next)
- setfield(prev,"next",disc)
- setfield(next,"prev",disc)
+ setnext(prev,disc)
+ setprev(next,disc)
elseif prev and next then
local tail = find_node_tail(replace)
local nest = getprev(replace)
- setfield(replace,"prev",prev)
- setfield(prev,"next",replace)
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setprev(replace,prev)
+ setnext(prev,replace)
+ setnext(tail,next)
+ setprev(next,tail)
run(prevmarks,"replaceinjections",next)
- setfield(replace,"prev",nest)
- setfield(prev,"next",disc)
- setfield(tail,"next",nil)
- setfield(next,"prev",disc)
+ setprev(replace,nest)
+ setnext(prev,disc)
+ setnext(tail,nil)
+ setprev(next,disc)
elseif prev then
local nest = getprev(replace)
- setfield(replace,"prev",prev)
- setfield(prev,"next",replace)
+ setprev(replace,prev)
+ setnext(prev,replace)
run(prevmarks,"replaceinjections")
- setfield(replace,"prev",nest)
- setfield(prev,"next",disc)
+ setprev(replace,nest)
+ setnext(prev,disc)
elseif next then
local tail = find_node_tail(replace)
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setnext(tail,next)
+ setprev(next,tail)
run(replace,"replaceinjections",next)
- setfield(tail,"next",nil)
- setfield(next,"prev",disc)
+ setnext(tail,nil)
+ setprev(next,disc)
else
run(replace,"replaceinjections")
end
@@ -3004,21 +3008,21 @@ local function testrun(disc,trun,crun) -- use helper
-- only look ahead
local tail = find_node_tail(replace)
-- local nest = getprev(replace)
- setfield(tail,"next",next)
- setfield(next,"prev",tail)
+ setnext(tail,next)
+ setprev(next,tail)
if trun(replace,next) then
setfield(disc,"replace",nil) -- beware, side effects of nest so first
- setfield(prev,"next",replace)
- setfield(replace,"prev",prev)
- setfield(next,"prev",tail)
- setfield(tail,"next",next)
- setfield(disc,"prev",nil)
- setfield(disc,"next",nil)
+ setnext(prev,replace)
+ setprev(replace,prev)
+ setprev(next,tail)
+ setnext(tail,next)
+ setprev(disc,nil)
+ setnext(disc,nil)
flush_node_list(disc)
return replace -- restart
else
- setfield(tail,"next",nil)
- setfield(next,"prev",disc)
+ setnext(tail,nil)
+ setprev(next,disc)
end
else
-- weird case
@@ -3040,11 +3044,11 @@ local function discrun(disc,drun,krun)
report_run("disc") -- will be more detailed
end
if next and prev then
- setfield(prev,"next",next)
- -- setfield(next,"prev",prev)
+ setnext(prev,next)
+ -- setprev(next,prev)
drun(prev)
- setfield(prev,"next",disc)
- -- setfield(next,"prev",disc)
+ setnext(prev,disc)
+ -- setprev(next,disc)
end
--
local pre = getfield(disc,"pre")
@@ -3052,11 +3056,11 @@ local function discrun(disc,drun,krun)
-- go on
elseif prev then
local nest = getprev(pre)
- setfield(pre,"prev",prev)
- setfield(prev,"next",pre)
+ setprev(pre,prev)
+ setnext(prev,pre)
krun(prev,"preinjections")
- setfield(pre,"prev",nest)
- setfield(prev,"next",disc)
+ setprev(pre,nest)
+ setnext(prev,disc)
else
krun(pre,"preinjections")
end
diff --git a/tex/context/base/font-otr.lua b/tex/context/base/font-otr.lua
index a5cb58c63..1de255eba 100644
--- a/tex/context/base/font-otr.lua
+++ b/tex/context/base/font-otr.lua
@@ -86,6 +86,8 @@ local utf16_to_utf8_be = utf.utf16_to_utf8_be
local report = logs.reporter("otf reader")
+local trace_cmap = false -- only for checking issues
+
fonts = fonts or { }
local handlers = fonts.handlers or { }
fonts.handlers = handlers
@@ -1159,6 +1161,9 @@ formatreaders[4] = function(f,fontdata,offset)
if startchar == 0xFFFF and endchar == 0xFFFF then
break
elseif offset == 0 then
+ if trace_cmap then
+ report("format 4.%i from %C to %C at index %H",1,startchar,endchar,mod(startchar + delta,65536))
+ end
for unicode=startchar,endchar do
index = mod(unicode + delta,65536)
if index and index > 0 then
@@ -1188,6 +1193,9 @@ formatreaders[4] = function(f,fontdata,offset)
end
else
local shift = (segment-nofsegments+offset/2) - startchar
+ if trace_cmap then
+ report("format 4.%i from %C to %C at index %H",2,startchar,endchar,mod(indices[shift+startchar]+delta,65536))
+ end
for unicode=startchar,endchar do
local slot = shift + unicode
local index = indices[slot]
@@ -1223,13 +1231,20 @@ formatreaders[4] = function(f,fontdata,offset)
end
formatreaders[6] = function(f,fontdata,offset)
- setposition(f,offset+2+2+2) -- skip format length language
+ setposition(f,offset) -- + 2 + 2 + 2 -- skip format length language
+ local format = readushort(f)
+ local length = readushort(f)
+ local language = readushort(f)
local mapping = fontdata.mapping
local glyphs = fontdata.glyphs
local duplicates = fontdata.duplicates
local start = readushort(f)
local count = readushort(f)
- for unicode=start,start+count-1 do
+ local stop = start+count-1
+ if trace_cmap then
+ report("format 6 from %C to %C",2,start,stop)
+ end
+ for unicode=start,stop do
local index = readushort(f)
if index > 0 then
local glyph = glyphs[index]
@@ -1237,7 +1252,9 @@ formatreaders[6] = function(f,fontdata,offset)
local gu = glyph.unicode
if not gu then
glyph.unicode = unicode
- else
+ elseif gu ~= unicode then
+ -- report("format 6 overloading %C to %C",gu,unicode)
+ -- glyph.unicode = unicode
-- no duplicates ... weird side effects in lm
end
if not mapping[index] then
@@ -1258,6 +1275,9 @@ formatreaders[12] = function(f,fontdata,offset)
local first = readulong(f)
local last = readulong(f)
local index = readulong(f)
+ if trace_cmap then
+ report("format 12 from %C to %C",first,last)
+ end
for unicode=first,last do
local glyph = glyphs[index]
if glyph then
@@ -1410,7 +1430,8 @@ function readers.cmap(f,fontdata,specification)
ok = checkcmap(f,fontdata,records,3,10,12) or ok
ok = checkcmap(f,fontdata,records,0, 3, 4) or ok
ok = checkcmap(f,fontdata,records,0, 1, 4) or ok
- ok = checkcmap(f,fontdata,records,1, 0, 6) or ok
+ ok = checkcmap(f,fontdata,records,0, 0, 6) or ok
+ ok = checkcmap(f,fontdata,records,3, 0, 6) or ok
-- ok = checkcmap(f,fontdata,records,3, 0, 4) or ok -- maybe
-- 1 0 0
if not ok then
diff --git a/tex/context/base/font-ots.lua b/tex/context/base/font-ots.lua
index dd50a2e62..40319ae99 100644
--- a/tex/context/base/font-ots.lua
+++ b/tex/context/base/font-ots.lua
@@ -172,6 +172,7 @@ local setprev = nuts.setprev
local setlink = nuts.setlink
local setboth = nuts.setboth
local setchar = nuts.setchar
+local setsubtype = nuts.setsubtype
local ischar = nuts.is_char
@@ -517,7 +518,7 @@ local function markstoligature(head,start,stop,char)
end
resetinjection(base)
setchar(base,char)
- setfield(base,"subtype",ligature_code)
+ setsubtype(base,ligature_code)
setfield(base,"components",start)
setlink(prev,base)
setlink(base,next)
@@ -580,7 +581,7 @@ local function toligature(head,start,stop,char,dataset,sequence,markflag,discfou
end
resetinjection(base)
setchar(base,char)
- setfield(base,"subtype",ligature_code)
+ setsubtype(base,ligature_code)
setfield(base,"components",comp) -- start can have components .. do we need to flush?
if prev then
setnext(prev,base)
diff --git a/tex/context/base/font-oup.lua b/tex/context/base/font-oup.lua
index c740b5e55..64d658d6a 100644
--- a/tex/context/base/font-oup.lua
+++ b/tex/context/base/font-oup.lua
@@ -323,12 +323,16 @@ local function copyduplicates(fontdata)
if duplicates then
for u, d in next, duplicates do
local du = descriptions[u]
- local t = { f_character(u) }
- for u in next, d do
- descriptions[u] = copy(du)
- t[#t+1] = f_character(u)
+ if du then
+ local t = { f_character(u) }
+ for u in next, d do
+ descriptions[u] = copy(du)
+ t[#t+1] = f_character(u)
+ end
+ report("duplicates: % t",t)
+ else
+ -- what a mess
end
- report("duplicates: % t",t)
end
end
end
@@ -583,7 +587,20 @@ local function unifyglyphs(fontdata,usenames)
local glyph = glyphs[index]
local unicode = glyph.unicode -- this is the primary one
if not unicode then
- -- report("assigning private unicode %U to glyph indexed %05X",index,private)
+ -- report("assigning private unicode %U to glyph indexed %05X (%s)",private,index,"unset")
+ unicode = private
+ -- glyph.unicode = -1
+ if names then
+ local name = glyph.name or f_private(unicode)
+ indices[index] = name
+ names[name] = unicode
+ else
+ indices[index] = unicode
+ end
+ private = private + 1
+ elseif descriptions[unicode] then
+ -- real weird
+report("assigning private unicode %U to glyph indexed %05X (%C)",private,index,unicode)
unicode = private
-- glyph.unicode = -1
if names then
diff --git a/tex/context/base/font-sol.lua b/tex/context/base/font-sol.lua
index ea9ac99bc..eca51cd61 100644
--- a/tex/context/base/font-sol.lua
+++ b/tex/context/base/font-sol.lua
@@ -70,6 +70,7 @@ local setfield = nuts.setfield
local setattr = nuts.setattr
local setlink = nuts.setlink
local setnext = nuts.setnext
+local setlist = nuts.setlist
local find_node_tail = nuts.tail
local free_node = nuts.free
@@ -759,7 +760,7 @@ function splitters.optimize(head)
-- nasty .. we always assume a prev being there .. future luatex will always have a leftskip set
-- is this assignment ok ? .. needs checking
list = insert_node_before(list,list,new_leftskip(0)) -- new_glue(0)
- setfield(current,"list",list)
+ setlist(current,list)
end
local temp, badness = repack_hlist(list,width,'exactly',dir) -- it would be nice if the badness was stored in the node
if badness > 0 then
@@ -819,7 +820,7 @@ function splitters.optimize(head)
local words = collect_words(list)
for best=lastbest or 1,max do
local temp, done, changes, b = optimize(words,list,best,width,badness,line,set,dir)
- setfield(current,"list",temp)
+ setlist(current,temp)
if trace_optimize then
report_optimizers("line %a, alternative %a, changes %a, badness %a",line,best,changes,b)
end
@@ -838,7 +839,7 @@ function splitters.optimize(head)
end
-- we pack inside the outer hpack and that way keep the original wd/ht/dp as bonus
local list = hpack_nodes(getlist(current),width,'exactly',listdir)
- setfield(current,"list",list)
+ setlist(current,list)
end
for i=1,nc do
local ci = cache[i]
diff --git a/tex/context/base/lang-dis.lua b/tex/context/base/lang-dis.lua
index ca520654a..ab62cc479 100644
--- a/tex/context/base/lang-dis.lua
+++ b/tex/context/base/lang-dis.lua
@@ -25,6 +25,7 @@ local getid = nuts.getid
local getfont = nuts.getfont
local getattr = nuts.getattr
local getsubtype = nuts.getsubtype
+local setsubtype = nuts.setsubtype
local getchar = nuts.getchar
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
@@ -134,13 +135,11 @@ local expanders = {
if prechar and prechar > 0 then
done = true
pre = copy_node(template)
- -- setfield(pre,"char",prechar)
setchar(pre,prechar)
end
if postchar and postchar > 0 then
done = true
post = copy_node(template)
- -- setfield(post,"char",postchar)
setchar(post,postchar)
end
if done then
@@ -152,7 +151,7 @@ local expanders = {
return template
else
-- maybe also set penalty here
- setfield(d,"subtype",discretionary_code)
+ setsubtype(d,discretionary_code)
end
end,
[disccodes.first] = function()
diff --git a/tex/context/base/lpdf-res.lua b/tex/context/base/lpdf-res.lua
index 172d74681..587c54578 100644
--- a/tex/context/base/lpdf-res.lua
+++ b/tex/context/base/lpdf-res.lua
@@ -13,6 +13,7 @@ local nuts = nodes.nuts
local tonut = nodes.tonut
local setfield = nuts.setfield
+local setlist = nuts.setlist
local new_hlist = nuts.pool.hlist
@@ -27,7 +28,7 @@ end
function codeinjections.restoreboxresource(index)
local hbox = new_hlist()
local list, wd, ht, dp = useboxresource(index)
- setfield(hbox,"list", tonut(list))
+ setlist(hbox,tonut(list))
setfield(hbox,"width", wd)
setfield(hbox,"height", ht)
setfield(hbox,"depth", dp)
diff --git a/tex/context/base/lpdf-tag.lua b/tex/context/base/lpdf-tag.lua
index 3fa8883cb..f20e4bfe8 100644
--- a/tex/context/base/lpdf-tag.lua
+++ b/tex/context/base/lpdf-tag.lua
@@ -66,6 +66,7 @@ local getlist = nuts.getlist
local setfield = nuts.setfield
local setlink = nuts.setlink
+local setlist = nuts.setlist
local traverse_nodes = nuts.traverse
local tosequence = nuts.tosequence
@@ -429,7 +430,7 @@ function nodeinjections.addtags(head)
end
setlink(literal,start)
if list and getlist(list) == start then
- setfield(list,"list",literal)
+ setlist(list,literal)
end
-- use insert instead:
local literal = pdfliteral("EMC")
@@ -572,7 +573,7 @@ end
-- end
-- setlink(literal,start)
-- if list and getlist(list) == start then
--- setfield(list,"list",literal)
+-- setlist(list,literal)
-- end
-- end
--
diff --git a/tex/context/base/luat-ini.mkiv b/tex/context/base/luat-ini.mkiv
index ec0572f32..e19b72d14 100644
--- a/tex/context/base/luat-ini.mkiv
+++ b/tex/context/base/luat-ini.mkiv
@@ -261,9 +261,9 @@
% \def\checkedstrippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx}
% {\expandafter\syst_helpers_checked_stripped_csname\string#1}
-
-\def\syst_helpers_checked_stripped_csname#1%
- {\if\noexpand#1\letterbackslash\else#1\fi}
+%
+% \def\syst_helpers_checked_stripped_csname#1%
+% {\if\noexpand#1\letterbackslash\else#1\fi}
\normalprotected\def\installctxfunction#1#2%
{\edef\m_syst_name{\csstring#1}%
diff --git a/tex/context/base/math-dir.lua b/tex/context/base/math-dir.lua
index e15522191..c9c2a38dd 100644
--- a/tex/context/base/math-dir.lua
+++ b/tex/context/base/math-dir.lua
@@ -35,6 +35,7 @@ local getattr = nuts.getattr
local setfield = nuts.setfield
local setchar = nuts.setchar
+local setlist = nuts.setlist
local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
@@ -109,7 +110,7 @@ local function processmath(head)
-- nothing
if id == hlist_code or id == vlist_code then
local list, d = processmath(getlist(current))
- setfield(current,"list",list)
+ setlist(current,list)
if d then
done = true
end
@@ -122,7 +123,7 @@ end
-- too often: needs checking
if id == hlist_code or id == vlist_code then
local list, d = processmath(getlist(current))
- setfield(current,"list",list)
+ setlist(current,list)
if d then
done = true
end
diff --git a/tex/context/base/math-frc.mkiv b/tex/context/base/math-frc.mkiv
index 76c2f81fb..35b938fbb 100644
--- a/tex/context/base/math-frc.mkiv
+++ b/tex/context/base/math-frc.mkiv
@@ -169,6 +169,10 @@
\installcorenamespace{mathfractionstrut}
+\def\math_frac_no_strut
+ {\let\m_fractions_strut_top\relax
+ \let\m_fractions_strut_bot\relax}
+
\setvalue{\??mathfractionstrut\v!yes}%
{\let\m_fractions_strut_top\mathstrut
\let\m_fractions_strut_bot\mathstrut}
@@ -177,16 +181,13 @@
{\let\m_fractions_strut_top\mathstrut
\let\m_fractions_strut_bot\mathstrut}
-\setvalue{\??mathfractionstrut\v!no}%
- {\let\m_fractions_strut_top\relax
- \let\m_fractions_strut_bot\relax}
+\letvalue{\??mathfractionstrut\v!no}\math_frac_no_strut
\setvalue{\??mathfractionstrut\v!tight}%
{\let\m_fractions_strut_top\mathbotstrut % indeed swapped name
\let\m_fractions_strut_bot\mathtopstrut} % indeed swapped name
-\let\m_fractions_strut_top\relax
-\let\m_fractions_strut_bot\relax
+\math_frac_no_strut
\newdimen\d_math_fraction_margin
@@ -199,10 +200,11 @@
\edef\p_math_fractions_color{\mathfractionparameter\c!color}%
%
\edef\p_math_fractions_strut{\mathfractionparameter\c!strut}%
- \csname
- \??mathfractionstrut
- \ifcsname\??mathfractionstrut\p_math_fractions_strut\endcsname\p_math_fractions_strut\else\v!no\fi
- \endcsname
+ \ifcsname\??mathfractionstrut\p_math_fractions_strut\endcsname
+ \lastnamedcs
+ \else
+ \math_frac_no_strut
+ \fi
%
\ifx\p_math_fractions_color\empty
\expandafter\math_frac_normal
@@ -363,7 +365,8 @@
\edef\p_distance{\rootmathfractionparameter\c!distance}%
\ifx\p_distance\empty\else
\ifcsname\??mathfractiondistance\p_distance\endcsname
- \csname\??mathfractiondistance\p_distance\endcsname
+ %\csname\??mathfractiondistance\p_distance\endcsname
+ \lastnamedcs
\fi
\fi
\to \everymathematics
diff --git a/tex/context/base/math-noa.lua b/tex/context/base/math-noa.lua
index 2c988077b..74d947415 100644
--- a/tex/context/base/math-noa.lua
+++ b/tex/context/base/math-noa.lua
@@ -87,6 +87,8 @@ local setlink = nuts.setlink
local setnext = nuts.setnext
local setprev = nuts.setprev
local setchar = nuts.setchar
+local setsubtype = nuts.setsubtype
+local setattr = nuts.setattr
local getfield = nuts.getfield
local getnext = nuts.getnext
@@ -97,7 +99,6 @@ local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local getfont = nuts.getfont
local getattr = nuts.getattr
-local setattr = nuts.setattr
local insert_node_after = nuts.insert_after
local insert_node_before = nuts.insert_before
@@ -726,7 +727,7 @@ local function makefence(what,char)
setfield(d,"small_fam", fam)
free_node(sym)
end
- setfield(f,"subtype",what)
+ setsubtype(f,what)
setfield(f,"delim",d)
return f
end
@@ -734,7 +735,7 @@ end
local function makelist(noad,f_o,o_next,c_prev,f_c,middle)
local list = new_node(math_sub)
setfield(list,"head",f_o)
- setfield(noad,"subtype",noad_inner)
+ setsubtype(noad,noad_inner)
setfield(noad,"nucleus",list)
setlink(f_o,o_next)
setlink(c_prev,f_c)
@@ -1704,7 +1705,7 @@ do
setchar(pointer,chr)
end
if cls and cls ~= getsubtype(parent) then
- setfield(parent,"subtype",cls)
+ setsubtype(parent,cls)
end
end
end
diff --git a/tex/context/base/node-acc.lua b/tex/context/base/node-acc.lua
index 097cb83d9..407e808cd 100644
--- a/tex/context/base/node-acc.lua
+++ b/tex/context/base/node-acc.lua
@@ -26,6 +26,7 @@ local setfield = nuts.setfield
local setattr = nuts.setattr
local setlink = nuts.setlink
local setchar = nuts.setchar
+local setsubtype = nuts.setsubtype
local traverse_nodes = nuts.traverse
local traverse_id = nuts.traverse_id
@@ -65,7 +66,7 @@ local function injectspaces(head)
if c then -- it happens that we copied a ligature
free_nodelist(c)
setfield(g,"components",nil)
- setfield(g,"subtype",256)
+ setsubtype(g,256)
end
local a = getattr(n,a_characters)
setchar(g,32)
diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua
index bcc0afa25..07c3965bc 100644
--- a/tex/context/base/node-aux.lua
+++ b/tex/context/base/node-aux.lua
@@ -40,6 +40,7 @@ local getfield = nuts.getfield
local setfield = nuts.setfield
local setattr = nuts.setattr
local setlink = nuts.setlink
+local setlist = nuts.setlist
local setnext = nuts.setnext
local setprev = nuts.setprev
@@ -95,8 +96,8 @@ local function takebox(id)
local copy = copy_node(box)
local list = getlist(box)
if list then
- setfield(copy,"list",list)
- setfield(box,"list",nil)
+ setlist(copy,list)
+ setlist(box,nil)
end
texsetbox(id,nil)
return copy
@@ -118,7 +119,7 @@ tex.takebox = nodes.takebox -- sometimes more clear
local function repackhlist(list,...)
local temp, b = hpack_nodes(list,...)
list = getlist(temp)
- setfield(temp,"list",nil)
+ setlist(temp)
free_node(temp)
return list, b
end
diff --git a/tex/context/base/node-bck.lua b/tex/context/base/node-bck.lua
index 1be0669ba..a095ac4c4 100644
--- a/tex/context/base/node-bck.lua
+++ b/tex/context/base/node-bck.lua
@@ -38,6 +38,7 @@ local getsubtype = nuts.getsubtype
local setfield = nuts.setfield
local setattr = nuts.setattr
local setlink = nuts.setlink
+local setlist = nuts.setlist
local traverse = nuts.traverse
local traverse_id = nuts.traverse_id
@@ -60,7 +61,7 @@ local function add_backgrounds(head) -- rather old code .. to be redone
if list then
local head = add_backgrounds(list)
if head then
- setfield(current,"list",head)
+ setlist(current,head)
list = head
end
end
@@ -90,7 +91,7 @@ local function add_backgrounds(head) -- rather old code .. to be redone
if list then
setlink(glue,list)
end
- setfield(current,"list",rule)
+ setlist(current,rule)
end
end
end
@@ -149,7 +150,7 @@ local function add_alignbackgrounds(head)
if list then
setlink(glue,list)
end
- setfield(current,"list",rule)
+ setlist(current,rule)
end
end
end
diff --git a/tex/context/base/node-fin.lua b/tex/context/base/node-fin.lua
index c062ddd00..313b804cb 100644
--- a/tex/context/base/node-fin.lua
+++ b/tex/context/base/node-fin.lua
@@ -20,7 +20,6 @@ local tonode = nuts.tonode
local tonut = nuts.tonut
local getfield = nuts.getfield
-local setfield = nuts.setfield
local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
@@ -28,6 +27,9 @@ local getlist = nuts.getlist
local getleader = nuts.getleader
local getattr = nuts.getattr
+local setlist = nuts.setlist
+local setleader = nuts.setleader
+
local copy_node = nuts.copy
local insert_node_before = nuts.insert_before
local insert_node_after = nuts.insert_after
@@ -163,10 +165,12 @@ function states.finalize(namespace,attribute,head) -- is this one ok?
head = tonut(head)
local id = getid(head)
if id == hlist_code or id == vlist_code then
- local list = getlist(head)
- if list then
- list = insert_node_before(list,list,copied(nsnone)) -- two return values
- setfield(head,"list",list)
+ local content = getlist(head)
+ if content then
+ local list = insert_node_before(content,content,copied(nsnone)) -- two return values
+ if list ~= content then
+ setlist(head,list)
+ end
end
else
head = insert_node_before(head,head,copied(nsnone))
@@ -203,22 +207,22 @@ local function process(namespace,attribute,head,inheritance,default) -- one attr
local outer = getattr(stack,attribute)
if outer ~= inheritance then
local list, ok = process(namespace,attribute,content,inheritance,outer)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
else
local list, ok = process(namespace,attribute,content,inheritance,default)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
end
else
local list, ok = process(namespace,attribute,content,inheritance,default)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
end
-- end nested --
@@ -257,22 +261,22 @@ end
local outer = getattr(stack,attribute)
if outer ~= inheritance then
local list, ok = process(namespace,attribute,leader,inheritance,outer)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
else
local list, ok = process(namespace,attribute,leader,inheritance,default)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
end
else
local list, ok = process(namespace,attribute,leader,inheritance,default)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
end
-- end nested --
@@ -332,22 +336,22 @@ local function selective(namespace,attribute,head,inheritance,default) -- two at
local outer = getattr(stack,attribute)
if outer ~= inheritance then
local list, ok = selective(namespace,attribute,content,inheritance,outer)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
else
local list, ok = selective(namespace,attribute,content,inheritance,default)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
end
else
local list, ok = selective(namespace,attribute,content,inheritance,default)
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = done or ok
end
-- end nested
@@ -384,22 +388,22 @@ end
local outer = getatribute(stack,attribute)
if outer ~= inheritance then
local list, ok = selective(namespace,attribute,leader,inheritance,outer)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
else
local list, ok = selective(namespace,attribute,leader,inheritance,default)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
end
else
local list, ok = selective(namespace,attribute,leader,inheritance,default)
-if leader ~= list then
- setfield(stack,"leader",list)
-end
+ if leader ~= list then
+ setleader(stack,list)
+ end
done = done or ok
end
-- end nested
@@ -464,24 +468,24 @@ local function stacked(namespace,attribute,head,default) -- no triggering, no in
current = a
head = insert_node_before(head,stack,copied(nsdata[a]))
local list = stacked(namespace,attribute,content,current) -- two return values
-if content ~= list then
- setfield(stack,"list",list)
-end
+ if content ~= list then
+ setlist(stack,list)
+ end
done = true
head, stack = insert_node_after(head,stack,copied(nsnone))
current = p
else
local list, ok = stacked(namespace,attribute,content,current)
-if content ~= list then
- setfield(stack,"list",list) -- only if ok
-end
+ if content ~= list then
+ setlist(stack,list) -- only if ok
+ end
done = done or ok
end
else
local list, ok = stacked(namespace,attribute,content,current)
-if content ~= list then
- setfield(stack,"list",list) -- only if ok
-end
+ if content ~= list then
+ setlist(stack,list) -- only if ok
+ end
done = done or ok
end
end
@@ -501,9 +505,9 @@ end
end
if leader then
local list, ok = stacked(namespace,attribute,content,current)
-if leader ~= list then
- setfield(stack,"leader",list) -- only if ok
-end
+ if leader ~= list then
+ setleader(stack,list) -- only if ok
+ end
done = done or ok
leader = false
end
@@ -562,17 +566,23 @@ local function stacker(namespace,attribute,head,default) -- no triggering, no in
if a and attrib ~= a and nslistwise[a] then -- viewerlayer
head = insert_node_before(head,current,copied(nsdata[a]))
local list = stacker(namespace,attribute,content,a)
- setfield(current,"list",list)
+ if list ~= content then
+ setlist(current,list)
+ end
done = true
head, current = insert_node_after(head,current,copied(nsnone))
else
local list, ok = stacker(namespace,attribute,content,attrib)
- setfield(current,"list",list)
+ if content ~= list then
+ setlist(current,list)
+ end
done = done or ok
end
else
local list, ok = stacker(namespace,attribute,content,default)
- setfield(current,"list",list)
+ if list ~= content then
+ setlist(current,list)
+ end
done = done or ok
end
elseif id == rule_code then
diff --git a/tex/context/base/node-ltp.lua b/tex/context/base/node-ltp.lua
index 5416959e8..fe7261aa2 100644
--- a/tex/context/base/node-ltp.lua
+++ b/tex/context/base/node-ltp.lua
@@ -207,10 +207,12 @@ local getdisc = nuts.getdisc
local setfield = nuts.setfield
local setlink = nuts.setlink
+local setlist = nuts.setlist
local setboth = nuts.setboth
local setnext = nuts.setnext
local setprev = nuts.setprev
local setdisc = nuts.setdisc
+local setsubtype = nuts.setsubtype
local slide_nodelist = nuts.slide -- get rid of this, probably ok > 78.2
local find_tail = nuts.tail
@@ -1227,7 +1229,7 @@ local function post_line_break(par)
if not (getid(v) == disc_code and getsubtype(v) == second_disc_code) then
report_parbuilders('unsupported disc at location %a',4)
end
- setfield(nextlast,"subtype",regular_disc_code)
+ setsubtype(nextlast,regular_disc_code)
setfield(nextlast,"replace",post)
setfield(lastnode,"post")
end
@@ -2641,7 +2643,7 @@ end
--
-- local hlist = new_node("hlist")
--
--- setfield(hlist,"list",head)
+-- setlist(hlist,head)
-- setfield(hlist,"dir",direction or tex.textdir)
-- setfield(hlist,"width",width)
-- setfield(hlist,"height",height)
@@ -2763,7 +2765,7 @@ local function hpack(head,width,method,direction,firstline,line) -- fast version
setfield(hlist,"width",width)
return hlist, 0
else
- setfield(hlist,"list",head)
+ setlist(hlist,head)
end
local cal_expand_ratio = method == "cal_expand_ratio" or method == "subst_ex_font"
diff --git a/tex/context/base/node-mig.lua b/tex/context/base/node-mig.lua
index 294af86ef..24bebb0cc 100644
--- a/tex/context/base/node-mig.lua
+++ b/tex/context/base/node-mig.lua
@@ -29,6 +29,7 @@ local getattr = nuts.getattr
local setfield = nuts.setfield
local setattr = nuts.setattr
local setlink = nuts.setlink
+local setlist = nuts.setlist
local setprev = nuts.setprev
local setnext = nuts.setnext
@@ -54,7 +55,7 @@ local function locate(head,first,last,ni,nm)
local list = getlist(current)
if list then
list, first, last, ni, nm = locate(list,first,last,ni,nm)
- setfield(current,"list",list)
+ setlist(current,list)
end
current = getnext(current)
elseif migrate_inserts and id == insert_code then
diff --git a/tex/context/base/node-nut.lua b/tex/context/base/node-nut.lua
index 4b5e36f6c..2edc57c1a 100644
--- a/tex/context/base/node-nut.lua
+++ b/tex/context/base/node-nut.lua
@@ -258,15 +258,18 @@ if not direct.mlist_to_hlist then
end
-nuts.getdisc = direct.getdisc
-nuts.setdisc = direct.setdisc
-nuts.setchar = direct.setchar
-nuts.setnext = direct.setnext
-nuts.setprev = direct.setprev
-nuts.setboth = direct.setboth
-nuts.getboth = direct.getboth
-nuts.setlink = direct.setlink
-nuts.is_char = direct.is_char
+nuts.getdisc = direct.getdisc
+nuts.setdisc = direct.setdisc
+nuts.setchar = direct.setchar
+nuts.setnext = direct.setnext
+nuts.setprev = direct.setprev
+nuts.setboth = direct.setboth
+nuts.getboth = direct.getboth
+nuts.setlink = direct.setlink
+nuts.setlist = direct.setlist or function(n,l) setfield(n,"list",l) end
+nuts.setleader = direct.setleader or function(n,l) setfield(n,"leader",l) end
+nuts.setsubtype = direct.setsubtype or function(n,s) setfield(n,"subtype",s) end
+nuts.is_char = direct.is_char
local d_remove_node = direct.remove
local d_free_node = direct.free
diff --git a/tex/context/base/node-ppt.lua b/tex/context/base/node-ppt.lua
index 6577fffba..2573e5f5c 100644
--- a/tex/context/base/node-ppt.lua
+++ b/tex/context/base/node-ppt.lua
@@ -29,6 +29,7 @@ local getsubtype = nuts.getsubtype
local getfield = nuts.getfield
local setfield = nuts.setfield
local getlist = nuts.getlist
+local setlist = nuts.setlist
local flushnode = nuts.flush
local removenode = nuts.remove
local traverse = nuts.traverse
@@ -253,7 +254,7 @@ local function delayed(head,parent) -- direct based
if list then
local done = delayed(list,parent)
if done then
- setfield(target,"list",done)
+ setlist(target,done)
end
if nofdelayed == 0 then
return head
diff --git a/tex/context/base/node-ref.lua b/tex/context/base/node-ref.lua
index 58e62067f..c6316917d 100644
--- a/tex/context/base/node-ref.lua
+++ b/tex/context/base/node-ref.lua
@@ -59,6 +59,7 @@ local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getattr = nuts.getattr
local setattr = nuts.setattr
local getsubtype = nuts.getsubtype
@@ -110,7 +111,7 @@ local function vlist_dimensions(start,stop)
local w = getfield(v,"width")
local h = getfield(v,"height")
local d = getfield(v,"depth")
- setfield(v,"list",nil)
+ setlist(v)
free_node(v)
if temp then
setnext(stop,temp)
@@ -210,7 +211,7 @@ local function inject_range(head,first,last,reference,make,stack,parent,pardir,t
reference,pardir or "---",txtdir or "---",
tosequence(l,nil,true),width,height,depth,resolved)
end
- setfield(line,"list",result)
+ setlist(line,result)
setlink(result,l)
return head, last
else
@@ -292,7 +293,7 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
reference,pardir or "---",txtdir or "----","[]",width,height,depth,resolved)
end
if not first then
- setfield(current,"list",result)
+ setlist(current,result)
elseif moveright then -- brr no prevs done
-- result after first
local n = getnext(first)
@@ -304,7 +305,7 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir)
else
-- first after result
setlink(result,first)
- setfield(current,"list",result)
+ setlist(current,result)
end
end
end
@@ -349,7 +350,7 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
if list then
local h, ok
h, ok , pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir)
- setfield(current,"list",h)
+ setlist(current,h)
end
if r then
done[r] = done[r] - 1
@@ -401,7 +402,7 @@ local function inject_area(head,attribute,make,stack,done,parent,pardir,txtdir)
end
local list = getlist(current)
if list then
- setfield(current,"list",(inject_area(list,attribute,make,stack,done,current,pardir,txtdir)))
+ setlist(current,(inject_area(list,attribute,make,stack,done,current,pardir,txtdir)))
end
elseif id == dir_code then
txtdir = getfield(current,"dir")
diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua
index 401a429bb..892cd62f2 100644
--- a/tex/context/base/node-res.lua
+++ b/tex/context/base/node-res.lua
@@ -72,6 +72,7 @@ local getlist = nuts.getlist
local setfield = nuts.setfield
local setchar = nuts.setchar
+local setlist = nuts.setlist
local copy_nut = nuts.copy
local new_nut = nuts.new
@@ -468,7 +469,7 @@ end
function nutpool.hlist(list,width,height,depth,shift)
local n = copy_nut(hlist)
if list then
- setfield(n,"list",list)
+ setlist(n,list)
end
if width and width ~= 0 then
setfield(n,"width",width)
@@ -488,7 +489,7 @@ end
function nutpool.vlist(list,width,height,depth,shift)
local n = copy_nut(vlist)
if list then
- setfield(n,"list",list)
+ setlist(n,list)
end
if width and width ~= 0 then
setfield(n,"width",width)
diff --git a/tex/context/base/node-rul.lua b/tex/context/base/node-rul.lua
index ec064f622..d341bbd53 100644
--- a/tex/context/base/node-rul.lua
+++ b/tex/context/base/node-rul.lua
@@ -31,6 +31,7 @@ local getfont = nuts.getfont
local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local getlist = nuts.getlist
+local setlist = nuts.setlist
local nodecodes = nodes.nodecodes
local tasks = nodes.tasks
@@ -203,7 +204,7 @@ local function processwords(attribute,data,flush,head,parent) -- we have hlistdi
end
local list = getlist(n)
if list then
- setfield(n,"list",(processwords(attribute,data,flush,list,n))) -- watch ()
+ 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
diff --git a/tex/context/base/node-shp.lua b/tex/context/base/node-shp.lua
index df1a3e585..19b99b12c 100644
--- a/tex/context/base/node-shp.lua
+++ b/tex/context/base/node-shp.lua
@@ -53,6 +53,8 @@ local getprev = nuts.getprev
local getlist = nuts.getlist
local getsubtype = nuts.getsubtype
+local setlist = nuts.setlist
+
local removables = {
[whatsitcodes.open] = true,
[whatsitcodes.close] = true,
@@ -111,7 +113,7 @@ local function cleanup_redundant(head) -- better name is: flatten_page
if sl then
local rl = cleanup_redundant(sl)
if rl ~= sl then
- setfield(start,"list",rl)
+ setlist(start,rl)
end
end
start = getnext(start)
@@ -137,7 +139,7 @@ local function cleanup_flushed(head) -- rough
if sl then
local rl = cleanup_flushed(sl)
if rl ~= sl then
- setfield(start,"list",rl)
+ setlist(start,rl)
end
end
start = getnext(start)
@@ -202,7 +204,7 @@ local function count(head,data,subcategory)
local dn = data[nodecodes[id]] -- we could use id and then later convert to nodecodes
dn[subcategory] = dn[subcategory] + 1
if id == hlist_code or id == vlist_code then
- count(getfield(n,"list"),data,subcategory)
+ count(getlist(n),data,subcategory)
end
end
end
diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua
index f1e91a4ae..32cd9738e 100644
--- a/tex/context/base/pack-rul.lua
+++ b/tex/context/base/pack-rul.lua
@@ -39,6 +39,7 @@ local setfield = nuts.setfield
local getnext = nuts.getnext
local getprev = nuts.getprev
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getid = nuts.getid
local getsubtype = nuts.getsubtype
local getbox = nuts.getbox
@@ -111,14 +112,14 @@ local function doreshapeframedbox(n)
if subtype == box_code or subtype == line_code then
local p = hpack(l,maxwidth,'exactly',getfield(h,"dir")) -- multiple return value
if false then
- setfield(h,"list",p)
+ setlist(h,p)
setfield(h,"shift",0) -- needed for display math, so no width check possible
-- setfield(p,"attr",getfield(h,"attr"))
else
setfield(h,"glue_set",getfield(p,"glue_set"))
setfield(h,"glue_order",getfield(p,"glue_order"))
setfield(h,"glue_sign",getfield(p,"glue_sign"))
- setfield(p,"list",nil)
+ setlist(p)
free_node(p)
end
end
diff --git a/tex/context/base/page-brk.mkiv b/tex/context/base/page-brk.mkiv
index bea011555..a25941ffc 100644
--- a/tex/context/base/page-brk.mkiv
+++ b/tex/context/base/page-brk.mkiv
@@ -62,7 +62,7 @@
\lastnamedcs
\else\ifcsname\??pagebreaks\page_breaks_current_option\endcsname
%\expandafter\page_breaks_handle\csname\??pagebreaks\page_breaks_current_option\endcsname
- \lastnamedcs
+ \expandafter\page_breaks_handle\lastnamedcs
\else
%\csname\??pagebreakmethod\s!unknown\endcsname
\page_breaks_unknown
diff --git a/tex/context/base/page-lin.lua b/tex/context/base/page-lin.lua
index 27f38c3d4..1124d80f9 100644
--- a/tex/context/base/page-lin.lua
+++ b/tex/context/base/page-lin.lua
@@ -432,9 +432,9 @@ function boxed.stage_two(n,m)
-- local w = getfield(n,"width")
-- ti = hpack_nodes(linked_nodes(new_kern(-w),ti,new_kern(w)))
-- end
- -- setfield(ti,"next",l)
- -- setfield(l,"prev",ti)
- -- setfield(n,"list",ti)
+ -- setnext(ti,l)
+ -- setprev(l,ti)
+ -- setlist(n,ti)
addtoline(n,ti)
resolve(n,m)
else
diff --git a/tex/context/base/page-mix.lua b/tex/context/base/page-mix.lua
index 2fb883c54..c844bd32d 100644
--- a/tex/context/base/page-mix.lua
+++ b/tex/context/base/page-mix.lua
@@ -53,6 +53,7 @@ local slidenodes = nuts.slide -- ok here as we mess with prev links int
local getfield = nuts.getfield
local setfield = nuts.setfield
local setlink = nuts.setlink
+local setlist = nuts.setlist
local setnext = nuts.setnext
local setprev = nuts.setprev
local setbox = nuts.setbox
@@ -750,7 +751,7 @@ local kept = head
specification.overflow = overflow
specification.discarded = discarded
- setfield(getbox(specification.box),"list",nil)
+ setlist(getbox(specification.box),nil)
return specification
end
@@ -784,7 +785,7 @@ end
local l = list[i]
local h = new_hlist()
t[i] = h
- setfield(h,"list",getfield(l,"head"))
+ setlist(h,getfield(l,"head"))
setfield(h,"height",getfield(l,"height"))
setfield(h,"depth",getfield(l,"depth"))
setfield(l,"head",nil)
@@ -879,7 +880,7 @@ local function getsplit(result,n)
local isglobal = result.alternative == v_global
local v = new_vlist()
- setfield(v,"list",h)
+ setlist(v,h)
-- local v = vpack(h,"exactly",height)
diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua
index 0a71b0936..b9c43ac44 100644
--- a/tex/context/base/publ-dat.lua
+++ b/tex/context/base/publ-dat.lua
@@ -1140,18 +1140,22 @@ do
return dataset
end
- implement {
- name = "btxsavedataset",
- actions = publications.save,
- arguments = {
- {
- { "dataset" },
- { "filename" },
- { "filetype" },
- { "criterium" },
+ if implement then
+
+ implement {
+ name = "btxsavedataset",
+ actions = publications.save,
+ arguments = {
+ {
+ { "dataset" },
+ { "filename" },
+ { "filetype" },
+ { "criterium" },
+ }
}
}
- }
+
+ end
end
diff --git a/tex/context/base/spac-ali.lua b/tex/context/base/spac-ali.lua
index b85751a7c..a67a30133 100644
--- a/tex/context/base/spac-ali.lua
+++ b/tex/context/base/spac-ali.lua
@@ -24,6 +24,7 @@ local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getattr = nuts.getattr
local setattr = nuts.setattr
local getsubtype = nuts.getsubtype
@@ -86,12 +87,12 @@ local function handler(head,leftpage,realpageno)
action = leftpage and 2 or 1
end
if action == 1 then
- setfield(current,"list",hpack_nodes(linked_nodes(getlist(current),new_stretch(3)),getfield(current,"width"),"exactly"))
+ setlist(current,hpack_nodes(linked_nodes(getlist(current),new_stretch(3)),getfield(current,"width"),"exactly"))
if trace_realign then
report_realign("flushing left, align %a, page %a, realpage %a",align,pageno,realpageno)
end
elseif action == 2 then
- setfield(current,"list",hpack_nodes(linked_nodes(new_stretch(3),getlist(current)),getfield(current,"width"),"exactly"))
+ setlist(current,hpack_nodes(linked_nodes(new_stretch(3),getlist(current)),getfield(current,"width"),"exactly"))
if trace_realign then
report_realign("flushing right. align %a, page %a, realpage %a",align,pageno,realpageno)
end
diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua
index 84f513242..3eb348586 100644
--- a/tex/context/base/spac-chr.lua
+++ b/tex/context/base/spac-chr.lua
@@ -39,6 +39,7 @@ local getattr = nuts.getattr
local setattr = nuts.setattr
local getfont = nuts.getfont
local getchar = nuts.getchar
+local setsubtype = nuts.setsubtype
local setcolor = nodes.tracers.colors.set
@@ -136,7 +137,7 @@ local function nbsp(head,current)
local para = fontparameters[getfont(current)]
if getattr(current,a_alignstate) == 1 then -- flushright
head, current = inject_nobreak_space(0x00A0,head,current,para.space,0,0)
- setfield(current,"subtype",space_skip_code)
+ setsubtype(current,space_skip_code)
else
head, current = inject_nobreak_space(0x00A0,head,current,para.space,para.spacestretch,para.spaceshrink)
end
diff --git a/tex/context/base/spac-prf.lua b/tex/context/base/spac-prf.lua
index 6b153e15c..fd4ddea61 100644
--- a/tex/context/base/spac-prf.lua
+++ b/tex/context/base/spac-prf.lua
@@ -57,6 +57,7 @@ local gettexbox = nuts.getbox
local setfield = nuts.setfield
local setlink = nuts.setlink
+local setlist = nuts.setlist
local setattr = nuts.setattr
local theprop = nuts.theprop
@@ -403,7 +404,7 @@ local function addprofile(node,profile,step)
-- end
setlink(rule,list)
- setfield(line,"list",rule)
+ setlist(line,rule)
end
diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua
index 6d27a1176..522186985 100644
--- a/tex/context/base/spac-ver.lua
+++ b/tex/context/base/spac-ver.lua
@@ -92,6 +92,7 @@ local setlink = nuts.setlink
local getprev = nuts.getprev
local getid = nuts.getid
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getattr = nuts.getattr
local setattr = nuts.setattr
local getsubtype = nuts.getsubtype
@@ -452,7 +453,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
h, d = ch, cd
local shifted = hpack_node(getlist(current))
setfield(shifted,"shift",delta)
- setfield(current,"list",shifted)
+ setlist(current,shifted)
done = true
if t then
t[#t+1] = formatters["first: height %p depth %p shift %p"](ch,cd,delta)
@@ -489,7 +490,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
h, d = ch, cd
local shifted = hpack_node(getlist(current))
setfield(shifted,"shift",delta)
- setfield(current,"list",shifted)
+ setlist(current,shifted)
done = true
if t then
t[#t+1] = formatters["last: height %p depth %p shift %p"](ch,cd,delta)
@@ -554,7 +555,7 @@ local function snap_hlist(where,current,method,height,depth) -- method.strut is
end
local shifted = hpack_node(getlist(current))
setfield(shifted,"shift",offset)
- setfield(current,"list",shifted)
+ setlist(current,shifted)
if t then
t[#t+1] = formatters["after offset: %p (width %p height %p depth %p)"](offset,getfield(current,"width") or 0,getfield(current,"height"),getfield(current,"depth"))
end
@@ -1709,9 +1710,9 @@ function vspacing.collapsevbox(n,aslist) -- for boxes but using global a_snapmet
if list then
list = collapser(list,"snapper","vbox",trace_vbox_vspacing,true,a_snapmethod)
if aslist then
- setfield(box,"list",list) -- beware, dimensions of box are wrong now
+ setlist(box,list) -- beware, dimensions of box are wrong now
else
- setfield(box,"list",vpack_node(list))
+ setlist(box,vpack_node(list))
end
end
end
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index ae4f2844e..b83118d5a 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 006b71eb8..cb5a71bf9 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/supp-box.lua b/tex/context/base/supp-box.lua
index 2123c0ffa..7ba349a6b 100644
--- a/tex/context/base/supp-box.lua
+++ b/tex/context/base/supp-box.lua
@@ -47,6 +47,7 @@ local setlink = nuts.setlink
local setboth = nuts.setboth
local setnext = nuts.setnext
local setbox = nuts.setbox
+local setlist = nuts.setlist
local free_node = nuts.free
local flush_list = nuts.flush_list
@@ -329,7 +330,7 @@ implement {
if next then
local list = getlist(tail)
setlink(prev,list)
- setfield(tail,"list",nil)
+ setlist(tail)
tail = find_tail(list)
else
tail = prev
@@ -338,12 +339,12 @@ implement {
end
-- done
setnext(tail)
- setfield(current,"list",nil)
+ setlist(current)
end
current = next
end
local result = new_hlist()
- setfield(result,"list",head)
+ setlist(result,head)
setbox(target,result)
end
}
diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv
index be68fced2..decd4c095 100644
--- a/tex/context/base/syst-ini.mkiv
+++ b/tex/context/base/syst-ini.mkiv
@@ -384,7 +384,7 @@
\edef\pdfcompresslevel {\pdfvariable compresslevel} \pdfcompresslevel 9
\edef\pdfobjcompresslevel {\pdfvariable objcompresslevel} \pdfobjcompresslevel 1
- \edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits 3
+ \edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits 6 % for ctx, 4 is default
\edef\pdfgamma {\pdfvariable gamma} \pdfgamma 1000
\edef\pdfimageresolution {\pdfvariable imageresolution} \pdfimageresolution 71
\edef\pdfimageapplygamma {\pdfvariable imageapplygamma} \pdfimageapplygamma 0
@@ -1068,7 +1068,7 @@
\pdfgentounicode \plusone
\pdfinclusioncopyfonts \plusone
\pdfinclusionerrorlevel \zerocount
-\pdfdecimaldigits \plusten
+\pdfdecimaldigits \plussix
\pdfhorigin 1 true in
\pdfvorigin \pdfhorigin
\pdfimageresolution 300
diff --git a/tex/context/base/tabl-xtb.lua b/tex/context/base/tabl-xtb.lua
index 95031c3e3..c3b07b234 100644
--- a/tex/context/base/tabl-xtb.lua
+++ b/tex/context/base/tabl-xtb.lua
@@ -825,8 +825,7 @@ function xtables.construct()
-- setfield(list,"height",0)
-- setfield(list,"depth",0)
-- faster:
- local h = new_hlist()
- setfield(h,"list",list)
+ local h = new_hlist(list)
list = h
--
if start then
diff --git a/tex/context/base/trac-jus.lua b/tex/context/base/trac-jus.lua
index 0c92848dc..ad1a098e2 100644
--- a/tex/context/base/trac-jus.lua
+++ b/tex/context/base/trac-jus.lua
@@ -89,22 +89,22 @@ function checkers.handler(head)
-- special box
elseif delta >= max_threshold then
local rule = tracedrule(delta,naturalheight,naturaldepth,getfield(list,"glue_set") == 1 and "trace:dr" or "trace:db")
- setfield(current,"list",linked_nodes(list,new_hlist(rule)))
+ setlist(current,linked_nodes(list,new_hlist(rule)))
elseif delta <= min_threshold then
local alignstate = getattr(list,a_alignstate)
if alignstate == 1 then
local rule = tracedrule(-delta,naturalheight,naturaldepth,"trace:dc")
- setfield(current,"list",linked_nodes(new_hlist(rule),list))
+ setlist(current,linked_nodes(new_hlist(rule),list))
elseif alignstate == 2 then
local lrule = tracedrule(-delta/2,naturalheight,naturaldepth,"trace:dy")
local rrule = copy_node(lrule)
- setfield(current,"list",linked_nodes(new_hlist(lrule),list,new_kern(delta/2),new_hlist(rrule)))
+ setlist(current,linked_nodes(new_hlist(lrule),list,new_kern(delta/2),new_hlist(rrule)))
elseif alignstate == 3 then
local rule = tracedrule(-delta,naturalheight,naturaldepth,"trace:dm")
- setfield(current,"list",linked_nodes(list,new_kern(delta),new_hlist(rule)))
+ setlist(current,linked_nodes(list,new_kern(delta),new_hlist(rule)))
else
local rule = tracedrule(-delta,naturalheight,naturaldepth,"trace:dg")
- setfield(current,"list",linked_nodes(list,new_kern(delta),new_hlist(rule)))
+ setlist(current,linked_nodes(list,new_kern(delta),new_hlist(rule)))
end
end
end
diff --git a/tex/context/base/trac-vis.lua b/tex/context/base/trac-vis.lua
index b88981fdd..bb94c484b 100644
--- a/tex/context/base/trac-vis.lua
+++ b/tex/context/base/trac-vis.lua
@@ -72,6 +72,9 @@ local setfield = nuts.setfield
local setboth = nuts.setboth
local setlink = nuts.setlink
local setdisc = nuts.setdisc
+local setlist = nuts.setlist
+local setleader = nuts.setleader
+local setsubtype = nuts.setsubtype
local setattr = nuts.setattr
local getfield = nuts.getfield
@@ -507,8 +510,8 @@ local function ruledbox(head,current,vertical,layer,what,simple,previous,trace_o
local leader = linked_nodes(new_glue(size),new_rule(3*size,linewidth,0),new_glue(size))
leader = hpack_nodes(leader)
baseline = new_glue(0)
- setfield(baseline,"leader",leader)
- setfield(baseline,"subtype",cleaders_code)
+ setleader(baseline,leader)
+ setsubtype(baseline,cleaders_code)
setfield(baseline,"stretch",65536)
setfield(baseline,"stretch_order",2)
setlisttransparency(baseline,c_text)
@@ -598,10 +601,10 @@ local function ruledbox(head,current,vertical,layer,what,simple,previous,trace_o
-- how about dir, so maybe just copy the node
--
-- local l = getlist(current)
--- setfield(current,"list",nil)
+-- setlist(current,nil)
-- local c = copy_node(current)
--- setfield(current,"list",l)
--- setfield(c,"list",info)
+-- setlist(current,l)
+-- setlist(c,info)
-- info = c
if next then
@@ -658,15 +661,6 @@ local function ruledglyph(head,current,previous)
new_kern(-wd+doublelinewidth),
baseline
)
-
--- local rule = new_rule(wd,ht,dp)
--- setfield(rule,"subtype",4) -- todo
--- local info = linked_nodes(
--- rule,
--- new_kern(-wd),
--- baseline
--- )
-
local char = chardata[getfont(current)][getchar(current)]
if char and type(char.unicode) == "table" then -- hackery test
setlistcolor(info,c_ligature)
@@ -934,7 +928,7 @@ local function visualize(head,vertical,forced,parent)
elseif id == glue_code then
local content = getleader(current)
if content then
- setfield(current,"leader",visualize(content,false,nil,parent))
+ setleader(current,visualize(content,false,nil,parent))
elseif trace_glue then
head, current = ruledglue(head,current,vertical,parent)
end
@@ -945,7 +939,7 @@ local function visualize(head,vertical,forced,parent)
elseif id == hlist_code then
local content = getlist(current)
if content then
- setfield(current,"list",visualize(content,false,nil,current))
+ setlist(current,visualize(content,false,nil,current))
end
if trace_hbox then
head, current = ruledbox(head,current,false,l_hbox,"H__",trace_simple,previous,trace_origin,parent)
@@ -953,7 +947,7 @@ local function visualize(head,vertical,forced,parent)
elseif id == vlist_code then
local content = getlist(current)
if content then
- setfield(current,"list",visualize(content,true,nil,current))
+ setlist(current,visualize(content,true,nil,current))
end
if trace_vtop then
head, current = ruledbox(head,current,true,l_vtop,"_T_",trace_simple,previous,trace_origin,parent)
@@ -992,48 +986,54 @@ local function freed(cache)
end
end
-local function cleanup()
- local hf, nw, nb, ng_v, ng_h, np_v, np_h, nk_v, nk_h
- nf, f_cache = freed(f_cache)
- nw, w_cache = freed(w_cache)
- nb, b_cache = freed(b_cache)
- no, o_cache = freed(o_cache)
- ng_v, g_cache_v = freed(g_cache_v)
- ng_h, g_cache_h = freed(g_cache_h)
- np_v, p_cache_v = freed(p_cache_v)
- np_h, p_cache_h = freed(p_cache_h)
- nk_v, k_cache_v = freed(k_cache_v)
- nk_h, k_cache_h = freed(k_cache_h)
- -- report_visualize("cache cleanup: %s fontkerns, %s skips, %s penalties, %s kerns, %s whatsits, %s boxes, %s origins",
- -- nf,ng_v+ng_h,np_v+np_h,nk_v+nk_h,nw,nb,no)
-end
+do
-local function handler(head)
- if usedfont then
- starttiming(visualizers)
- -- local l = texgetattribute(a_layer)
- -- local v = texgetattribute(a_visual)
- -- texsetattribute(a_layer,unsetvalue)
- -- texsetattribute(a_visual,unsetvalue)
- head = visualize(tonut(head),true)
- -- texsetattribute(a_layer,l)
- -- texsetattribute(a_visual,v)
- -- -- cleanup()
- stoptiming(visualizers)
- return tonode(head), true
- else
- return head, false
+ local function cleanup()
+ local hf, nw, nb, ng_v, ng_h, np_v, np_h, nk_v, nk_h
+ nf, f_cache = freed(f_cache)
+ nw, w_cache = freed(w_cache)
+ nb, b_cache = freed(b_cache)
+ no, o_cache = freed(o_cache)
+ ng_v, g_cache_v = freed(g_cache_v)
+ ng_h, g_cache_h = freed(g_cache_h)
+ np_v, p_cache_v = freed(p_cache_v)
+ np_h, p_cache_h = freed(p_cache_h)
+ nk_v, k_cache_v = freed(k_cache_v)
+ nk_h, k_cache_h = freed(k_cache_h)
+ -- report_visualize("cache cleanup: %s fontkerns, %s skips, %s penalties, %s kerns, %s whatsits, %s boxes, %s origins",
+ -- nf,ng_v+ng_h,np_v+np_h,nk_v+nk_h,nw,nb,no)
+ end
+
+ local function handler(head)
+ if usedfont then
+ starttiming(visualizers)
+ -- local l = texgetattribute(a_layer)
+ -- local v = texgetattribute(a_visual)
+ -- texsetattribute(a_layer,unsetvalue)
+ -- texsetattribute(a_visual,unsetvalue)
+ head = visualize(tonut(head),true)
+ -- texsetattribute(a_layer,l)
+ -- texsetattribute(a_visual,v)
+ -- -- cleanup()
+ stoptiming(visualizers)
+ return tonode(head), true
+ else
+ return head, false
+ end
end
-end
-visualizers.handler = handler
+ visualizers.handler = handler
+
+ luatex.registerstopactions(cleanup)
+
+end
function visualizers.box(n)
if usedfont then
starttiming(visualizers)
local box = getbox(n)
if box then
- setfield(box,"list",visualize(getlist(box),getid(box) == vlist_code))
+ setlist(box,visualize(getlist(box),getid(box) == vlist_code))
end
stoptiming(visualizers)
return head, true
@@ -1078,8 +1078,6 @@ do
end
-luatex.registerstopactions(cleanup)
-
statistics.register("visualization time",function()
if enabled then
-- cleanup() -- in case we don't don't do it each time
diff --git a/tex/context/base/typo-fln.lua b/tex/context/base/typo-fln.lua
index 2076a7464..1e1a2c44a 100644
--- a/tex/context/base/typo-fln.lua
+++ b/tex/context/base/typo-fln.lua
@@ -35,6 +35,7 @@ local getid = nuts.getid
local getfield = nuts.getfield
local setfield = nuts.setfield
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getattr = nuts.getattr
local setattr = nuts.setattr
local getbox = nuts.getbox
@@ -289,7 +290,7 @@ local function applytofirstcharacter(box,what)
break
end
if done then
- setfield(tbox,"list",list)
+ setlist(tbox,list)
local kind = type(what)
if kind == "string" then
context[what](tonode(done))
diff --git a/tex/context/base/typo-krn.lua b/tex/context/base/typo-krn.lua
index dea8af7cb..cdb0a786c 100644
--- a/tex/context/base/typo-krn.lua
+++ b/tex/context/base/typo-krn.lua
@@ -43,6 +43,7 @@ local setfield = nuts.setfield
local getattr = nuts.getattr
local setattr = nuts.setattr
local setlink = nuts.setlink
+local setsubtype = nuts.setsubtype
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
@@ -229,7 +230,7 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setfield(boundary,"subtype",userkern_code)
+ setsubtype(boundary,userkern_code)
setfield(boundary,"kern",getfield(boundary,"kern") + quaddata[getfont(prev)]*krn)
return boundary, true
end
@@ -266,7 +267,7 @@ local function inject_end(boundary,next,keeptogether,krn,ok)
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setfield(tail,"subtype",userkern_code)
+ setsubtype(tail,userkern_code)
setfield(tail,"kern",getfield(tail,"kern") + quaddata[getfont(next)]*krn)
return boundary, true
end
@@ -318,7 +319,7 @@ local function process_list(head,keeptogether,krn,font,okay)
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setfield(prev,"subtype",userkern_code)
+ setsubtype(prev,userkern_code)
setfield(prev,"kern",getfield(prev,"kern") + kern)
okay = true
end
@@ -435,7 +436,7 @@ function kerns.handler(head)
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setfield(prev,"subtype",userkern_code)
+ setsubtype(prev,userkern_code)
setfield(prev,"kern",getfield(prev,"kern") + quaddata[font]*krn)
done = true
end
diff --git a/tex/context/base/typo-lin.lua b/tex/context/base/typo-lin.lua
index e5b9b8d7c..001bc94cf 100644
--- a/tex/context/base/typo-lin.lua
+++ b/tex/context/base/typo-lin.lua
@@ -84,6 +84,7 @@ local copy_list = nuts.copy_list
local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
+local setlist = nuts.setlist
local getid = nuts.getid
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -152,7 +153,7 @@ local function finalize(prop,key) -- delayed calculations
head = insert_before(head,head,kern1)
head = insert_before(head,head,pack)
head = insert_before(head,head,kern2)
- setfield(line,"list",head)
+ setlist(line,head)
local where = {
pack = pack,
head = nil,
@@ -217,7 +218,7 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
end
end
if head ~= oldhead then
- setfield(line,"list",head)
+ setlist(line,head)
end
noflines = noflines + 1
local prop = {
@@ -296,7 +297,7 @@ local function addtoline(n,list,option)
head, tail = insert_after(head,tail,kern)
else
head, tail = kern, kern
- setfield(where.pack,"list",head)
+ setlist(where.pack,head)
end
head, tail = insert_after(head,tail,blob)
local kern = new_kern(-delta)
@@ -332,7 +333,7 @@ local function addanchortoline(n,anchor)
else
where.tail = anchor
end
- setfield(where.pack,"list",anchor)
+ setlist(where.pack,anchor)
where.head = anchor
return line
end
diff --git a/tex/context/base/typo-mar.lua b/tex/context/base/typo-mar.lua
index ea5f572ba..37732f066 100644
--- a/tex/context/base/typo-mar.lua
+++ b/tex/context/base/typo-mar.lua
@@ -145,6 +145,7 @@ local setattr = nuts.setattr
local getsubtype = nuts.getsubtype
local getbox = nuts.getbox
local getlist = nuts.getlist
+local setlist = nuts.setlist
local nodecodes = nodes.nodecodes
local listcodes = nodes.listcodes
@@ -535,7 +536,7 @@ local function markovershoot(current) -- todo: alleen als offset > line
cache[v_anchors] = stacked
local anchor = setanchor(v_anchors)
local list = hpack_nodes(linked_nodes(anchor,getlist(current)))
- setfield(current,"list",list)
+ setlist(current,list)
end
local function getovershoot(location)
@@ -723,7 +724,7 @@ local function flushinline(parent,head)
elseif id == hlist_code or id == vlist_code then
-- optional (but sometimes needed)
list, don, con = flushinline(current,getlist(current))
- setfield(current,"list",list)
+ setlist(current,list)
continue = continue or con
done = done or don
end
@@ -764,7 +765,7 @@ local function flushed(scope,parent) -- current is hlist
end
if nofinlined > 0 then
if done then
- setfield(parent,"list",head)
+ setlist(parent,head)
end
head, don, con = flushinline(parent,head)
continue = continue or con
@@ -774,13 +775,13 @@ local function flushed(scope,parent) -- current is hlist
local a = getattr(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism
if false then
local l = hpack_nodes(head,getfield(parent,"width"),"exactly")
- setfield(parent,"list",l)
+ setlist(parent,l)
if a then
setattr(l,a_linenumber,a)
end
else
-- because packing messes up profiling
- setfield(parent,"list",head)
+ setlist(parent,head)
if a then
setattr(parent,a_linenumber,a)
end
diff --git a/tex/context/base/typo-sus.lua b/tex/context/base/typo-sus.lua
index 7dec8cb59..2f1949ff0 100644
--- a/tex/context/base/typo-sus.lua
+++ b/tex/context/base/typo-sus.lua
@@ -52,6 +52,7 @@ local getlist = nuts.getlist
local setfield = nuts.setfield
local setattr = nuts.setattr
+local setlist = nuts.setlist
local setcolor = nodes.tracers.colors.set
local insert_before = nuts.insert_before
@@ -275,7 +276,7 @@ local function showsuspects(head)
if list then
local l = showsuspects(list)
if l ~= list then
- setfield(current,"list",l)
+ setlist(current,l)
end
end
end