Qual è il modo corretto di utilizzare @font-face
in modo che il browser non scarichi il font se l'utente lo ha già?@ font-face src: local - Come utilizzare il font locale se l'utente lo ha già?
Sto usando @ font-face per definire DejaVu, che è già installato sul mio sistema (linux). Firefox non sta scaricando il font, ma Chromium lo sta scaricando ogni volta!
Il mio codice CSS, sulla base di font squirrel e that question simile a questa:
@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;
}
Correlati: http://stackoverflow.com/questions/3698319/css-font-face-what-does-src-local-mean – dbarbosa