什么字体支持大量粗细? / 如何伪造字体粗细?
规格:
- 现场需要 JS。但更喜欢纯 CSS/HTML
- IE7+,iPhone 支持
- 旧浏览器(例如 IE6)不支持
- 标准 HTML,没有疯狂的拼凑(例如 cufon、图像、cifr)。
问题:
- 哪些字体支持 4 种或更多粗细?大多数似乎只有一两个。到目前为止的答案:
- Myriad Pro(据说?下面的测试对我来说失败了)
- 我怎样才能优雅地降级为模仿字体粗细感知效果的其他样式?
相关链接:
Specs:
- JS required amyway on site. but prefer pure-CSS/HTML
- IE7+, iPhone supported
- Old browsers (e.g. IE6) not supported
- Standard HTML with no crazy kludges (eg cufon, images, cifr).
Questions:
- What fonts support 4 or more weights? Most seem to only have one or two. Answers so far:
- Myriad Pro (supposedly? test below fails for me)
- How can I degrade gracefully to some other styling that mimics the perceptual effect of font weight?
Relevant links:
- http://www.clagnut.com/blog/2228/ (1 yr old)
- http://clagnut.com/sandbox/fontweight.html (my OSX.6 Firefox & Safari show only two weights)
- http://www.fontsquirrel.com/fontface/generator
- https://stackoverflow.com/questions/340923/what-is-the-most-readable-appealing-font
- All about choosing the right font for a website
- Font (typeface) selection for the Web?
- On the web, what fonts should I use to create an equivalent experience cross-platform?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个问题不是什么字体支持大量的权重:而是浏览器是否支持。
据我所知,答案是,不,他们没有,而且不可靠。
正常
和粗体
是您真正可以使用的仅有的两种权重。请参阅此处的相关问题。我认为这篇 2009 年的博客文章仍然成立:
字体粗细在除一种浏览器之外的所有浏览器中仍然被破坏
更新:我忽略了您已经链接到该特定帖子,抱歉。我认为这仍然是国家的现状 - 至少,我怀疑如果没有 Cufon、sIFR 和类似的 IE 7 是否可以实现这一目标。
更新2:请参阅Eric Meyer 的测试suite 用于测试的实时示例。
The first question is not what fonts support a large number of weights: It's whether the browsers do.
The answer, as far as I can see, is, no they don't, not reliably.
normal
andbold
are the only two weights you can work with really.See the related question here. I think this 2009 Blog post still holds true:
Font-weight is still broken in all but one browser
Update: I overlooked that you already link to that particular post, sorry. I think it's still the state of the nation - at least, I doubt this is achievable for IE 7 without Cufon, sIFR and similar.
Update 2: See Eric Meyer's test suite for a live example to test on.