/* * /MathJax/extensions/MatchWebFonts.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(c,b){var e="2.3";var a=MathJax.Hub.CombineConfig("MatchWebFonts",{matchFor:{"HTML-CSS":true,NativeMML:true,SVG:true},fontCheckDelay:500,fontCheckTimeout:15*1000,});var d=MathJax.Extension.MatchWebFonts={version:e,config:a};c.Register.StartupHook("HTML-CSS Jax Ready",function(){var f=MathJax.OutputJax["HTML-CSS"];var g=f.postTranslate;f.Augment({postTranslate:function(i,h){if(!h&&a.matchFor["HTML-CSS"]&&this.config.matchFontHeight){b.timer.start(b,["checkFonts",this,i.jax[this.id]],a.fontCheckDelay,a.fontCheckTimeout)}return g.apply(this,arguments)},checkFonts:function(o,r){if(o.time(function(){})){return}var w=[],s,p,h=false;for(s=0,p=r.length;s
1?t/q:1);p=Math.floor(Math.max(this.config.minScaleAdjust/100,p)*this.config.scale);if(p/100!==k.scale){A.push([y.style,p])}k.scale=p/100;k.fontScale=p+"%";k.ex=t;k.mex=q}if("scrollWidth" in k&&(v||k.scrollWidth!==x.firstChild.scrollWidth)){k.scrollWidth=x.firstChild.scrollWidth;z.push([x.parentNode.style,k.scrollWidth/k.ex/k.scale])}if(x.MathJaxMtds){for(j=0,n=x.MathJaxMtds.length;j