diff options
Diffstat (limited to 'tex/context/base/typo-cap.lua')
-rw-r--r-- | tex/context/base/typo-cap.lua | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tex/context/base/typo-cap.lua b/tex/context/base/typo-cap.lua index 7f0656130..0eae3b2d9 100644 --- a/tex/context/base/typo-cap.lua +++ b/tex/context/base/typo-cap.lua @@ -22,15 +22,18 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield -local setfield = nuts.setfield local getnext = nuts.getnext local getprev = nuts.getprev local getid = nuts.getid local getattr = nuts.getattr -local setattr = nuts.setattr local getfont = nuts.getfont local getsubtype = nuts.getsubtype local getchar = nuts.getchar +local getdisc = nuts.getdisc + +local setfield = nuts.setfield +local setattr = nuts.setattr +local setchar = nuts.setchar local copy_node = nuts.copy local end_of_math = nuts.end_of_math @@ -136,16 +139,16 @@ local function replacer(start,codes) for i=#dc,1,-1 do local chr = dc[i] if i == 1 then - setfield(start,"char",chr) + setchar(start,chr) else local g = copy_node(start) - setfield(g,"char",chr) + setchar(g,chr) insert_after(start,start,g) end end return start, true elseif ifc[dc] then - setfield(start,"char",dc) + setchar(start,dc) return start, true end end @@ -304,7 +307,7 @@ local function random(start,attr,lastfont,n,count,where,first) while true do local n = randomnumber(0x41,0x5A) if tfm[n] then -- this also intercepts tables - setfield(used,"char",n) + setchar(used,n) return start, true end end @@ -312,7 +315,7 @@ local function random(start,attr,lastfont,n,count,where,first) while true do local n = randomnumber(0x61,0x7A) if tfm[n] then -- this also intercepts tables - setfield(used,"char",n) + setchar(used,n) return start, true end end @@ -385,7 +388,7 @@ function cases.handler(head) -- not real fast but also not used on much data end local action = actions[n] -- map back to low number if action then - local replace = getfield(start,"replace") + local pre, post, replace = getdisc(start) if replace then local cnt = count for g in traverse_id(glyph_code,replace) do @@ -395,7 +398,6 @@ function cases.handler(head) -- not real fast but also not used on much data if quit then break end end end - local pre = getfield(start,"pre") if pre then local cnt = count for g in traverse_id(glyph_code,pre) do @@ -405,7 +407,6 @@ function cases.handler(head) -- not real fast but also not used on much data if quit then break end end end - local post = getfield(start,"post") if post then local cnt = count for g in traverse_id(glyph_code,post) do |