Follow

Problem loading external webfonts in DrFront when using Firefox

Error

downloadable font: download failed (font-family: "MyFont" style:normal weight:700 stretch:normal src index:1): bad URI or cross-site access not allowed.

Solution

The two steps below should solve the problems for Firefox.

1. CSS

@font-face {
  font-family: 'MyFont';
  font-style: normal;
  font-weight: 700;
  src: local('MyFont'), local('MyFont'), url(http://cust.com/fonts/myfont.woff) format('woff');
}

Ensure you use schemaless URLs if you are running DrFront on our SaaS platform. So "http://cust.com/fonts/myfont.woff" will then be "//cust.com/fonts/myfont.woff".

2. Enable Cross-Origin Resource Sharing for fonts (Apache .htaccess)

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff

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

0 Comments

Article is closed for comments.