diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-08-19 01:08:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-08-19 01:08:00 +0200 |
commit | 174663b0081dd76f91c45fd705262a262a7b1f49 (patch) | |
tree | 554d5d47e81a9263e98fe7091be7e4dbd363482b /tex/context/base/char-cmp.lua | |
parent | e68c228a21a98042c87ef21d9a094b97f941e8de (diff) | |
download | context-174663b0081dd76f91c45fd705262a262a7b1f49.tar.gz |
beta 2010.08.19 01:08
Diffstat (limited to 'tex/context/base/char-cmp.lua')
-rw-r--r-- | tex/context/base/char-cmp.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tex/context/base/char-cmp.lua b/tex/context/base/char-cmp.lua index c7deb7901..848eeebee 100644 --- a/tex/context/base/char-cmp.lua +++ b/tex/context/base/char-cmp.lua @@ -6,11 +6,16 @@ if not modules then modules = { } end modules ['char-cmp'] = { license = "see context related readme files" } +local type = type local utf = unicode.utf8 +local utfchar = utf.char local unpack = unpack or table.unpack -characters = characters or { } +characters = characters or { } +local characters = characters + characters.uncomposed = characters.uncomposed or { } +local uncomposed = characters.uncomposed --[[ldx-- <p>The code defined here may move to the big character table.</p> @@ -45,7 +50,7 @@ Of course they may come in handy elsewhere too</p> -- => shcode == { ub('a') } -- => reduction = "a" -characters.uncomposed.left = { +uncomposed.left = { AEligature = "A", aeligature = "a", OEligature = "O", oeligature = "o", IJligature = "I", ijligature = "i", @@ -55,7 +60,7 @@ characters.uncomposed.left = { Ssharp = "S", ssharp = "s", } -characters.uncomposed.right = { +uncomposed.right = { AEligature = "E", aeligature = "e", OEligature = "E", oeligature = "e", IJligature = "J", ijligature = "j", @@ -65,7 +70,7 @@ characters.uncomposed.right = { Ssharp = "S", ssharp = "s", } -characters.uncomposed.both = { +uncomposed.both = { Acircumflex = "A", acircumflex = "a", Ccircumflex = "C", ccircumflex = "c", Ecircumflex = "E", ecircumflex = "e", @@ -200,11 +205,11 @@ function characters.uncompose(n) -- n == string|number, returns string if cdn then local shcode = cdn.shcode if not shcode then - return characters.uncomposed.both[cdn.contextname] or n + return uncomposed.both[cdn.contextname] or n elseif type(shcode) == "table" then - return utf.char(unpack(cdn.shcode)) + return utfchar(unpack(cdn.shcode)) else - return utf.char(cdn.shcode) + return utfchar(cdn.shcode) end end return n |