Google字体未在Google Chrome上呈现 [英] Google Fonts are not rendering on Google Chrome
问题描述
我正在建立一个新的WordPress主题(不知道是否相关),并且有这个问题让我困扰我。
我加载了Roboto来自Google Webfonts的平板(包括< head>
部分中的CSS)。在每一个其他浏览器上,字体呈现确定,除了谷歌浏览器。当我第一次在谷歌浏览器中加载网站时,使用该自定义字体的文本不显示在所有(即使是字体堆栈有格鲁吉亚作为后备 - Roboto Slab,Georgia,serif;
)。在我悬停样式链接或在Inspector中重新触发任何CSS属性后,文本将变为可见。
由于我刚开始使用主题,我清楚地记得它以前工作完美。这是最近的Chrome更新错误吗?
首次加载:
screenshot#1
重新应用任何CSS属性后,进入响应式视图或悬停元素:
屏幕截图#2
任何人都有类似的问题?我应该如何处理?
谢谢!
它是已知的Chrome错误。有一个css唯一的解决方法应该解决问题:
body {
-webkit-animation-delay:0.1 s;
-webkit-animation-name:fontfix;
-webkit-animation-duration:0.1s;
-webkit-animation-iteration-count:1;
-webkit-animation-timing-function:linear;
}
@ -webkit-keyframes fontfix {
from {opacity:1; }
to {opacity:1; }
}
似乎Chrome只需要告诉重新绘制文字
I'm building a new WordPress theme (don't know if that's relevant) and there's this issue that keeps bugging me.
I've loaded up Roboto Slab from Google Webfonts (included the CSS in <head>
section). On every other browser out there, font is rendered OK, except Google Chrome. When I first load up the website in Google Chrome, texts using that custom font are NOT displayed AT ALL (even tho font-stack has Georgia as a fallback - "Roboto Slab", Georgia, serif;
). After I hover the styled link, or retrigger any CSS property in Inspector - texts become visible.
Since I've started the theme some time ago, I can clearly remember that it was working perfectly before. Is this some known recent Chrome update bug?
First load: a screenshot #1
After I reapply any of the CSS properties, get into responsive view or hover an element: a screenshot #2
Anyone have similar issues? How should I proceed with this?
Thanks!
Apparently it's a known Chrome bug. There's a css-only workaround that should solve the problem:
body {
-webkit-animation-delay: 0.1s;
-webkit-animation-name: fontfix;
-webkit-animation-duration: 0.1s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
}
@-webkit-keyframes fontfix {
from { opacity: 1; }
to { opacity: 1; }
}
It seems like Chrome just needs to be told to repaint the text
这篇关于Google字体未在Google Chrome上呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!