我无法让我的自定义字体在 IE7 和 IE8 中工作:
它在 IE9、Firefox 和 Chrome 中运行良好...
对于 Firefox 和 Chrome,字体是 TTF 而对于 IE,它是 EOT
但是,它只适用于 IE9 :(
我无法让我的自定义字体在 IE7 和 IE8 中工作:
它在 IE9、Firefox 和 Chrome 中运行良好...
对于 Firefox 和 Chrome,字体是 TTF 而对于 IE,它是 EOT
但是,它只适用于 IE9 :(
试试这个css格式:
@font-face {
font-family: 'fontName';
src: url('/path/to/font.eot?') format('eot'),
url('/path/to/font.otf') format('otf'),
url('/path/to/font.ttf') format('truetype');
}
这就是我使用的(而不是 otf、woff 和 svg)。而且我从来没有任何 IE 不渲染字体。
@font-face {
font-family: Graublauweb; /*any name for your font*/
src: url('Graublauweb.eot'); /* IE9 Compatibility Modes */
src: url('Graublauweb.eot?') format('eot'), /* IE6-IE8 */
url('Graublauweb.woff') format('woff'), /* Modern Browsers */
url('Graublauweb.ttf') format('truetype'), /* Safari, Android, iOS */
url('Graublauweb.svg#svgGraublauweb') format('svg'); /* Legacy iOS */
}
您需要为 EOT 文件发送正确的 mime 类型。在 apache 中,将其添加到您的 .htaccess 文件中应该可以工作。
AddType application/vnd.ms-fontobject eot
AddType font/ttf ttf
AddType font/otf otf
AddType font/x-woff woff