diff options
author | Marius <mariausol@gmail.com> | 2011-06-08 20:40:24 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-06-08 20:40:24 +0300 |
commit | e5fe861660d5cf60cfeb67f7e57f659b309e9613 (patch) | |
tree | f5bc4ea0cd61f18c096f0fd5df8cf439700ba71e /tex/context/base/node-acc.lua | |
parent | b17f22aa285224dcf5b1dbccd795bc73b9a16426 (diff) | |
download | context-e5fe861660d5cf60cfeb67f7e57f659b309e9613.tar.gz |
beta 2011.06.08 19:06
Diffstat (limited to 'tex/context/base/node-acc.lua')
-rw-r--r-- | tex/context/base/node-acc.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tex/context/base/node-acc.lua b/tex/context/base/node-acc.lua index 537405921..d773b7acf 100644 --- a/tex/context/base/node-acc.lua +++ b/tex/context/base/node-acc.lua @@ -14,6 +14,7 @@ local tasks = nodes.tasks local traverse_nodes = node.traverse local traverse_id = node.traverse_id local has_attribute = node.has_attribute +local set_attribute = node.set_attribute local copy_node = node.copy local free_nodelist = node.flush_list @@ -22,6 +23,10 @@ local glyph_code = nodecodes.glyph local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist +local a_characters = attributes.private("characters") + +-- todo: nbsp etc + local function injectspaces(head) local p for n in traverse_nodes(head) do @@ -29,6 +34,10 @@ local function injectspaces(head) if id == glue_code then -- todo: check for subtype related to spacing (13/14 but most seems to be 0) -- local at = has_attribute(n,attribute) -- if at then +--~ local a = has_attribute(n,a_characters) +--~ if a then +--~ -- handle this in the export +--~ else if p and p.id == glyph_code then local g = copy_node(p) local c = g.components @@ -37,13 +46,20 @@ local function injectspaces(head) g.components = nil g.subtype = 256 end + local a = has_attribute(n,a_characters) local s = copy_node(n.spec) g.char, n.spec = 32, s p.next, g.prev = g, p g.next, n.prev = n, g s.width = s.width - g.width + if a then + set_attribute(g,a_characters,a) + end + set_attribute(s,a_characters,0) + set_attribute(n,a_characters,0) end -- end +--~ end elseif id == hlist_code or id == vlist_code then injectspaces(n.list,attribute) end |