Google Web Fonts not displaying in OSX Safari but do display in Firefox, Chrome, Opera (for OSX, Windows, and Linux) and Internet Explorer

StackOverflow https://stackoverflow.com/questions/15801413

  •  01-04-2022
  •  | 
  •  

Question

The following website (http://www.ecu.edu/english/tpc/tpcintern/index.cfm) is supposed to make use of Google Web Fonts, and the fonts display perfectly in all browsers except Safari. The Javascript used is:

  WebFontConfig = {
    google: { families: [ 'Lato:100:latin' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
  })(); 

I realize that the JS doesn't use the tags but I removed them because CommonSpot needs them removed. There are actually a few different Web Fonts being used, but the JS is the same for each with the exception of relevant font information. An example of the CSS is this:

#navigation {
 font-family: 'Lato', sans-serif;
 font-size: 1.3em;
 font-style: normal;
 float: left;
 margin: .5em 0 0 .5em;
 width: 70%;
 height: 2em;
 position: relative;
 padding: .5em 0;
 text-transform: uppercase;
 font-size: 1em;
 background-color: #592a8a;
}

Finally, the web fonts are hosted by Google, if that makes a difference (I wouldn't think that it would, being as they seem to be working in other browsers?).

Was it helpful?

Solution

There was a problem with CommonSpot and how it handles JavaScript. For anyone else who uses CommonSpot, just create a separate HTML file with the JavaScript, upload it to the CustomCF folder, and attach it through CommonSpot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top