summaryrefslogtreecommitdiff
path: root/tex/context/base/char-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-05-13 11:37:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-05-13 11:37:00 +0200
commitaf13aa7e4d8076268e853de13d96a1e73d70ce35 (patch)
tree29403738a0c170379a557ccc785784ccfd746749 /tex/context/base/char-ini.lua
parent4bfd1949398de94ab92544f2c4c49b9c41c1189f (diff)
downloadcontext-af13aa7e4d8076268e853de13d96a1e73d70ce35.tar.gz
beta 2011.05.13 11:37
Diffstat (limited to 'tex/context/base/char-ini.lua')
-rw-r--r--tex/context/base/char-ini.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua
index 059332d51..2244048c3 100644
--- a/tex/context/base/char-ini.lua
+++ b/tex/context/base/char-ini.lua
@@ -12,6 +12,7 @@ local tex = tex
local utf = unicode.utf8
local utfchar, utfbyte, utfvalues = utf.char, utf.byte, string.utfvalues
+local ustring = unicode.ustring
local concat, unpack = table.concat, table.unpack
local next, tonumber, type, rawget, rawset = next, tonumber, type, rawget, rawset
local texsprint, texprint = tex.sprint, tex.print
@@ -939,3 +940,38 @@ end
--~ direction="l",
--~ unicodeslot=0x10FFFD,
--~ },
+
+if not characters.superscripts then
+
+ local superscripts = allocate() characters.superscripts = superscripts
+ local subscripts = allocate() characters.subscripts = subscripts
+
+ -- skipping U+02120 (service mark) U+02122 (trademark)
+
+ for k, v in next, data do
+ local specials = v.specials
+ if specials then
+ local what = specials[1]
+ if what == "super" then
+ if #specials == 2 then
+ superscripts[k] = specials[2]
+ else
+ report_defining("ignoring superscript %s %s: %s",ustring(k),utfchar(k),v.description)
+ end
+ elseif what == "sub" then
+ if #specials == 2 then
+ subscripts[k] = specials[2]
+ else
+ report_defining("ignoring subscript %s %s: %s",ustring(k),utfchar(k),v.description)
+ end
+ end
+ end
+ end
+
+ -- print(table.serialize(superscripts, "superscripts", { hexify = true }))
+ -- print(table.serialize(subscripts, "subscripts", { hexify = true }))
+
+ storage.register("characters/superscripts", superscripts, "characters.superscripts")
+ storage.register("characters/subscripts", subscripts, "characters.subscripts")
+
+end