简体   繁体   English

页面刷新时出现奇怪的字体故障

[英]Page has a weird font glitch on refresh

So I've built a HTML page but I'm getting this weird bug where when I refresh the page, for a split second after refresh I can see the basic font, and afterwards it changes to the one I've applied from Google fonts.所以我构建了一个 HTML 页面,但我遇到了这个奇怪的错误,当我刷新页面时,刷新后的一瞬间我可以看到基本字体,然后它更改为我从 Google 字体应用的字体.

I've checked my code a thousand times and I've no idea what's happening, this is the first time I'm seeing this.我已经检查了我的代码一千次,但我不知道发生了什么,这是我第一次看到这个。 It is kinda annoying because it very visible and my elements even change positions a bit, because of the font/size.这有点烦人,因为它非常明显,而且我的元素甚至会因为字体/大小而稍微改变位置。

Do you have any idea what could be causing this?你知道是什么原因造成的吗?

a quick search made me find this article: https://medium.com/clio-calliope/making-google-fonts-faster-aadf3c02a36d快速搜索让我找到了这篇文章: https : //medium.com/clio-calliope/making-google-fonts-faster-aadf3c02a36d

you should download your fonts and host them yourself so it renders faster.你应该下载你的字体并自己托管它们,以便它呈现得更快。 having google host it for you only makes it slower to load (could be many factors why it takes long to load, maybe its your internet, maybe because there is a lot of text on the page, maybe both.) which causes you to see the regular font for a couple seconds.让谷歌为您托管它只会使加载速度变慢(可能是加载需要很长时间的许多因素,也许是您的互联网,也许是因为页面上有很多文本,也许两者都有。)这会让您看到几秒钟的常规字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM