From 5c6357cdb820b4f628d036ba7b2248f221d50c0b Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Fri, 22 Feb 2019 23:11:47 +0000 Subject: ConTeXt version 2019.02.22 19:35 git-svn-id: svn://tug.org/texlive/trunk@50086 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/context/base/mkiv/trac-par.lua | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'Master/texmf-dist/tex/context/base/mkiv/trac-par.lua') 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 56291f8c83d..03f0a67d107 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 id = getid(n) - if id == glyph_code then - local ne = getfield(n,"expansion_factor") + local char, id = isglyph(n) + if char then + local ne = getexpansion(n) if ne == 0 then if length > 0 then flush() end setnodecolor(n,"hz:zero") else - local f = getfont(n) - if f ~= font then + -- id == font + if id ~= font then if length > 0 then flush() end - local pf = parameters[f] + local pf = parameters[id] local ex = pf.expansion if ex and ex.auto then size = pf.size - font = f -- save lookups + font = id -- 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(getchar(n)) + list[length] = utfchar(char) width = width + getwidth(n) -- no kerning yet end end @@ -109,7 +109,10 @@ local function colorize(n) if length > 0 then flush() end - colorize(getlist(n),flush) + local list = getlist(n) + if list then + colorize(list,flush) + end else -- nothing to show on kerns if length > 0 then flush() @@ -125,7 +128,7 @@ end builders.paragraphs.expansion = builders.paragraphs.expansion or { } function builders.paragraphs.expansion.trace(head) - colorize(tonut(head),true) + colorize(head,true) return head end -- cgit v1.2.3