声明字体时使用多个字体文件类型源是否有好处?
Is there a benefit to using multiple font file type sources when declaring a font-face?
我看到一段代码是这样声明的:
@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
不同的文件类型适用于不同的浏览器。
这是一个很好的概述:
I assume this is for a fallback,
它是(或多或少无论如何,后备意味着一种好的字体格式和不太好的那些没有得到很好的支持,而不是具有不同支持级别的字体格式的混合)。
but the documentation doesn't really talk about this
确实如此。从您 link 到的页面:
我看到一段代码是这样声明的:
@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
不同的文件类型适用于不同的浏览器。
这是一个很好的概述:
I assume this is for a fallback,
它是(或多或少无论如何,后备意味着一种好的字体格式和不太好的那些没有得到很好的支持,而不是具有不同支持级别的字体格式的混合)。
but the documentation doesn't really talk about this
确实如此。从您 link 到的页面: