From a4e07f30e880ab27c2918f81f136e257475b7729 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 15 Mar 2018 16:04:31 +0100 Subject: 2018-03-15 15:36:00 --- tex/context/base/mkiv/font-nod.lua | 76 +++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 29 deletions(-) (limited to 'tex/context/base/mkiv/font-nod.lua') diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua index 9166970b8..2670a924b 100644 --- a/tex/context/base/mkiv/font-nod.lua +++ b/tex/context/base/mkiv/font-nod.lua @@ -11,7 +11,6 @@ if not modules then modules = { } end modules ['font-nod'] = { might become a runtime module instead. This module will be cleaned up!

--ldx]]-- -local tonumber, tostring, rawget = tonumber, tostring, rawget local utfchar = utf.char local concat, fastcopy = table.concat, table.fastcopy local match, rep = string.match, string.rep @@ -19,7 +18,10 @@ local match, rep = string.match, string.rep fonts = fonts or { } nodes = nodes or { } -local fonts, nodes, node, context = fonts, nodes, node, context + +local fonts = fonts +local nodes = nodes +local context = context local tracers = nodes.tracers or { } nodes.tracers = tracers @@ -69,7 +71,6 @@ local getkern = nuts.getkern local getdir = nuts.getdir local getwidth = nuts.getwidth -local setfield = nuts.setfield local setbox = nuts.setbox local setchar = nuts.setchar local setsubtype = nuts.setsubtype @@ -78,7 +79,7 @@ local copy_node_list = nuts.copy_list local hpack_node_list = nuts.hpack local flush_node_list = nuts.flush_list local traverse_nodes = nuts.traverse -local traverse_id = nuts.traverse_id +----- traverse_id = nuts.traverse_id local protect_glyphs = nuts.protect_glyphs local nodepool = nuts.pool @@ -135,22 +136,22 @@ function char_tracers.collect(head,list,tag,n) l[#l+1] = { c, f } elseif id == disc_code then -- skip --- local pre, post, replace = getdisc(head) --- if replace then --- for n in traverse_id(glyph_code,replace) do --- l[#l+1] = { c, f } --- end --- end --- if pre then --- for n in traverse_id(glyph_code,pre) do --- l[#l+1] = { c, f } --- end --- end --- if post then --- for n in traverse_id(glyph_code,post) do --- l[#l+1] = { c, f } --- end --- end + -- local pre, post, replace = getdisc(head) + -- if replace then + -- for n in traverse_id(glyph_code,replace) do + -- l[#l+1] = { c, f } + -- end + -- end + -- if pre then + -- for n in traverse_id(glyph_code,pre) do + -- l[#l+1] = { c, f } + -- end + -- end + -- if post then + -- for n in traverse_id(glyph_code,post) do + -- l[#l+1] = { c, f } + -- end + -- end else ok = false end @@ -298,24 +299,41 @@ function step_tracers.features() local f = collection[1] while f do if getid(f) == glyph_code then - local tfmdata, t = fontidentifiers[getfont(f)], { } + local tfmdata = fontidentifiers[getfont(f)] + local features = tfmdata.resources.features + local result_1 = { } + local result_2 = { } + local gpos = features and features.gpos or { } + local gsub = features and features.gsub or { } for feature, value in table.sortedhash(tfmdata.shared.features) do if feature == "number" or feature == "features" then - -- private + value = false elseif type(value) == "boolean" then if value then - t[#t+1] = formatters["%s=yes"](feature) + value = "yes" else - -- skip + value = false end else - t[#t+1] = formatters["%s=%s"](feature,value) + -- use value + end + if value then + if gpos[feature] or gsub[feature] or feature == "language" or feature == "script" then + result_1[#result_1+1] = formatters["%s=%s"](feature,value) + else + result_2[#result_2+1] = formatters["%s=%s"](feature,value) + end end end - if #t > 0 then - context(concat(t,", ")) + if #result_1 > 0 then + context("{\\bf[basic:} %, t{\\bf]} ",result_1) + else + context("{\\bf[}no basic features{\\bf]} ") + end + if #result_2 > 0 then + context("{\\bf[extra:} %, t{\\bf]}",result_2) else - context("no features") + context("{\\bf[}no extra features{\\bf]}") end return end @@ -366,7 +384,7 @@ function step_tracers.codes(i,command,space) local d = d and d[c] context[command](f,c,d and d.class or "") else - context("[%s:U+%05X]",f,c) + context("[%s:U+%X]",f,c) end end -- cgit v1.2.3