【问题标题】:Roboto Condensed google font falls back in all browsersRoboto Condensed google 字体在所有浏览器中回退
【发布时间】:2016-08-11 23:29:35
【问题描述】:

我有几个使用@import 规则导入样式表的谷歌字体。除了 Roboto Condensed 之外,它们都渲染得很好。它回退到默认的无衬线字体,在我的例子中是 Helvetica。

@import url(https://fonts.googleapis.com/css?family=Roboto+Condensed:400&subset=latin,latin-ext);

font-family: 'Roboto Condensed', sans-serif;
font-style: normal;
font-weight: 400;

我已经尝试删除本地 Roboto 字体,更改字体粗细和字体样式,使用字体系列名称,但开发工具仍然显示渲染字体是 Helvetica。其他谷歌字体渲染得很好。可能是什么问题?

【问题讨论】:

    标签: css fonts rendering roboto


    【解决方案1】:

    在我的样式表中包含@import url(https://fonts.googleapis.com/css?family=Roboto+Condensed:400&subset=latin,latin-ext);

    html, body {
      font-family: 'Roboto Condensed', sans-serif;
      font-style: normal;
      font-weight: 400;
    }
    

    对我来说工作得很好。您的控制台中是否有任何错误?

    【讨论】:

    • 没有其他错误。它不适用于 Chrome、FF 或 Safari。其他两种谷歌字体加载正常。
    • 发现它仅在通过链接标签(“标准”方式)添加到头部时才有效。奇怪的是,这个问题只存在于 Roboto Condensed,而其他谷歌字体在添加 @import 时可以正常工作。
    • 这里的问题是¿为什么?
    猜你喜欢
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 2016-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-15
    • 1970-01-01
    相关资源
    最近更新 更多