www

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

commit 81d9cce510adf75b65256bc2570c782c7c12ba71
parent 4d4db67ad0cf2714a6d39c8e7a603a25939cf225
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon,  3 Mar 2014 18:34:50 -0500

Work around stupid Fedora stix font package that incorrectly aliases all STIXGeneral fonts to STIX-Word fonts.  Resolves issue #501.

Diffstat:
Munpacked/jax/output/HTML-CSS/jax.js | 21++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -40,6 +40,12 @@ timeout: (isMobile? 15:8)*1000, // timeout for loading web fonts comparisonFont: ["sans-serif","monospace","script","Times","Courier","Arial","Helvetica"], testSize: ["40px","50px","60px","30px","20px"], + // + // Fedora aliases STIXSizeOneSym to STIX Word, so MathJax thinks STIX is + // available, but the fonts aren't actually correct. This is to test if + // STIXSizeOneSym has letters in it (so is actually STIX Word). + // + FedoraSTIXcheck: {family:"STIXSizeOneSym", testString:"abcABC", noStyleChar:true}, Init: function () { // @@ -62,12 +68,17 @@ }, findFont: function (fonts,pref) { - if (pref && this.testCollection(pref)) {return pref} - for (var i = 0, m = fonts.length; i < m; i++) { - if (fonts[i] === pref) continue; - if (this.testCollection(fonts[i])) {return fonts[i]} + var found = null; + if (pref && this.testCollection(pref)) { + found = pref; + } else { + for (var i = 0, m = fonts.length; i < m; i++) { + if (fonts[i] === pref) continue; + if (this.testCollection(fonts[i])) {found = fonts[i]; break} + } } - return null; + if (found === "STIX" && this.testFont(this.FedoraSTIXcheck)) {found = null} + return found; }, testCollection: function (name) {