0

I am trying to use a font from typefront.com. It works in every other browser but the security restrictions in Firefox don't allow using fonts from a different domain.

I've tried creating an .htaccess file and adding the following snippet of code but when I try to load the site I get an internal server error page!

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

Here is my CSS code:

@font-face {
  font-family: "Gravur-CondensedBold";
  src: url("http://typefront.com/fonts/825589026.eot");
  src: local("☺"),
       url("http://typefront.com/fonts/825589026.woff") format("woff"),
       url("http://typefront.com/fonts/825589026.ttf") format("truetype"),
       url("http://typefront.com/fonts/825589026.svg") format("svg");
}

@font-face {
  font-family: "Gravur-CondensedLight";
  src: url("http://typefront.com/fonts/825589027.eot");
  src: local("☺"),
       url("http://typefront.com/fonts/825589027.woff") format("woff"),
       url("http://typefront.com/fonts/825589027.ttf") format("truetype"),
       url("http://typefront.com/fonts/825589027.svg") format("svg");
}

Can anybody help me with this?

here's the url: http://www.enjoythisyeah.com

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Ashmore11
  • 1
  • 3
  • can you provide the url to the page? – breezy Apr 30 '12 at 12:11
  • 1
    The `Access-Control-Allow-Origin` header needs to be added on the `typefront.com` server, not on yours. You can ask them about that. If they don't add the header then the only solution is hosting the font on your own server. – Wladimir Palant Apr 30 '12 at 12:17
  • just added the link there! thanks for the reply! – Ashmore11 Apr 30 '12 at 13:15
  • also, the font works on this site: enjoythis.co.uk but it was built by another person so I don't know how he managed to get it working... – Ashmore11 Apr 30 '12 at 13:16

1 Answers1

0

Use a dataURI with a base64 encoded WOFF or SVG font to bypass the same-origin restriction for web fonts.

Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265