diff options
author | Marius <mariausol@gmail.com> | 2013-10-20 01:20:14 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-10-20 01:20:14 +0300 |
commit | 965214d981e6129b782c67adcaf3a81aedcb0bac (patch) | |
tree | 84f5945aae8efc9b6eb1898b873be5453cafe43d /tex/context/base/node-acc.lua | |
parent | e7d0d90a434e5452ff9e86c8abab5a4cac35e2f1 (diff) | |
download | context-965214d981e6129b782c67adcaf3a81aedcb0bac.tar.gz |
stable 2013.05.28 00:36
Diffstat (limited to 'tex/context/base/node-acc.lua')
-rw-r--r-- | tex/context/base/node-acc.lua | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/tex/context/base/node-acc.lua b/tex/context/base/node-acc.lua index 81ae496b2..4380ec3a4 100644 --- a/tex/context/base/node-acc.lua +++ b/tex/context/base/node-acc.lua @@ -35,7 +35,7 @@ local function injectspaces(head) while n do local id = n.id if id == glue_code then -- todo: check for subtype related to spacing (13/14 but most seems to be 0) - -- if n.spec.width > 0 then -- threshold +--~ if n.spec.width > 0 then -- threshold if p and p.id == glyph_code then local g = copy_node(p) local c = g.components @@ -56,7 +56,7 @@ local function injectspaces(head) s[a_characters] = 0 n[a_characters] = 0 end - -- end +--~ end elseif id == hlist_code or id == vlist_code then injectspaces(n.list,attribute) -- elseif id == kern_code then -- the backend already collapses @@ -83,58 +83,58 @@ nodes.handlers.accessibility = injectspaces -- todo: --- local a_hyphenated = attributes.private('hyphenated') --- --- local hyphenated, codes = { }, { } --- --- local function compact(n) --- local t = { } --- for n in traverse_id(glyph_code,n) do --- t[#t+1] = utfchar(n.char) -- check for unicode --- end --- return concat(t,"") --- end --- --- local function injectspans(head) --- for n in traverse_nodes(head) do --- local id = n.id --- if id == disc then --- local r, p = n.replace, n.pre --- if r and p then --- local str = compact(r) --- local hsh = hyphenated[str] --- if not hsh then --- hsh = #codes + 1 --- hyphenated[str] = hsh --- codes[hsh] = str --- end --- n[a_hyphenated] = hsh --- end --- elseif id == hlist_code or id == vlist_code then --- injectspans(n.list) --- end --- end --- return head, true --- end --- --- nodes.injectspans = injectspans --- --- tasks.appendaction("processors", "words", "nodes.injectspans") --- --- local function injectspans(head) --- for n in traverse_nodes(head) do --- local id = n.id --- if id == disc then --- local a = n[a_hyphenated] --- if a then --- local str = codes[a] --- local b = new_pdfliteral(format("/Span << /ActualText %s >> BDC", lpdf.tosixteen(str))) --- local e = new_pdfliteral("EMC") --- node.insert_before(head,n,b) --- node.insert_after(head,n,e) --- end --- elseif id == hlist_code or id == vlist_code then --- injectspans(n.list) --- end --- end --- end +--~ local a_hyphenated = attributes.private('hyphenated') +--~ +--~ local hyphenated, codes = { }, { } +--~ +--~ local function compact(n) +--~ local t = { } +--~ for n in traverse_id(glyph_code,n) do +--~ t[#t+1] = utfchar(n.char) -- check for unicode +--~ end +--~ return concat(t,"") +--~ end +--~ +--~ local function injectspans(head) +--~ for n in traverse_nodes(head) do +--~ local id = n.id +--~ if id == disc then +--~ local r, p = n.replace, n.pre +--~ if r and p then +--~ local str = compact(r) +--~ local hsh = hyphenated[str] +--~ if not hsh then +--~ hsh = #codes + 1 +--~ hyphenated[str] = hsh +--~ codes[hsh] = str +--~ end +--~ n[a_hyphenated] = hsh +--~ end +--~ elseif id == hlist_code or id == vlist_code then +--~ injectspans(n.list) +--~ end +--~ end +--~ return head, true +--~ end +--~ +--~ nodes.injectspans = injectspans +--~ +--~ tasks.appendaction("processors", "words", "nodes.injectspans") +--~ +--~ local function injectspans(head) +--~ for n in traverse_nodes(head) do +--~ local id = n.id +--~ if id == disc then +--~ local a = n[a_hyphenated] +--~ if a then +--~ local str = codes[a] +--~ local b = new_pdfliteral(format("/Span << /ActualText %s >> BDC", lpdf.tosixteen(str))) +--~ local e = new_pdfliteral("EMC") +--~ node.insert_before(head,n,b) +--~ node.insert_after(head,n,e) +--~ end +--~ elseif id == hlist_code or id == vlist_code then +--~ injectspans(n.list) +--~ end +--~ end +--~ end |