哪些是要加载的正确字体文件?

Which are the correct font files to load?

我目前在本地托管 Material 图标字体,在我的字体文件夹中有以下文件。

MaterialIcons-Regular.svg
MaterialIcons-Regular.ttf
MaterialIcons-Regular.woff
MaterialIcons-Regular.woff2

如果我只支持新浏览器和 IE11+,我需要所有这些文件吗?

此外,.svg 文件非常大,有 276kb,webpack 捆绑器抱怨文件的大小。哪个浏览器会选择 .svg 字体?

在css中加载的字体如下:

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src:
    local('Material Icons'),
    local('MaterialIcons-Regular'),
    url(../fonts/MaterialIcons-Regular.woff2) format('woff2'),
    url(../fonts/MaterialIcons-Regular.woff) format('woff'),
    url(../fonts/MaterialIcons-Regular.ttf) format('truetype');
}

是 .svg 字体 > .woff2 > .woff 吗?

woffwoff2 是人们越来越倾向于使用的两种字体类型。

因此,woff 和 woff2 将涵盖新的浏览器,或者特别是:

Chrome  Safari  Firefox Opera   IE  Android iOS
5+      5.1+    3.6+    11.50+  9+  4.4+    5.1+

http://caniuse.com/#feat=svg-fonts 使用 svg

的浏览器列表