From 4a024c2984072e1fa0677d84bc1aed51c24d760b Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Mon, 18 Mar 2013 19:09:54 -0400 Subject: [PATCH] Wait for SVG to set the fontDir value before setting up the loadhooks or calling loadCompete. This allows fontdata.js to be included in combined configuration files. Resolves issue #413. --- unpacked/jax/output/SVG/fonts/TeX/fontdata.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/unpacked/jax/output/SVG/fonts/TeX/fontdata.js b/unpacked/jax/output/SVG/fonts/TeX/fontdata.js index bfb0f8b17..76e2248a4 100644 --- a/unpacked/jax/output/SVG/fonts/TeX/fontdata.js +++ b/unpacked/jax/output/SVG/fonts/TeX/fontdata.js @@ -22,8 +22,8 @@ * limitations under the License. */ -(function (SVG,MML,AJAX) { - var VERSION = "2.1"; +(function (SVG,MML,AJAX,HUB) { + var VERSION = "2.1.1"; var MAIN = "MathJax_Main", BOLD = "MathJax_Main-bold", @@ -1563,17 +1563,19 @@ 0xEEE8: [0,0,25,0,0,{space:1}] }); - MathJax.Hub.Register.LoadHook(SVG.fontDir+"/Size4/Regular/Main.js",function () { - SVG.FONTDATA.FONTS['MathJax_Size4'][0xE154][0] += 200; // adjust height for brace extender - SVG.FONTDATA.FONTS['MathJax_Size4'][0xE154][1] += 200; // adjust depth for brace extender + HUB.Register.StartupHook("SVG Jax Require",function () { + HUB.Register.LoadHook(SVG.fontDir+"/Size4/Regular/Main.js",function () { + SVG.FONTDATA.FONTS['MathJax_Size4'][0xE154][0] += 200; // adjust height for brace extender + SVG.FONTDATA.FONTS['MathJax_Size4'][0xE154][1] += 200; // adjust depth for brace extender + }); + + SVG.FONTDATA.FONTS['MathJax_Main'][0x2245][2] -= 222; // fix incorrect right bearing in font + HUB.Register.LoadHook(SVG.fontDir+"/Main/Bold/MathOperators.js",function () { + SVG.FONTDATA.FONTS['MathJax_Main-bold'][0x2245][2] -= 106; // fix incorrect right bearing in font + }); + + AJAX.loadComplete(SVG.fontDir + "/fontdata.js"); }); - SVG.FONTDATA.FONTS['MathJax_Main'][0x2245][2] -= 222; // fix incorrect right bearing in font - MathJax.Hub.Register.LoadHook(SVG.fontDir+"/Main/Bold/MathOperators.js",function () { - SVG.FONTDATA.FONTS['MathJax_Main-bold'][0x2245][2] -= 106; // fix incorrect right bearing in font - }); - - AJAX.loadComplete(SVG.fontDir + "/fontdata.js"); - -})(MathJax.OutputJax.SVG,MathJax.ElementJax.mml,MathJax.Ajax); +})(MathJax.OutputJax.SVG,MathJax.ElementJax.mml,MathJax.Ajax,MathJax.Hub);