【发布时间】:2018-03-05 23:02:36
【问题描述】:
我看到一大段代码是这样声明的:
@font-face{
font-family: 'SourceCodePro-Regular';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: local('SourceCodePro-Regular'),
url('assets/fonts/EOT/SourceCodePro-Regular.eot') format('embedded-opentype'),
url('assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'),
url('assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'),
url('assets/fonts/OTF/SourceCodePro-Regular.otf') format('opentype'),
url('assets/fonts/TTF/SourceCodePro-Regular.ttf') format('truetype');
}
为此拥有一堆不同的来源有什么好处吗? IE。要求 truetype、opentype、woff、woff2 和 embedded-opentype 有什么好处,或者是否有适合所有情况的源类型?
我认为这是一个后备,但文档并没有真正谈论这个:https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face
【问题讨论】:
-
是的,它用于备用。该页面上的兼容性图表确实提到,例如,WOFF 支持已经存在了一段时间,而 WOFF2 支持相对较新。不知道还有什么要说的。
-
啊,酷。感谢@Morpheus,这是一个有用的资源。
标签: css cross-browser font-face