diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-07-27 17:53:52 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-07-27 17:53:52 +0200 |
commit | ab56ea38d2f4f5b521ef097bac92812f6070ef55 (patch) | |
tree | e5f2ba9e66f1b1ef8f7b32f91aed0d744a14a0da /tex/context/base/mkiv/math-ini.lua | |
parent | f7bfb1deb04d4ad101dbabf4d635d33cd98aa0a1 (diff) | |
download | context-ab56ea38d2f4f5b521ef097bac92812f6070ef55.tar.gz |
2017-07-27 16:23:00
Diffstat (limited to 'tex/context/base/mkiv/math-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/math-ini.lua | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/math-ini.lua b/tex/context/base/mkiv/math-ini.lua index 2cb4e2413..c4bb822d6 100644 --- a/tex/context/base/mkiv/math-ini.lua +++ b/tex/context/base/mkiv/math-ini.lua @@ -132,11 +132,39 @@ local extensibles = allocate { table.setmetatableindex(extensibles,function(t,k) t[k] = 0 return 0 end) -mathematics.extensibles = extensibles -mathematics.classes = classes -mathematics.codes = codes ------------.accents = codes -mathematics.families = families +local virtualized = allocate { +} + +function mathematics.virtualize(unicode,virtual) + + local function virtualize(k,v) + local c = virtualized[k] + if c == v then + report_math("character %C is already virtualized to %C",k,v) + elseif c then + report_math("character %C is already virtualized to %C, ignoring mapping to %C",k,c,v) + else + virtualized[k] = v + end + end + + if type(unicode) == "table" then + for k, v in next, unicode do + virtualize(k,v) + end + elseif type(unicode) == "number" and type(virtual) == "number" then + virtualize(unicode,virtual) + -- else + -- error + end +end + +mathematics.extensibles = extensibles +mathematics.classes = classes +mathematics.codes = codes +-----------.accents = codes +mathematics.families = families +mathematics.virtualized = virtualized -- there will be proper functions soon (and we will move this code in-line) -- no need for " in class and family (saves space) |