diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-17 03:15:13 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-05-17 03:15:13 +0200 |
commit | 7efbfd1d82c215c154a4840a906e0aa55e07ed0e (patch) | |
tree | e3b2eb3cb73a209713900231290208a40979d00e /tex/context/base/spac-chr.lua | |
parent | d14466a41dfef73ca9c32c5ef8e266a30a0ac03f (diff) | |
download | context-7efbfd1d82c215c154a4840a906e0aa55e07ed0e.tar.gz |
2014-05-16 20:10:00
Diffstat (limited to 'tex/context/base/spac-chr.lua')
-rw-r--r-- | tex/context/base/spac-chr.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua index 1abba350a..5b3a15478 100644 --- a/tex/context/base/spac-chr.lua +++ b/tex/context/base/spac-chr.lua @@ -39,6 +39,7 @@ local setattr = nuts.setattr local getfont = nuts.getfont local getchar = nuts.getchar +local insert_node_before = nuts.insert_before local insert_node_after = nuts.insert_after local remove_node = nuts.remove local copy_node_list = nuts.copy_list @@ -58,6 +59,7 @@ local glue_code = nodecodes.glue local space_skip_code = skipcodes["spaceskip"] local chardata = characters.data +local is_punctuation = characters.is_punctuation local typesetters = typesetters @@ -162,6 +164,18 @@ local methods = { -- The next one uses an attribute assigned to the character but still we -- don't have the 'local' value. + [0x001F] = function(head,current) + local next = getnext(current) + if next and getid(next) == glyph_code then + local char = getchar(next) + head, current = remove_node(head,current,true) + if not is_punctuation[char] then + local p = fontparameters[getfont(next)] + head, current = insert_node_before(head,current,new_glue(p.space,p.space_stretch,p.space_shrink)) + end + end + end, + [0x00A0] = function(head,current) -- nbsp local next = getnext(current) if next and getid(next) == glyph_code then |