diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/trac-par.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/trac-par.lua | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-par.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-par.lua index 03f0a67d107..56291f8c83d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/trac-par.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/trac-par.lua @@ -15,13 +15,13 @@ local concat = table.concat local nuts = nodes.nuts local tonut = nuts.tonut +local getfield = nuts.getfield local getid = nuts.getid local getnext = nuts.getnext local getlist = nuts.getlist +local getfont = nuts.getfont +local getchar = nuts.getchar local getwidth = nuts.getwidth -local getexpansion = nuts.getexpansion - -local isglyph = nuts.isglyph local nodecodes = nodes.nodecodes local hlist_code = nodecodes.hlist @@ -63,23 +63,23 @@ local function colorize(n) -- tricky: the built-in method creates dummy fonts and the last line normally has the -- original font and that one then has ex.auto set while n do - local char, id = isglyph(n) - if char then - local ne = getexpansion(n) + local id = getid(n) + if id == glyph_code then + local ne = getfield(n,"expansion_factor") if ne == 0 then if length > 0 then flush() end setnodecolor(n,"hz:zero") else - -- id == font - if id ~= font then + local f = getfont(n) + if f ~= font then if length > 0 then flush() end - local pf = parameters[id] + local pf = parameters[f] local ex = pf.expansion if ex and ex.auto then size = pf.size - font = id -- save lookups + font = f -- save lookups else size = false end @@ -100,7 +100,7 @@ local function colorize(n) end if trace_verbose then length = length + 1 - list[length] = utfchar(char) + list[length] = utfchar(getchar(n)) width = width + getwidth(n) -- no kerning yet end end @@ -109,10 +109,7 @@ local function colorize(n) if length > 0 then flush() end - local list = getlist(n) - if list then - colorize(list,flush) - end + colorize(getlist(n),flush) else -- nothing to show on kerns if length > 0 then flush() @@ -128,7 +125,7 @@ end builders.paragraphs.expansion = builders.paragraphs.expansion or { } function builders.paragraphs.expansion.trace(head) - colorize(head,true) + colorize(tonut(head),true) return head end |