"CSS3111: @font-face encountered unknown error" from web server; works normally when browsed from local file system

16,285

When moving into a directory include the ./ to move into your fonts directory

Try formatting your @font-face declaration like this...

 @font-face {
font-family: 'myfont';
src: url('./fonts/myfont.eot'); /* IE9 Compat Modes */
src: url('./fonts/myfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('./fonts/myfont.woff') format('woff'), /* Modern Browsers */
     url('./fonts/myfont.ttf')  format('truetype'), /* Safari, Android, iOS */
     url('./fonts/myfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
Share:
16,285

Related videos on Youtube

ElGavilan
Author by

ElGavilan

Updated on October 10, 2022

Comments

  • ElGavilan
    ElGavilan over 1 year

    I have this embedded font face in the CSS of a web page that I am developing:

    @font-face {
        font-family: 'myfont';
        src: url('fonts/myfont.eot');
        src: url('fonts/myfont.woff') format('woff'), url('fonts/myfont.ttf') format('truetype'), url('fonts/myfont.svg') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    

    And further down in the CSS file I use the font:

    #finder-entry-container h1
        {
            font-family:'myfont', Sans-Serif;
            font-size:28px;
            color:white;
            font-weight:normal
        }
    

    When I use this font on a web page, it renders perfectly fine in Chrome and Firefox. However, in IE I receive this error:

    CSS3111: @font-face encountered unknown error.
    myfont.eot

    Even stranger; the page renders just fine when browsed from the local file system (I am using a simple HTML file to troubleshoot this issue.)

    Has anyone else had an issue like this? I know the fonts work fine because I can browse them from the local file system, so I don't think it is a file conversion issue. My web server is running IIS 6; I checked the headers for all of the fonts and these are the MIME types that they are returning:

    myfont.eot returns application/octet-stream
    myfont.woff returns application/font-woff
    myfont.ttf returns application/octet-stream
    myfont.svg returns image/svg+xml

  • abarisone
    abarisone almost 8 years
    Could you please elaborate more your answer adding a little more description about the solution you provide?
  • Admin
    Admin almost 8 years
    I just found this solution it worked for me so i share it here.Please tell me what exactly would U like to know. And Use this Font converter upload Your TTf here link