import {startup} from 'mathjax-full/components/src/startup/init.js';
import {Loader, CONFIG} from 'mathjax-full/js/components/loader.js';
//
// Load the components that we want to combine into one component
//
import 'mathjax-full/components/src/core/core.js';
import 'mathjax-full/components/src/input/tex/tex.js';
import {loadFont} from 'mathjax-full/components/src/output/chtml/chtml.js';
import 'mathjax-full/components/src/ui/menu/menu.js';
import {checkSre} from 'mathjax-full/components/src/a11y/util.js';
//
// Import the dynamic font files you want to include
//
import {MathJaxModernFont} from 'mathjax-modern-font/js/chtml.js';
import 'mathjax-modern-font/js/chtml/dynamic/fraktur.js';
// ... list any additional ones here
const fontPreloads = ['fraktur']; // The preloaded dynamic font components (imported above)
//
// Mark the components that you have loaded
//
Loader.preLoad(
'loader', 'startup',
'core',
'input/tex',
'output/chtml',
'ui/menu',
'[mathjax-modern]/chtml'
);
//
// Mark the MathJax version being used for this combined configuration
//
Loader.saveVersion('preload-font.js');
//
// Change these to your own server locations for the MathJax components that
// can be dynamically loaded, and any font files that aren't included above
// but can be dynamically loaded.
//
//
// Set up the pre-loaded dynamic font data
//
const Ready = MathJax.config.startup.ready;
MathJax.config.startup.ready = () => {
(Ready || MathJax.startup.defaultPageReady)();
const font = MathJax.startup.document.outputJax.font;
const dynamic = MathJaxModernFont.dynamicFiles;
fontPreloads.forEach(name => dynamic[name].setup(font));
};
//
// Procede with the startup process
//
loadFont(checkSre(startup), true);