Cách thích hợp để sử dụng @font-face
để trình duyệt sẽ không tải xuống phông chữ nếu người dùng đã có nó?@ font-face src: local - Cách sử dụng phông chữ cục bộ nếu người dùng đã có nó?
Tôi đang sử dụng @ font-face để xác định DejaVu, đã được cài đặt trên hệ thống của tôi (linux). Firefox không tải xuống phông chữ nhưng Chromium sẽ tải xuống phông chữ mỗi lần!
mã CSS của tôi, dựa trên font squirrel và that question cái nhìn như thế này:
@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;
}
Related: http://stackoverflow.com/questions/3698319/css-font-face-what-does-src-local-mean – dbarbosa