首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >新版本的火狐浏览器,如果字体是本地安装的,铬不会加载网页字体?

新版本的火狐浏览器,如果字体是本地安装的,铬不会加载网页字体?
EN

Stack Overflow用户
提问于 2022-11-21 13:48:03
回答 1查看 12关注 0票数 0

我在dev tools网络窗格中注意到,我的字体文件没有显示出来。(Roboto)字体仅用作webserver文件夹中的本地文件,内嵌css @face face、woff2、woff、ttf和svg。

Firefox上周在日志中显示了这些网页字体,但在第107版中就不再显示了。

我试过chomium,看到在Chromium70中加载字体文件,更新到Chromium110:从网络日志中消失。我发现Roboto安装在我的Windows /字体中,删除了它,现在两个新浏览器都重新加载了webfonts。这种行为是可逆的。回到旧的浏览器版本将加载所有字体面的网页字体,不管哪个是安装的。

我错过了什么?

  • 突然成为Windows 11的一部分,并随上一次更新而来?
  • 做了一些CSS约定的更改?
  • 是"src: local(.)“以前不支持?

谢谢<3

EN

回答 1

Stack Overflow用户

发布于 2022-11-21 15:32:13

CSS文件从2018年开始使用google webfonts助手:https://google-webfonts-helper.herokuapp.com/fonts/roboto?subsets=latin生成的@字体面,现在似乎"src:local“选项是空的,以防止这种冲突。(仍然奇怪的是,为什么现在这件事,但不是上周)

2018年:"src: local“的字体名为=>已安装的系统字体。

代码语言:javascript
复制
/* roboto-regular - latin */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/roboto-v18-latin-regular.eot'); /* IE9 Compat Modes */
    src: local('Roboto'), local('Roboto-Regular'),
        url('fonts/roboto-v18-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
        url('fonts/roboto-v18-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
        url('fonts/roboto-v18-latin-regular.woff') format('woff'), /* Modern Browsers */
        url('fonts/roboto-v18-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
        url('fonts/roboto-v18-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */
}

2022:"src: local“为空,=>将始终加载will字体。

代码语言:javascript
复制
    /* roboto-regular - latin */
    @font-face {
        font-family: 'Roboto';
        font-style: normal;
        font-weight: 400;
        src: url('../fonts/roboto-v30-latin-regular.eot'); /* IE9 Compat Modes */
        src: local(''),
             url('../fonts/roboto-v30-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
             url('../fonts/roboto-v30-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
             url('../fonts/roboto-v30-latin-regular.woff') format('woff'), /* Modern Browsers */
             url('../fonts/roboto-v30-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
             url('../fonts/roboto-v30-latin-regular.svg#Roboto') format('svg'); /* Legacy iOS */
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74519903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档