summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/spac-chr.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/spac-chr.lmt')
-rw-r--r--tex/context/base/mkxl/spac-chr.lmt32
1 files changed, 24 insertions, 8 deletions
diff --git a/tex/context/base/mkxl/spac-chr.lmt b/tex/context/base/mkxl/spac-chr.lmt
index 554dc0400..a71c4a0e1 100644
--- a/tex/context/base/mkxl/spac-chr.lmt
+++ b/tex/context/base/mkxl/spac-chr.lmt
@@ -28,6 +28,9 @@ local nodes, node = nodes, node
local nuts = nodes.nuts
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local setsubtype = nuts.setsubtype
local getboth = nuts.getboth
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -37,7 +40,6 @@ local getlanguage = nuts.getlanguage
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
local getfont = nuts.getfont
-local setsubtype = nuts.setsubtype
local isglyph = nuts.isglyph
local setcolor = nodes.tracers.colors.set
@@ -60,10 +62,12 @@ local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
local spaceskip_code = gluecodes.spaceskip
local chardata = characters.data
-local is_punctuation = characters.is_punctuation
+local ispunctuation = characters.is_punctuation
+local canhavespace = characters.can_have_space
local typesetters = typesetters
@@ -182,16 +186,28 @@ local methods = {
-- maybe also 0x0008 : backspace
+ [0x001E] = function(head,current) -- kind of special
+ local next = getnext(current)
+ head, current = remove_node(head,current,true)
+ if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then
+ local nextnext = getnext(next)
+ if nextnext then
+ local char, font = isglyph(nextnext)
+ if char and not canhavespace[char] then
+ remove_node(head,next,true)
+ end
+ end
+ end
+ end,
+
[0x001F] = function(head,current) -- kind of special
local next = getnext(current)
if next then
local char, font = isglyph(next)
- if char then
- head, current = remove_node(head,current,true)
- if not is_punctuation[char] then
- local p = fontparameters[font]
- head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink))
- end
+ head, current = remove_node(head,current,true)
+ if char and not ispunctuation[char] then
+ local p = fontparameters[font]
+ head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink))
end
end
end,