From 13d79045b5db7164592d083e664e2b5f0f10588e Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 19 Mar 2014 12:05:33 -0400 Subject: [PATCH] Add check that font name is valid. Resolves issue #615. --- unpacked/jax/output/SVG/jax.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index a7798fcea..453e2246b 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -101,6 +101,10 @@ hideProcessedMath: true, // use display:none until all math is processed + fontNames: ["TeX","STIX","STIX-Web","Asana-Math", + "Gyre-Termes","Gyre-Pagella","Latin-Modern","Neo-Euler"], + + Config: function () { this.SUPER(arguments).Config.apply(this,arguments); var settings = HUB.config.menuSettings, config = this.config, font = settings.font; @@ -112,6 +116,7 @@ } else { this.fontInUse = config.font || "TeX"; } + if (this.fontNames.indexOf(this.fontInUse) < 0) {this.fontInUse = "TeX"} this.fontDir += "/" + this.fontInUse; if (!this.require) {this.require = []} this.require.push(this.fontDir+"/fontdata.js");