雖然某些瀏覽器支持TTF/OTF格式的網絡字體,除非字體設置爲可安裝的嵌入模式的Internet Explorer生成一個錯誤。當向IE提供.woff和.eot變體時,都會重現此行爲。
這可以通過在字體文件中設置的Fstype標誌0000,表示可安裝嵌入模式,使用以下工具之一來補救: 使用ttembed-JS NPM模塊
npm install -g ttembed-js
ttembed-js path/to/fontawesome-webfont.ttf
ttembed-js path/to/FontAwesome.otf
,或者內Node.js的:
var callback = function(error, oldFsType) {
if (error) {
console.error('Something went wrong.', error);
return;
}
if (oldFsType === '0000') {
console.log('fsType is already 0000; no action taken.');
} else {
console.log('fsType successfully changed from ' + oldFsType + ' to 0000.');
}
}
var ttembed = require('ttembed-js');
ttembed({filename: './path/to/fontawesome-webfont.ttf'}, callback);
ttembed({filename: './path/to/FontAwesome.otf'}, callback);
使用原裝ttembed
git clone https://github.com/hisdeedsaredust/ttembed.git
cd ttembed
make
./ttembed path/to/fontawesome-webfont.ttf path/to/FontAwesome.otf
如果瀏覽器/操作系統不支持該字體,那麼將使用該字體 – Tushar
這就是你的網絡字體,這些字體包含在主要的css文件「check section FONT PATH」中https://cdnjs.cloudflare.com/ajax/libs /font-awesome/4.4.0/css/font-awesome.css – SilentTremor
@SilentTremor - 這意味着一旦我們包含了CSS,我們不需要在此之後添加這些其他文件?如果是這樣,爲什麼鏈接分開提供?任何具體原因? – Deadpool