diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/node-typ.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/node-typ.lua | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua index 06d0f13c28a..dea48cda84c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua @@ -18,10 +18,11 @@ local tonut = nuts.tonut local setfield = nuts.setfield local setlink = nuts.setlink local setchar = nuts.setchar ------ setattrlist = nuts.setattrlist +local setattrlist = nuts.setattrlist local getfield = nuts.getfield local getfont = nuts.getfont +local getattrlist = nuts.getattrlist local hpack_node_list = nuts.hpack local vpack_node_list = nuts.vpack @@ -33,20 +34,26 @@ local new_glue = nodepool.glue local utfvalues = utf.values -local currentfont = font.current ------ current_attr = node.current_attr +local currentfont = font.current -- mabe nicer is fonts .current +local currentattr = node.current_attr -- mabe nicer is attributes.current local fontparameters = fonts.hashes.parameters -local function tonodes(str,fontid,spacing,templateglyph) -- quick and dirty +-- when attrid == true then take from glyph or current else use the given value + +local function tonodes(str,fontid,spacing,templateglyph,attrid) -- quick and dirty local head, prev = nil, nil - -- local attrid = nil if not fontid then if templateglyph then fontid = getfont(templateglyph) - -- attrid = setattrlist(templateglyph) else fontid = currentfont() - -- attrid = current_attr() + end + end + if attrid == true then + if templateglyph then + attrid = false -- we copy with the glyph + else + attrid = currentattr() end end local fp = fontparameters[fontid] @@ -75,10 +82,14 @@ local function tonodes(str,fontid,spacing,templateglyph) -- quick and dirty if not next then -- nothing elseif not head then - -- setattrlist(next,attrid) + if attrid then + setattrlist(next,attrid) + end head = next else - -- setattrlist(next,attrid) + if attrid then + setattrlist(next,attrid) + end setlink(prev,next) end prev = next |