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.

This commit is contained in:
Davide P. Cervone 2013-03-18 19:09:54 -04:00
parent fc7aa04a44
commit 4a024c2984

View File

@ -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);