diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/trac-vis.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/trac-vis.lua | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/context/base/trac-vis.lua b/Master/texmf-dist/tex/context/base/trac-vis.lua index f68da632fb2..df4909c3ef6 100644 --- a/Master/texmf-dist/tex/context/base/trac-vis.lua +++ b/Master/texmf-dist/tex/context/base/trac-vis.lua @@ -44,6 +44,7 @@ local glue_code = nodecodes.glue local penalty_code = nodecodes.penalty local whatsit_code = nodecodes.whatsit local user_code = nodecodes.user +local gluespec_code = nodecodes.gluespec local kerncodes = nodes.kerncodes local font_kern_code = kerncodes.fontkern @@ -290,6 +291,7 @@ local c_space = "trace:y" local c_skip_a = "trace:c" local c_skip_b = "trace:m" local c_glyph = "trace:o" +local c_white = "trace:w" local c_positive_d = "trace:db" local c_negative_d = "trace:dr" @@ -299,13 +301,19 @@ local c_space_d = "trace:dy" local c_skip_a_d = "trace:dc" local c_skip_b_d = "trace:dm" local c_glyph_d = "trace:do" +local c_white_d = "trace:dw" -local function sometext(str,layer,color) -- we can just paste verbatim together .. no typesteting needed +local function sometext(str,layer,color,textcolor) -- we can just paste verbatim together .. no typesteting needed local text = fast_hpack_string(str,usedfont) local size = text.width local rule = new_rule(size,2*exheight,exheight/2) local kern = new_kern(-size) - setcolor(rule,color) + if color then + setcolor(rule,color) + end + if textcolor then + setlistcolor(text.list,textcolor) + end local info = concat_nodes { rule, kern, @@ -399,7 +407,8 @@ local function whatsit(head,current) -- print("hit whatsit") else local tag = whatsitcodes[what] - info = sometext(formatters["W:%s"](tag and tags[tag] or what),usedfont) + -- maybe different text colors per tag + info = sometext(formatters["W:%s"](tag and tags[tag] or what),usedfont,nil,c_white) info[a_layer] = l_whatsit w_cache[what] = info end @@ -513,8 +522,12 @@ local function ruledbox(head,current,vertical,layer,what,simple) next.prev = info end if prev then +if prev.id == gluespec_code then + -- weird, how can this happen, an inline glue-spec +else info.prev = prev prev.next = info +end end if head == current then return info, info |