Firefox的Roboto字体粗体 [英] Roboto font bolder with Firefox

查看:142
本文介绍了Firefox的Roboto字体粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Google字体在我的网站上安装Roboto,但我迫切希望看到Roboto在Firefox中比在Google Chrome中更黑体(更黑体)。

I try to install Roboto on my website, using Google Fonts, and I feel desperate to see that Roboto is bolder (much bolder) in Firefox than in Google Chrome.

这是我的代码:

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet"> 

p
{
    font-size: 1.4rem;
    line-height: 1.5;
    font-family: "Roboto", sans-serif;
    letter-spacing: 0;
    color: #313131;
}

这是Roboto Font的两个预览,第一个是Firefox,第二个是Chrome :

And here are two preview of Roboto Font, first with Firefox, second with Chrome:

您可以看到,Chrome Roboto的重量要轻得多。

As you can see, the Chrome Roboto is much lighter.

我不知道为什么会这样,但是我在Google字体上找到了一些东西。在他们自己的代码上使用Firebug,我发现他们网站上使用的Roboto字体具有以下属性:

I don't know why it happen, but I've find something on Google Font. Using Firebug on their own code, I discover that the Roboto Font used on their website has attributes :

element.style {
    font-family: "Roboto script=all rev=1";
}

当您删除 Script = all rev = 1时,Roboto成为在Firefox和Chrome中要大胆(但在Firefox中要大得多)。就像在进行中的工作一样。

And when you remove the "Script=all rev=1", Roboto become much bolder in Firefox and in Chrome (but so much in Firefox). Just like on my Work in progress.

有人有答案,解决方案之类的吗?我感到很孤单,甚至连Google都无法告知我 script = all rev = 1 是什么以及为什么它使Roboto在Google字体上更轻巧。

Does somebody have an answer, a solution, or something? I feel lonely to see that not even Google can inform me about what is script=all rev=1 and why it makes Roboto much lighter on Google Font.

推荐答案

它较轻的原因是因为Chrome使用的是本地安装的Roboto Font,它没有粗体版本,因此回退到精简版(而不是切换到Web字体。)可以说这是一个Chrome错误,但我不知道任何现有报告。

The reason it is lighter is because Chrome is using a locally installed Roboto Font which does not have the bold version, and it is thus falling back to the thin version (rather than switching to the web font.) This is arguably a Chrome bug but I don't know of any existing report.

根据强制Chrome浏览器在CSS中使用外部字体,特殊字体名称有效是因为Google Web字体样式表为字体提供了一个替代名称 Roboto script = all rev = 1,该字体在用户的本地系统上显然不存在,因此可以通过网络字体获得服务。

According to Force Chrome to use external font in CSS the special font name works because the Google Web Font stylesheet gives an alternate name for the font "Roboto script=all rev=1", which obviously doesn't exist on the user's local system and thus gets served by web font.

这篇关于Firefox的Roboto字体粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆