From ea2c71dd4ce15e44d1b31215c9d9b4821673a8df Mon Sep 17 00:00:00 2001 From: Greg Littlefield Date: Mon, 14 Apr 2014 10:05:22 -0700 Subject: [PATCH] Get TTF/OTF fonts working in IE9+ by setting them to Installable Embedding mode (issue #2517) --- Troubleshooting.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Troubleshooting.md b/Troubleshooting.md index c879968..bb44988 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -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)) \ No newline at end of file +(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 +``` \ No newline at end of file