diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
commit | 57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch) | |
tree | 1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/math-ini.lua | |
parent | 6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff) |
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/math-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/math-ini.lua | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/context/base/math-ini.lua b/Master/texmf-dist/tex/context/base/math-ini.lua index 5a688941013..63d7cad3852 100644 --- a/Master/texmf-dist/tex/context/base/math-ini.lua +++ b/Master/texmf-dist/tex/context/base/math-ini.lua @@ -1,6 +1,6 @@ if not modules then modules = { } end modules ['math-ext'] = { version = 1.001, - comment = "companion to math-ini.tex", + comment = "companion to math-ini.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" @@ -68,6 +68,7 @@ classes.variable = classes.alphabetic classes.number = classes.alphabetic -- there will be proper functions soon (and we will move this code in-line) +-- no need for " in class and family (saves space) local function delcode(target,family,slot) return format('\\Udelcode%s="%X "%X ',target,family,slot) @@ -273,7 +274,7 @@ mathematics.entities = mathematics.entities or { } function mathematics.register_xml_entities() local entities = xml.entities - for name, unicode in pairs(mathematics.entities) do + for name, unicode in next, mathematics.entities do if not entities[name] then entities[name] = utfchar(unicode) end @@ -286,13 +287,24 @@ function mathematics.big(tfmdata,unicode,n) local t = tfmdata.characters local c = t[unicode] if c then - local next = c.next - while next do - if n <= 1 then - return next - else - n = n - 1 - next = t[next].next + local vv = c.vert_variants or c.next and t[c.next].vert_variants + if vv then + local vvn = vv[n] + return vvn and vvn.glyph or vv[#vv].glyph or unicode + else + local next = c.next + while next do + if n <= 1 then + return next + else + n = n - 1 + local tn = t[next].next + if tn then + next = tn + else + return next + end + end end end end @@ -301,16 +313,24 @@ end -- plugins -function mathematics.scaleparameters(t,tfmtable,delta) +local hvars = table.tohash { + --~ "RadicalKernBeforeDegree", + --~ "RadicalKernAfterDegree", +} + +function mathematics.scaleparameters(t,tfmtable,delta,hdelta,vdelta) local math_parameters = tfmtable.math_parameters if math_parameters and next(math_parameters) then delta = delta or 1 + hdelta, vdelta = hdelta or delta, vdelta or delta local _, mp = mathematics.dimensions(math_parameters) for name, value in next, mp do - if name ~= "RadicalDegreeBottomRaisePercent" then - mp[name] = delta*value - else + if name == "RadicalDegreeBottomRaisePercent" then mp[name] = value + elseif hvars[name] then + mp[name] = hdelta * value + else + mp[name] = vdelta * value end end t.MathConstants = mp |