www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ff8e0528063a195aabd4dbba865c06e581c92e5a
parent 36194fe36aa3f6f2d875fef0c163926486017fe4
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Sat, 22 Feb 2014 14:57:14 -0500

Simplify font selection code for SVG output.

Diffstat:
Munpacked/jax/output/SVG/jax.js | 19++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js @@ -102,18 +102,15 @@ hideProcessedMath: true, // use display:none until all math is processed Config: function () { - var settings = HUB.config.menuSettings; - if (settings.scale) {this.config.scale = settings.scale} this.SUPER(arguments).Config.apply(this,arguments); - this.fontInUse = this.config.font; - if (settings.font && settings.font !== "Auto") { - if (settings.font === "TeXWeb") {this.fontInUse = "TeX"} - else if (settings.font === "STIXWeb") {this.fontInUse = "STIX-Web"} - else if (settings.font === "AsanaMathWeb") {this.fontInUse = "Asana-Math"} - else if (settings.font === "GyrePagellaWeb") {this.fontInUse = "Gyre-Pagella"} - else if (settings.font === "GyreTermesWeb") {this.fontInUse = "Gyre-Termes"} - else if (settings.font === "LatinModernWeb") {this.fontInUse = "Latin-Modern"} - else if (settings.font === "NeoEulerWeb") {this.fontInUse = "Neo-Euler"} + var settings = HUB.config.menuSettings, config = this.config, font = settings.font; + if (settings.scale) {config.scale = settings.scale} + if (font && font !== "Auto") { + font = font.replace(/(Local|Web|Image)$/i,""); + font = font.replace(/([a-z])([A-Z])/,"$1-$2"); + this.fontInUse = font; + } else { + this.fontInUse = config.font || "TeX"; } this.fontDir += "/" + this.fontInUse; if (!this.require) {this.require = []}