diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-01-07 14:00:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-01-07 14:00:00 +0100 |
commit | 539201b19e95e9e3c2279e12485866e2f0919262 (patch) | |
tree | 65f83e1f68182112f519cc84104d4f4db7653c3d /tex/context/base/font-gds.lua | |
parent | a50b4f9b35ed19c921b861bcc9ef5f6202c6cef0 (diff) | |
download | context-539201b19e95e9e3c2279e12485866e2f0919262.tar.gz |
beta 2014.01.07 14:00
Diffstat (limited to 'tex/context/base/font-gds.lua')
-rw-r--r-- | tex/context/base/font-gds.lua | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua index 7131ecad5..e57f784a0 100644 --- a/tex/context/base/font-gds.lua +++ b/tex/context/base/font-gds.lua @@ -46,7 +46,12 @@ local findfile = resolvers.findfile local glyph_code = nodes.nodecodes.glyph -local traverse_id = nodes.traverse_id +local nuts = nodes.nuts +local tonut = nuts.tonut +local getfont = nuts.getfont +local getchar = nuts.getchar +local getattr = nuts.getattr +local traverse_id = nuts.traverse_id function fontgoodies.report(what,trace,goodies) if trace_goodies or trace then @@ -311,16 +316,16 @@ local setnodecolor = nodes.tracers.colors.set -- function colorschemes.coloring(head) -- local lastfont, lastscheme -- local done = false --- for n in traverse_id(glyph_code,head) do --- local a = n[a_colorscheme] +-- for n in traverse_id(glyph_code,tonut(head)) do +-- local a = getattr(n,a_colorscheme) -- if a then --- local f = n.font +-- local f = getfont(n) -- if f ~= lastfont then -- lastscheme = fontproperties[f].colorscheme -- lastfont = f -- end -- if lastscheme then --- local sc = lastscheme[n.char] +-- local sc = lastscheme[getchar(n)] -- if sc then -- done = true -- setnodecolor(n,"colorscheme:"..a..":"..sc) -- slow @@ -338,21 +343,21 @@ local setnodecolor = nodes.tracers.colors.set -- local lastattr = nil -- local lastscheme = nil -- local lastprefix = nil --- local done = nil --- for n in traverse_id(glyph_code,head) do --- local a = n[a_colorscheme] +-- local done = nil +-- for n in traverse_id(glyph_code,tonut(head)) do +-- local a = getattr(n,a_colorscheme) -- if a then -- if a ~= lastattr then -- lastattr = a -- lastprefix = "colorscheme:" .. a .. ":" -- end --- local f = n.font +-- local f = getfont(n) -- if f ~= lastfont then -- lastfont = f -- lastscheme = fontproperties[f].colorscheme -- end -- if lastscheme then --- local sc = lastscheme[n.char] +-- local sc = lastscheme[getchar(n)] -- if sc then -- setnodecolor(n,lastprefix .. sc) -- slow -- done = true @@ -384,10 +389,10 @@ function colorschemes.coloring(head) local lastcache = nil local lastscheme = nil local done = nil - for n in traverse_id(glyph_code,head) do - local a = n[a_colorscheme] + for n in traverse_id(glyph_code,tonut(head)) do + local a = getattr(n,a_colorscheme) if a then - local f = n.font + local f = getfont(n) if f ~= lastfont then lastfont = f lastscheme = fontproperties[f].colorscheme @@ -397,7 +402,7 @@ function colorschemes.coloring(head) lastcache = cache[a] end if lastscheme then - local sc = lastscheme[n.char] + local sc = lastscheme[getchar(n)] if sc then setnodecolor(n,lastcache[sc]) -- we could inline this one done = true |