summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-typ.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-04-27 01:41:25 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-04-27 01:41:25 +0200
commit762562da00d0ec1d50e6d3c2a701156ab42e6d71 (patch)
tree2dc664caa951963a393b0a2a9c9c85d1db6b8e10 /tex/context/base/mkiv/node-typ.lua
parentf2a20e191bf71094aa21d37dee2ecd2f804dbc56 (diff)
downloadcontext-762562da00d0ec1d50e6d3c2a701156ab42e6d71.tar.gz
2017-04-27 01:06:00
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 06d0f13c2..dea48cda8 100644
--- a/tex/context/base/mkiv/node-typ.lua
+++ b/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