diff options
Diffstat (limited to 'tex/context/base/core-spa.lua')
-rw-r--r-- | tex/context/base/core-spa.lua | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/tex/context/base/core-spa.lua b/tex/context/base/core-spa.lua index a7b9b74eb..2150d2103 100644 --- a/tex/context/base/core-spa.lua +++ b/tex/context/base/core-spa.lua @@ -1214,34 +1214,52 @@ do cases.actions[1], cases.actions[2] = upper, lower - cases.actions[3] = function(start) + cases.actions[3] = function(start,attribute) local prev = start.prev if prev and prev.id == kern and prev.subtype == 0 then prev = prev.prev end if not prev or prev.id ~= glyph then + --- only the first character is treated + for n in traverse_id(glyph,start.next) do + if has_attribute(n,attribute) then + unset_attribute(n,attribute) + end + end return upper(start) else return start, false end end - cases.actions[4] = function(start) - local prev, next = start.prev, start.next + cases.actions[4] = function(start,attribute) + local prev = start.prev if prev and prev.id == kern and prev.subtype == 0 then prev = prev.prev end - if next and next.id == kern and next.subtype == 0 then - next = next.next - end - if (not prev or prev.id ~= glyph) and next and next.id == glyph then + if not prev or prev.id ~= glyph then return upper(start) else return start, false end end - cases.actions[5] = function(start) + --~ cases.actions[5] = function(start) + --~ local prev, next = start.prev, start.next + --~ if prev and prev.id == kern and prev.subtype == 0 then + --~ prev = prev.prev + --~ end + --~ if next and next.id == kern and next.subtype == 0 then + --~ next = next.next + --~ end + --~ if (not prev or prev.id ~= glyph) and next and next.id == glyph then + --~ return upper(start) + --~ else + --~ return start, false + --~ end + --~ end + + cases.actions[8] = function(start) local data = characters.data local ch = start.char local mr = math.random @@ -1283,7 +1301,7 @@ do unset_attribute(start,attribute) local action = actions[attr] if action then - local _, ok = action(start) + local _, ok = action(start,attribute) done = done and ok end end |