2

i have a page styled lik:

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <link href="http://mydomain.ir/fonts/style.css" rel="stylesheet">

</head>

and in style.css

@font-face {
    font-family: 'GanjNamehSans-Regular';
    src: url("GanjNamehSans-Regular.otf");
    src: url("GanjNamehSans-Regular.otf?#iefix") format('embedded-opentype'),
     url("GanjNamehSans-Regular.woff") format('woff'), url("GanjNamehSans-Regular.ttf") format('truetype');
    font-weight: normal;
    font-style: normal;
    }

   body {
            font-family: 'GanjNamehSans-Regular';
            direction: rtl;
            width: 100%;
            color:white;
            background-color: #383434;
            text-align:center;

        }

but this font not applied to body or anywhere i try to use. i checked network tab in inspect in chrome and firefox. in network tab filtered fonts and in chrome status is failed and in firefox status is 206... but not working

when try to open links font will be downloaded...

update:

i did the following but still have this error :**net::ERR_FAILED**

  1. clear cache
  2. Open the page in an Incognito window
  3. Clear your cache and cookies
  4. Close other tabs, extensions, & apps
mohammadreza khalifeh
  • 1,510
  • 2
  • 18
  • 32

1 Answers1

0

I encountered the same issue for my own font hosted in AWS, i.e. ERR_FAILED in Chrome and 206 in Firefox.

Upon checking, it could be a standard CORS issue where you are trying to access resources from another domain. There are few solutions posted in Stack Overflow for fonts hosted by different web servers, eg: Apache and Nginx.

In my case in AWS, I have to set the CORS settings for the S3 bucket hosting my font with the following:

[
    {
        "AllowedHeaders": [],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]

You can tweak the AllowedOrigins to the sites that are importing the font accordingly.

Bk Lim
  • 1,436
  • 1
  • 10
  • 7