summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-typ.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/node-typ.lua')
-rw-r--r--tex/context/base/mkiv/node-typ.lua29
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