www

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

commit f55fc96ca327cef5c82afbf2face23c43fea7c9e
parent cce1ff7cf19da17252ed1dab7eb962ac8dd9e660
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon, 14 Feb 2011 20:16:14 -0500

Work around IE9 bug that caches font-family lookups and doesn't reset them when @font-face changes the family

Diffstat:
Munpacked/jax/output/HTML-CSS/jax.js | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -163,16 +163,18 @@ fontFace: function (name) { var type = HTMLCSS.allowWebFonts; + var FONT = HTMLCSS.FONTDATA.FONTS[name]; + if (HTMLCSS.msieFontCSSBug && !FONT.family.match(/-Web$/)) {FONT.family += "-Web"} var dir = AJAX.fileURL(HTMLCSS.webfontDir+"/"+type); var fullname = name.replace(/-b/,"-B").replace(/-i/,"-I").replace(/-Bold-/,"-Bold"); if (!fullname.match(/-/)) {fullname += "-Regular"} if (type === "svg") {fullname += ".svg#"+fullname} else {fullname += "."+type} var def = { - "font-family": HTMLCSS.FONTDATA.FONTS[name].family, + "font-family": FONT.family, src: "url('"+dir+"/"+fullname+"')" }; if (type === "svg") def.src += " format('svg')"; - if (!(HTMLCSS.FontFaceBug && HTMLCSS.FONTDATA.FONTS[name].isWebFont)) { + if (!(HTMLCSS.FontFaceBug && FONT.isWebFont)) { if (name.match(/-bold/)) {def["font-weight"] = "bold"} if (name.match(/-italic/)) {def["font-style"] = "italic"} } @@ -466,7 +468,10 @@ {FONTS[name].available = true; return null} if (!this.allowWebFonts) {return null} FONTS[name].isWebFont = true; - if (HTMLCSS.FontFaceBug) {FONTS[name].family = name} + if (HTMLCSS.FontFaceBug) { + FONTS[name].family = name; + if (HTMLCSS.msieFontCSSBug) {FONTS[name].family += "-Web"} + } return AJAX.Styles({"@font-face":this.Font.fontFace(name)}); }, @@ -1068,7 +1073,10 @@ loadWebFont: function (font) { font.available = font.isWebFont = true; - if (HTMLCSS.FontFaceBug) {font.family = font.name} + if (HTMLCSS.FontFaceBug) { + font.family = font.name; + if (HTMLCSS.msieFontCSSBug) {font.family += "-Web"} + } HUB.RestartAfter(this.Font.loadWebFont(font)); }, loadWebFontError: function (font,done) { @@ -2152,6 +2160,7 @@ msieItalicWidthBug: true, zeroWidthBug: true, FontFaceBug: true, + msieFontCSSBug: browser.isIE9, allowWebFonts: "eot" }); },