diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/node-typ.lua | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/node-typ.lua')
-rw-r--r-- | tex/context/base/mkiv/node-typ.lua | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/node-typ.lua b/tex/context/base/mkiv/node-typ.lua index 2d84e07a3..dea48cda8 100644 --- a/tex/context/base/mkiv/node-typ.lua +++ b/tex/context/base/mkiv/node-typ.lua @@ -18,14 +18,15 @@ local tonut = nuts.tonut local setfield = nuts.setfield local setlink = nuts.setlink local setchar = nuts.setchar +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 local full_hpack_list = nuts.fullhpack -local copy_node = nuts.copy local nodepool = nuts.pool local new_glyph = nodepool.glyph @@ -33,20 +34,26 @@ local new_glue = nodepool.glue local utfvalues = utf.values -local currentfont = font.current -local currentattr = 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 = getfield(templateglyph,"attr") else fontid = currentfont() --- attrid = currentattr() + 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 --- setfield(next,"attr",attrid) + if attrid then + setattrlist(next,attrid) + end head = next else --- setfield(next,"attr",attrid) + if attrid then + setattrlist(next,attrid) + end setlink(prev,next) end prev = next |