[英]Google Web Fonts not displaying in OSX Safari but do display in Firefox, Chrome, Opera (for OSX, Windows, and Linux) and Internet Explorer
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. 以下网站( http://www.ecu.edu/english/tpc/tpcintern/index.cfm )应该使用Google Web字体,并且该字体在Safari之外的所有浏览器中都能完美显示。 The Javascript used is:
使用的Javascript是:
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. 我意识到JS不使用标签,但我删除了标签,因为CommonSpot需要将其删除。 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.
实际上,实际上使用了几种不同的Web字体,但是除了相关的字体信息之外,每种JS都是相同的。 An example of the CSS is this:
CSS的示例是这样的:
#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?). 最后,网络字体由Google托管(如果有区别的话)(我认为不会,因为它们似乎可以在其他浏览器中正常工作?)。
There was a problem with CommonSpot and how it handles JavaScript. CommonSpot及其处理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.
对于使用CommonSpot的其他人,只需使用JavaScript创建一个单独的HTML文件,然后将其上传到CustomCF文件夹,然后通过CommonSpot将其附加。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.