什么是正确的使用方式,@font-face以便浏览器不会下载字体,如果用户已经拥有它?
我正在使用@ font-face来定义DejaVu,它已经安装在我的系统(linux)上.Firefox没有下载字体,但Chromium每次都下载它!
@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;
}
Run Code Online (Sandbox Code Playgroud)
Tha*_*ama 83
如果要先检查本地文件,请执行以下操作:
@font-face {
font-family: 'Green Sans Web';
src:
local('Green Web'),
local('GreenWeb-Regular'),
url('GreenWeb.ttf');
}
Run Code Online (Sandbox Code Playgroud)
还有一个更详尽的描述的在这里做什么.
| 归档时间: |
|
| 查看次数: |
93166 次 |
| 最近记录: |