1

I am trying to load an external .ttf font in a page from a URL path.

it will work fine if i load it locally like so:

@font-face {
    font-family: 'myFnt';
         url('fonts/Font.ttf') format('truetype'),

}

but it doesn't work in Firefox and it doesn't load the font if I try to load like so:

@font-face {
    font-family: 'myFnt';
         url('http://www.mywebsite.com/fonts/Font.ttf') format('truetype'),

}

I tested it in Google Chrome and it worked fine either way but it doesn't load the font in Firefox if I do it the way shown in the second code!

could someone help me out with this please?

user3454730
  • 281
  • 2
  • 4
  • 20

1 Answers1

0

this works for 4 in chrome and firefox as well

@font-face {
    font-family: 'myFnt';
    src: url('webfonts/name.ttf');
    font-weight: normal;
    font-style: normal;
}

are you using a .htaccess file? If yes put theae on your .htaccess file

<FilesMatch "\.(ttf|otf|eot)$">
    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>

here you can read the solution font-face not working only firefox

Community
  • 1
  • 1