Google 글꼴은 현재 중국에서 차단/심하게 조절되고 있으며 현재 Google 웹 사이트는 매우 느립니다.Google 글꼴의로드가 실패하거나 느린 경우 처리 할 수 있습니까?
우리는 사용자를 대기시키는 대신 실패 상황을 처리 할 방법이 필요합니다. 구글이 배달에 실패했을 때 시스템 글꼴을 사용하도록 실패 할 수 있습니다. 따라서 아래 코드를 사용하면 어떻게 해결할 수 있습니까?
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
JS API 수정을 사용하도록 변경됩니까?
WebFontConfig = {
google: { families: [ 'Open+Sans::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); })();
Google 글꼴이 올바르게 작동하는 일반적인 경우 글꼴의 평균 호스트 사용자가 사용하는 것보다 빠릅니다. –