Get TTF/OTF fonts working in IE9+ by setting them to Installable Embedding mode (issue #2517)

Greg Littlefield 2014-04-14 10:05:22 -07:00
parent 0ba30637c3
commit ea2c71dd4c

@ -67,4 +67,45 @@ According to your Font Awesome version, please add to your stylesheets:
### ie7-js
FontAwesome is not compatible with [ie7-js](https://code.google.com/p/ie7-js/).
(more info on [#2171](https://github.com/FortAwesome/Font-Awesome/issues/2821))
(more info on [#2171](https://github.com/FortAwesome/Font-Awesome/issues/2821))
#### Get TTF/OTF fonts working in IE9+
While [some browsers](http://caniuse.com/ttf) support the TTF/OTF formats as webfonts, Internet Explorer generates an error unless the font is set to Installable Embedding mode.
(more info on [#2517](https://github.com/FortAwesome/Font-Awesome/issues/2517))
This can be remedied by setting the ``fsType`` flag in the font file to ``0000``, representing Installable Embedding mode, using one of the following utilities:
##### Using the ttembed-js npm module
```
npm install -g ttembed-js
ttembed-js path/to/fontawesome-webfont.ttf
ttembed-js path/to/FontAwesome.otf
```
or, within node.js:
```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);
```
##### Using the original ttembed
```
git clone https://github.com/hisdeedsaredust/ttembed.git
cd ttembed
make
./ttembed path/to/fontawesome-webfont.ttf path/to/FontAwesome.otf
```