summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/trac-par.lua
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2019-02-22 23:11:47 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2019-02-22 23:11:47 +0000
commit5c6357cdb820b4f628d036ba7b2248f221d50c0b (patch)
tree6365552f2737faaffe63a395272da242ee2c4f03 /Master/texmf-dist/tex/context/base/mkiv/trac-par.lua
parentb4568bc71e054f3d1fd6404b45d2322631778284 (diff)
ConTeXt version 2019.02.22 19:35
git-svn-id: svn://tug.org/texlive/trunk@50086 c570f23f-e606-0410-a88d-b1316a301751
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.lua29
1 files changed, 16 insertions, 13 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 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