Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


src: url('fontname.ttf') format('embedded-opentype')

I think your solution works for some font families but not others. It depends on the font's embedding permission level. For example, this won't work for Abadi font

I was getting the following error:

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


src: url('fontname.ttf') format('embedded-opentype')

I think your solution works for some font families but not others. It depends on the font's embedding permission level. For example, this won't work for Abadi font

I was getting the following error:

Yup, this made absolutely no difference with my .ttf files, I was still getting the "Permission must be Installable." error. What did fix this problem was running Christian's .exe (elsewhere on this page) to modify the .ttf files. After doing this, IE11 would display the .ttf fonts on my webpage correctly.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


@font-face {
font-family: OpenSans;
src: url(assets/fonts/OpenSans/OpenSans-Regular.ttf), 
url(assets/fonts/OpenSans/OpenSans-Regular.eot);
}

@font-face {
font-family: OpenSans Bold;
src: url(assets/fonts/OpenSans/OpenSans-Bold.ttf),
url(assets/fonts/OpenSans/OpenSans-Bold.eot);
}

I used following code and it worked like charm in all browsers.

I wasted a lot of time because of this issue. Finally I found great solution myself. Before I was using .ttf font only. But I added one extra font format .eot that started to work in IE.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


It is true that IE9 requires TTF fonts to have the embedding bits set to Installable. The Generator does this automatically, but we are currently blocking Adobe fonts for other reasons. We may lift this restriction in the near future.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


src: url('fontname.eot?#iefix') format('embedded-opentype')

Don't worked in IE7 (

Thanks, but that was not the case. It was all about embedding permissions in the font itself.

You should set the format of the ie font to 'embedded-opentype' and not 'eot'. For example:

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


function convertRestrictedFont($filename) {
    $font = fopen($filename,'r+');
    if ($font === false) {
        throw new Exception('Could not open font file.');
    }

    fseek($font, 12, 0);

    while (!feof($font)) {
        $type = '';
        for ($i = 0; $i < 4; $i++) {
            $type .= fgetc($font);
            if (feof($font)) {
                fclose($font);
                throw new Exception('Could not read the table definitions of the font.');
            }
        }
        if ($type == 'OS/2') {
            // Save the location of the table definition
            // containing the checksum and pointer to the data
            $os2TableDefinition = ftell($font);
            $checksum = 0;

            for ($i = 0; $i < 4; $i++) {
                fgetc($font);
                if (feof($font)) {
                    fclose($font);
                    throw new Exception('Could not read the OS/2 table header of the font.');
                }
            }

            // Get the pointer to the OS/2 table data
            $os2TablePointer = ord(fgetc($font)) << 24;
            $os2TablePointer |= ord(fgetc($font)) << 16;
            $os2TablePointer |= ord(fgetc($font)) << 8;
            $os2TablePointer |= ord(fgetc($font));

            $length = ord(fgetc($font)) << 24;
            $length |= ord(fgetc($font)) << 16;
            $length |= ord(fgetc($font)) << 8;
            $length |= ord(fgetc($font));

            if (fseek($font, $os2TablePointer + 8, 0) !== 0) {
                fclose($font);
                throw new Exception('Could not read the embeddable type of the font.');
            }

            // Read the fsType before overriding it
            $fsType = ord(fgetc($font)) << 8;
            $fsType |= ord(fgetc($font));

            error_log('Installable Embedding: ' . ($fsType == 0));
            error_log('Reserved: ' . ($fsType & 1));
            error_log('Restricted License: ' . ($fsType & 2));
            error_log('Preview & Print: ' . ($fsType & 4));
            error_log('Editable Embedding: ' . ($fsType & 8));
            error_log('Reserved: ' . ($fsType & 16)); 
            error_log('Reserved: ' . ($fsType & 32));
            error_log('Reserved: ' . ($fsType & 64));
            error_log('Reserved: ' . ($fsType & 128));
            error_log('No subsetting: ' . ($fsType & 256));
            error_log('Bitmap embedding only: ' . ($fsType & 512));                         
            error_log('Reserved: ' . ($fsType & 1024));
            error_log('Reserved: ' . ($fsType & 2048));
            error_log('Reserved: ' . ($fsType & 4096));
            error_log('Reserved: ' . ($fsType & 8192));
            error_log('Reserved: ' . ($fsType & 16384));
            error_log('Reserved: ' . ($fsType & 32768));

            fseek($font, ftell($font) - 2);

            // Set the two bytes of fsType to 0
            fputs($font, chr(0), 1);
            fputs($font, chr(0), 1);

            // Go to the beginning of the OS/2 table data
            fseek($font, $os2TablePointer, 0);

            // Generate a new checksum based on the changed 
            for ($i = 0; $i < $length; $i++) {
                $checksum += ord(fgetc($font));
            }
            fseek($font, $os2TableDefinition, 0);
            fputs($font, chr($checksum >> 24), 1);
            fputs($font, chr(255 & ($checksum >> 16)), 1);
            fputs($font, chr(255 & ($checksum >> 8)), 1);
            fputs($font, chr(255 & $checksum), 1);

            fclose($font);

            return true;
        }
        for ($i = 0; $i < 12; $i++) {
            fgetc($font);
            if (feof($font)) {
                fclose($font);
                throw new Exception('Could not skip a table definition of the font.');
            }
        }
    }

    fclose($font);

    return false;
}

If you want to do this with a PHP script instead of having to run C code (or you're on a Mac like me and you can't be arsed compiling with Xcode only to wait a year for it to open), here's a PHP function that you can use to remove the embedding permissions from the font:

Make sure to backup your font file before running this code and don't blame me if it corrupts.

Thanks a lot @Goose! I originally wrote this for my job, but the code got thrown away and replaced, so it lives on in Stack Overflow. Providing C code for a web application issue is definitely not ideal.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


As a note for ttfpatch, use fsType=0.

For those not au fait with compiling C programs on Windows, it's very straightforward. Follow this guide from Microsoft: msdn.microsoft.com/en-us/library/bb384838.aspx

I can only explain you how to fix the "CSS3114" error. You have to change the embedding level of your TTF file.

Using the appropriate tool you can set it to installable embedding allowed. For a 64-bit version, check @user22600's answer.

embed works fine. Just download the source and compile... this is StackOverflow, right? It's only one file. :-) For VS2010 you need to add: #include <string.h>

ttfpatch did not work for me. Error: tableversion must be 0, 1 or and is hex:003

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


@font-face {
font-family: "QuestionableLegalFont";
font-weight: bold;
src: url('../fonts/QuestionableLegalFont.ttf') format('truetype');
}

Finally, To get rid of the "CSS3114" error. For an online tool, click here: https://www.andrebacklund.com/fontfixer.html

First ensure you're using the best code in .css, see some of the other css answers for that. IE 11 css example (works in all modern browsers may need to be tweaked for IE9):

Then, ensure you have a working web-font (you probably already know this by seeing your font in other browsers). If you need an online font converter, check here: https://onlinefontconverter.com/

There's a couple of things to note before you do this. First, to get this error, in IE, inspect element, switch your tabs, and look for the errors, I believe "CSS3114" appears in the console.

What you need to understand is this is a licensing issue. I.E. (pun intended) if you are trying to load a font that causes this error, you don't have permissions on the file to use the font, and if you don't have permission, it is highly likely that you may lose a legal battle (which itself is highly unlikely) over using this font in this manner unless you are holding the license. So, you can, for the first time, thank IE for being the only browser to tell you "no", because it at least lets you know that you are doing something questionable.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


"I was unable to use the MS-DOS and Windows command line tools": The source code is provided though - I'd expect it'd just compile on Mac?

As a Mac user, I was unable to use the MS-DOS and Windows command line tools that were mentioned to fix the font embedding permission. However, I found out that you can fix this using FontLab to set the permission to 'Everything is allowed'. I hope this recipe on how to set the font permission to Installable on Mac OS X is useful for others as well.

Note
Rectangle 27 0

css Make Adobe fonts work with CSS3 @font face in IE9?


As Knu said, you can use this tool, however it's compiled only for MS-DOS. I compiled it for Win64. Download.

My god that's amazing. Side not to all: use windows command line and not a replacement like GIT BASH, I usually prefer bash, doesn't work here.

Really help me a lot. by using Win64 bit exe.

Your download link not working.

Note