浏览器对数字字体粗细的支持 [英] Browser support for numeric font-weight

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

问题描述

何时向每个浏览器添加了对数字字体粗细的全面支持?具体来说:IE,FireFox,Chrome,Safari,iOS Safari,Android浏览器.

When was full support for numeric font-weight added to each browser? Specifically: IE, FireFox, Chrome, Safari, iOS Safari, Android Browser.

我知道所有浏览器都支持 bold normal ,但是我一直无法找到完全支持数字的浏览器的最新列表.值作为CSS font-weight属性的值.我发现的唯一信息是字体重量仍然损坏.它显示当时大多数浏览器无法正确呈现数字权重,但这是从IE8发行之前的2009年开始的.

I know all browsers support bold and normal, but I've been unable to find a up-to-date list of browsers that fully support numeric values for the CSS font-weight property. The only info I found was Font-weight is still broken. It shows most browsers at the time failing to render numeric weights correctly but it's from 2009 before IE8 was even released.

示例:

<link href='http://fonts.googleapis.com/css?family=Roboto:300,400,700' rel='stylesheet' type='text/css'>
<style>
body { font-family: 'Roboto', sans-serif; }
.light { font-weight:300 }
.normal { font-weight:400 }
.bold { font-weight:700 }
</style>

推荐答案

AFAIK,因为每个浏览器都支持font-weight,所以存在font-weight的数值.事实是,权重的所有细微差别(所有的数字刻度谱),取决于字体本身(从用户的计算机,还是通过@ font-face添加),如果字体没有"semibold",则500不会执行任何操作

AFAIK, the numeric values for font-weight are there since font-weight was supported on each browser... the thing is that all nuances of the weight (all that numeric-scale spectre), depends on the font itself (from the user's machine, or if you've added via @font-face), if the font doesn't have a "semibold", 500 won't do anything.

您可以看一下规范,其中有一个解释,说明了字体不存在 weight 时浏览器的行为:

You can take a look to the specification, there's an explanation of how browsers behave when the weight is not present at the font: http://www.w3.org/TR/CSS21/fonts.html#font-boldness

希望这会有所帮助

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

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