Simplify font selection code for SVG output.

This commit is contained in:
Davide P. Cervone 2014-02-22 14:57:14 -05:00
parent 36194fe36a
commit ff8e052806

View File

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