【发布时间】:2011-04-19 17:32:58
【问题描述】:
使用@font-face的正确方法是什么,这样浏览器就不会下载用户已经拥有的字体?
我正在使用@font-face 来定义 DejaVu,它已经安装在我的系统 (linux) 上。 Firefox 没有下载字体,但 Chromium 每次都在下载!
我的 CSS 代码基于 font squirrel 和 that question 如下所示:
@font-face {
font-family: 'DejaVu Serif';
src: url('DejaVuSerif-webfont.eot');
src: local('DejaVu Serif'), url('DejaVuSerif-webfont.woff') format('woff'), url('DejaVuSerif-webfont.ttf') format('truetype'), url('DejaVuSerif-webfont.svg#webfontCFu7RF0I') format('svg');
font-weight: normal;
font-style: normal;
}
/* ... @font-face definitions for italic and bold omitted ... */
@font-face {
font-family: 'DejaVu Serif';
src: url('DejaVuSerif-BoldItalic-webfont.eot');
src: local('DejaVu Serif Bold Italic'), url('DejaVuSerif-BoldItalic-webfont.woff') format('woff'), url('DejaVuSerif-BoldItalic-webfont.ttf') format('truetype'), url('DejaVuSerif-BoldItalic-webfont.svg#webfontQAewh7pf') format('svg');
font-weight: bold;
font-style: italic;
}
【问题讨论】: